Author Topic: ESP32 relay board, voltage supply questions  (Read 1398 times)

0 Members and 1 Guest are viewing this topic.

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
ESP32 relay board, voltage supply questions
« on: September 01, 2019, 11:39:36 pm »
I'm working on a MCU relay board for a small home/hobby project.  I plan to use an ESP32 with a 256x64 dot matrix lcd, and a few Songle relays controlled by mosfets.

Datasheets for the parts (save you guys the time):
esp32 WROVER module - https://www.espressif.com/sites/default/files/documentation/esp32-wrover_datasheet_en.pdf
lcd - https://www.buydisplay.com/default/3-8-inch-graphic-256x64-lcd-display-module-uc1698-black-on-white, datasheets are at the bottom of the page
relay - https://lcsc.com/product-detail/Relays_SRD-03VDC-SL-C_C24585.html, an english datasheet - http://www.circuitbasics.com/wp-content/uploads/2015/11/SRD-05VDC-SL-C-Datasheet.pdf
mosfet - https://lcsc.com/product-detail/MOSFET_Microchip-Tech_TN0702N3-G_Microchip-Tech-TN0702N3-G_C152199.html
power supply - https://www.mouser.ca/datasheet/2/260/r1936_3-1109422.pdf

The question is about voltages.  The ESP32 is a 3.3V chip with a recommended operating range of 2.3V to 3.6V, the LCD and relays are 3V devices.  The LCD has an absolute max of 3.6v, with a recommended range of 2.7V to 3.3V.  The relay likewise has a recommended voltage of 3V but states that'max allowable voltage is 110%', which I assume means 3.3v?


So the main question is.  What voltage do I run the parts at?

Do I just run the whole board at 3.3V (the easiest solution), and because 3.3V  is within the recommended range of the LCD not worry about it?  Tiny transient voltage spikes will be covered by bypass caps and I needn't worry?

Do I run the whole thing at 3v (again within the recommended range of all the devices).  Would this affect the stability of the ESP32, in particular timing or Wifi functionality?  Also I was going to use the IRM-05-3.3V, I don't think there's a 3.0v version.

Should I run the ESP32 at 3.3v and use some sort of resistor divider or similar to run the lcd and/or relays at 3v?  The logic will still be 3.3v, but it shouldn't matter?

Other alternatives?


Also is that mosfet a good choice for this application?  Should I go with the IRM 10W version (https://www.mouser.ca/datasheet/2/260/r1937_3-1109586.pdf) instead of the 5W version?
 

Offline Byonnem

  • Newbie
  • Posts: 9
  • Country: nl
  • Bachelor Student EE
Re: ESP32 relay board, voltage supply questions
« Reply #1 on: September 02, 2019, 02:11:03 pm »
I am by no means an expert. I am still a student but here is my take on this problem.

The first question that comes to mind is does the ESP have a voltage regulator? I could not find anything about it on the datasheet. It would be wise to get a voltage regulator for the ESP. then you can run the entire project on 3.3V, also because the voltage regulator will have a small voltage drop.

Never use resistor(/voltage) deviders to power something. You are just throwing away efficiency and creating a heating element.

About the Relay: the datasheet covers many relays. You need to specify which one you are going to use.

About the MOSFET: Depends on the chosen Relay. But assume that 3V is probably creating a high Rds.

About the supply: You should calculate the wattage of your system, then you can easily determine if 5W is enough.


If i just said many things that are not true, please correct me. I'm here to learn too :)
 

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
Re: ESP32 relay board, voltage supply questions
« Reply #2 on: September 02, 2019, 08:35:13 pm »
The IRM-05-3.3V is a 5 watt 3.3v AC-DC regulated power supply.  Its larger brother is the IRM-10-3.3V, a 10 watt version.

While its true I would be throwing away power with a voltage divider, the LCD doesn't draw much (only 1 mA) so I don't see heat or power loss being an issue.

The relay I was planning to use was the 3V version.

I'm confused about the Rds on problem.  The spec sheet shows about 2 ohms at 3V.  That seems pretty small, unless I'm misunderstanding what Rds is, I don't see how that would be a problem.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: ESP32 relay board, voltage supply questions
« Reply #3 on: September 02, 2019, 09:21:54 pm »
Those MOSFETs seem crazy expensive. Any reason you need that one in particular?
Would something like this work instead?

I spent only a couple minutes looking for a cheaper part, but $0.02 vs $1.09 is something that I'd spend a little time having a look into for sure (even if it was for a one-off; it's the educational and engineering principle as much as anything else).
 

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
Re: ESP32 relay board, voltage supply questions
« Reply #4 on: September 02, 2019, 10:30:59 pm »
I completely agree, and if all goes well I hope to be making a few (not selling them, but a friend would like 1 or two boards as well), so shaving off a few bucks would make sense.  Being a beginner though I wasn't sure.  Those are 'logic mosfets' or something to that effect and have a very low Vgs(th) so I can drive them directly from the ESP32 pins.

As far as the one you linked...  I think they might work?  The output characteristics shows that at a Vds and Vgs of 3.3V drain current Id is just over 350mA, which is more than enough for my needs (I need 165mA for the relay, and about 5mA for a led, so anything over 200mA should be more than sufficient).  I was looking for something in a larger (easier to solder) package though.  Would https://lcsc.com/product-detail/MOSFET_Wuxi-NCE-Power-Semiconductor-NCE0106Z_C191374.html work?
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: ESP32 relay board, voltage supply questions
« Reply #5 on: September 03, 2019, 11:39:27 am »
If you’re making a custom PCB, the ones I linked would be very easy to hand solder as well (you’ll find that SMD parts with legs are faster and less fiddly than through hole parts after a very short learning curve).

I’m only on phone at the moment, so can’t dig into the part you linked.
 

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
Re: ESP32 relay board, voltage supply questions
« Reply #6 on: September 03, 2019, 11:11:39 pm »
Well thanks for the info/replies.  I'm not as confident with my soldering ability as you are it seems, but I'll give them a try.

Any thoughts on the voltage question?
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: ESP32 relay board, voltage supply questions
« Reply #7 on: September 03, 2019, 11:39:25 pm »
Do I just run the whole board at 3.3V (the easiest solution), and because 3.3V  is within the recommended range of the LCD not worry about it? 

Yes, that should be fine.
Relays too, everything from 3.3v

« Last Edit: September 03, 2019, 11:43:18 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
Re: ESP32 relay board, voltage supply questions
« Reply #8 on: September 04, 2019, 04:03:36 am »
Thanks guys, I really appreciate the input.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: ESP32 relay board, voltage supply questions
« Reply #9 on: September 04, 2019, 05:16:36 am »
Don't forget to put diodes on the relays.
Since they are on the same rail as the ESP you dont want any spikes from them crashing the MCU.
Also since the relays are 3V they will draw quite high current compared to say a 12V relay.

Ideally you would have relays run off a separate higher voltage.
But i wouldn't worry to much about it unless it becomes an issue.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
Re: ESP32 relay board, voltage supply questions
« Reply #10 on: September 04, 2019, 08:55:14 am »
This is what I did for the relays:

 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9954
  • Country: nz
Re: ESP32 relay board, voltage supply questions
« Reply #11 on: September 04, 2019, 08:59:15 am »
Could also put like a 100uF capacitor across the relay coil to further smooth out any voltage spikes.
But its probably not needed.

Make sure your ESP32 power rail has some nice bypass caps close to the chip.
« Last Edit: September 04, 2019, 09:03:04 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline KaishaTopic starter

  • Contributor
  • Posts: 42
  • Country: ca
Re: ESP32 relay board, voltage supply questions
« Reply #12 on: September 04, 2019, 09:56:06 am »
I have a 22uF and a 100nF across the ESP32 GND/VDD33 pins (those values are what they specified in the data sheet for the ESP32).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf