The use of the ESP8266 in the world of IoT

User avatar
By David4875
#94538 I’m running NodeMCU 8266 with the Cloud4rpi MQTT web service. I have a Cloud4rpi switch control that when set to True switches on an external LED on GPIO12.

BUT I want this to switch a relay too, and True on GPIO12 is 0V not 3.3 (measured on a voltmeter). This means the relay switches on when the switch is set to False, and off when it’s True - so the opposite of the LED.

Any ideas how to fix this so the LED is On and the relay is powered at the same time?
User avatar
By tepalia02
#94546 You can use an inverter IC like 7404 to invert the output of GPIO12. If you connect the input of 7404 to GPIO12, the output of 7404 will be low when GPIO12 is HIGH. That low output can be used to drive your active LOW relay.