1-channel 5 V relay module
A switch controlled by the ESP32: when the relay is activated, the coil pulls the contact and COM moves from NC to NO (you can hear the click; here, with Sound on). Most modules are active-low: rele.value(0) turns it on and rele.value(1) turns it off. Mains loads only with the teacher present.
Pinout
| Pin | Connect to | Note |
|---|---|---|
| IN | GPIO (e.g. 26) | control |
| VCC | VIN (5 V) | |
| GND | GND | |
| COM | common of the load | middle terminal |
| NO | load that turns on when activated | normally open |
| NC | load that turns on when released | normally closed |
FastTeacherFor teachers
From the syllabus to a planned semester
- Teaching plan and calendar built automatically
- Class diary ready to paste into SIGA
- Slides and exercise lists with answer keys
Free Community edition · Windows
MicroPython example
from machine import Pin
import time
rele = Pin(26, Pin.OUT, value=1) # active-low: 1 = off
while True:
rele.value(0) # on: COM moves to NO (click!)
time.sleep(2)
rele.value(1) # off: COM goes back to NC
time.sleep(2)
Specifications
| Item | Value | Source |
|---|---|---|
| Power supply | 5 V (VIN) | Typical datasheet values |
| Control | most are active-low (choose it in the part’s property) | Typical datasheet values |
| Contacts | COM, NO (normally open), NC (normally closed) | Typical datasheet values |
| IN input | read with the ESP32 thresholds; floating IN = off | Simulator model — Under review: real input threshold of the module with VCC at 5 V and IN at 3.3 V |
| Pin header order | IN, VCC, GND | Typical datasheet values — Under review: check on the lab module |
Values marked "Under review" will still be checked against the parts in the lab.