Hi Guys,
This is my first time here and I am really not sure about the rules and things.
So I am planning to control a light switch using the photon,so I am using a single channel relay and I have connected it to ground and connected the vin of the relay to 3V pin,And the terminal pin of the relay is connected to pin D7.
As a start i put it as on for 5 seconds and off for 5 seconds.But my relay doesn’t respond,its power green LED is on and the red relay light is also on all the time.
I dont know why the relay doesnt respond.The relay works well I tested it manually.
yes I have tried all pins individually to see wether there is a voltage problem,Yes when the orange is connected to the ground the relay works perfectly.
I found what I believe to be the relay board you are using, the HL-51. How can they possibly sell a relay board like that with free international shipping for US$0.89? Yes, 89 cents! Unfortunately, the eBay seller didn’t link to the schematics or specs, so that wasn’t that helpful in this case.
Place a pull-up resistor of reasonable size (e.g.10 kOhm) between VIN and D6. This will force the pin to a 5V state when ‘idle’ (high).
When you digitalWrite(D6, LOW); you are bringing the signal pin to ground. Hopefully that will create enough of a voltage drop for your finicky relay module to trip.
when youdigitalWrite(D6, HIGH); it will bring the pin up to 5V, not the expected 3.3V, but that pin is tolerant of 5V.