When I worked on my garage door opener, I wanted to use a 12V relay with a NodeMCU development board because that was what I had on hand but, I end up in a ton of trouble as I wasn't able to make it work.
The problem was that the high from the NodeMCU of 3.3V is way lower than the minimum high for a 12V relay so the relay was always on. This is easily solved with an optocoupler but I did not have one in stock at the moment so I ended up replacing the relay with a 5V one.
However, this got me thinking, about if it is possible to construct an optocoupler that can be handy for situations like this, and if it will work at all?!
In the end, the final optocoupler turned out much better than I thought it will and it worked flawlessly with the relay. You can see the entire build and testing phase in the video below.
These experiments are greatly possible because of the great help that Altium Designer and Octopart provide for my channel. As a gift to my viewers, Altium provides a free trial of Altium Designer and 25% off your Altium Designer purchase at: https://www.altium.com/yt/taste_the_code
Tools and materials used in the video:
- Light dependent resistor LDR - https://s.click.aliexpress.com/e/_DmG4odt
- White LEDs - https://s.click.aliexpress.com/e/_DeCCVnv
- Heat shrink tube - https://s.click.aliexpress.com/e/_DDc3xKf
- Resistors - https://s.click.aliexpress.com/e/_DDgMeK7
- Electrical Tape - https://s.click.aliexpress.com/e/_DkCqaP5
- Wire snips - https://s.click.aliexpress.com/e/_Dks0H4b
- Needle nose pliers - https://s.click.aliexpress.com/e/_DFIzTKR
- Multimeter - https://s.click.aliexpress.com/e/_Dm3Eo7V