Non-latching relay fails to deactivate
Posted: Sun Apr 01, 2018 4:50 am
I connected the pyboard v1.1 and this 5V relay like this:
https://www.aliexpress.com/item/Free-Sh ... 0.0.reQrIv
- V+ to VIN
- GND to GND
- IN to X1
I'm using this to test the relay control:
[code]
relay_pin = machine.Pin('X1', machine.Pin.OUT)
while True:
relay_pin.high()
pyb.delay(1000)
relay_pin.low()
pyb.delay(1000)
[/code]
There is something strange going on with the relay, though:
- When the pyboard is connected to the USB of my PC: it activates when high, but does not deactivate when low, remaining activated until I disconnect IN from X1.
- When the pyboard is connected to a simple USB power source: it works fine.
The pin output seems ok, 0 V when low and 3.28 V when high.
The voltage on VIN-GND is 4.10 V when connected to the PC and 4V when connected to the USB power source.
Any idea what's going on?
https://www.aliexpress.com/item/Free-Sh ... 0.0.reQrIv
- V+ to VIN
- GND to GND
- IN to X1
I'm using this to test the relay control:
[code]
relay_pin = machine.Pin('X1', machine.Pin.OUT)
while True:
relay_pin.high()
pyb.delay(1000)
relay_pin.low()
pyb.delay(1000)
[/code]
There is something strange going on with the relay, though:
- When the pyboard is connected to the USB of my PC: it activates when high, but does not deactivate when low, remaining activated until I disconnect IN from X1.
- When the pyboard is connected to a simple USB power source: it works fine.
The pin output seems ok, 0 V when low and 3.28 V when high.
The voltage on VIN-GND is 4.10 V when connected to the PC and 4V when connected to the USB power source.
Any idea what's going on?