Author Topic: [Design] How to drive many "high" current relays and LED out of GPIOs (ESP32)  (Read 360 times)

0 Members and 1 Guest are viewing this topic.

Offline crgarciaTopic starter

  • Regular Contributor
  • *
  • Posts: 61
  • Country: ar
Hi,

I want to build a panel that has:
- 8 push buttons (like this one: https://m.media-amazon.com/images/I/51+XvhFq5FL._SL1100_.jpg)
- 8 5V LEDs (in the button, but controlled separately)
- 8 relays

I want to control all that with an ESP32.

The relays are in a modules, triggered on LOW, similar to this one:


Relays:
I have some 74HV595 shift register, that I thought I could use to control the relays.
My concern is that the relays might get triggered while the microcontroller is booting. To solve that, I was planning to add a transistor to a GPIO to control the relays power supply (JD-VCC) (the PN2222A in the schematics bellow)

Leds:
I was thinking on adding a ULN2003 in series to the 74HV595, that would allow me to handle more current and voltage

My conceptual design:



Since I am a self-tough beginner on electronics (pretty dangerous combination)... What do you think on that design?
Is there a better way to make sure the relays are all off while the microcontroller is booting?

Thank you!


 

Offline Kim Christensen

  • Super Contributor
  • ***
  • Posts: 1327
  • Country: ca
Isn't the ESP32 a 3.3V device? The way you've got Q1 wired means that the relay module would receive less than 2.6V because of Q1's 0.7V Vbe drop...

Another way of disabling the relays would be to drive pin 13 (-OE) of U2 high during boot and only shift it low once the data has been clocked into U2 and latched.
 
The following users thanked this post: crgarcia


Offline Benta

  • Super Contributor
  • ***
  • Posts: 5880
  • Country: de
Place a pull-up resistor on the OE input to the HC595, and a transistor to pull it low when your MCU is ready. Remember a pull-down on the transistor base as well as a series base resistor. A small logic-level MOSFET sould also do the job.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf