Styr højstrøms enheder fra din microcontroller med et relæ
Relæ
Et relæ er en ideel måde at styre forskellige enheder der operer på en højere strøm en mikrocontrollers. Det kan FX anvendes til at tænde og slukke for lamper eller kaffemaskinen.
Relæet vil via et signal der sendes til dets signal ben styrer hvorvidt det tilsluttede kredsløb skal slukkes eller tændes.
Relæ kredsløb foregår ofte i to forskellige måder normally closed (NC) og normally opnened (NO).
Med normally open vil forbindelsen mellem den tilsluttede strømforsyning og det tilsluttede kredsløb som default være lukket, dvs. at der ingen strøm leveres gennem relæet, før der modtages et signal via relæets signal ben.
Med normally closed vil det være modsat hvor at kredsløbet som default vil være tilsluttet, og forbindelsen lukkes når der modtages et signal via komponentens signal ben.
Tekniske specifikationer
Interface | Digital |
Max strømstyrke | 10A (NO) 5A (NC) |
Max switching voltage: | 150VAC 24VDC |
Max effekt: | 100W |
Contact action time: | 10ms |
Kode Eksempel
from machine import Pin
import time
relay = Pin(17, Pin.OUT)
def on():
relay.value(1)
time.sleep(10)
relay.value(0)
Pinout
Pinout
Nummer | Navn | Function |
---|---|---|
1 | G (GND) | Negativ forsyning |
2 | V (VCC) | Positiv forsyning |
3 | S (Signal) | Kontrolsignal |
Hvordan fungerer den?
Referencer
Billeder og forklaring: https://randomnerdtutorials.com/micropython-relay-module-esp32-esp8266/
Kontroller relæ med ESP32: https://blog.couttsnet.com/esp32-micropython-and-controlling-a-relay/
MicroPython og relæ: https://techtutorialsx.com/2019/07/27/microbit-micropython-controlling-a-relay/
Inspiration og kommentarer
Er du faldet over links eller lignende, som kan være relevant for dine medstuderende så send os en mail på nini@kea.dk