ESP32 Relay for dashcam power?

ChampaRando

Member
Joined
Jun 12, 2021
Messages
82
Reaction score
27
Location
Right behind you
Country
Australia
Hi guys. Again some newbie questions.

So I finally got some time after few months of being busy. So I have received my ESP32 a while back, I bought a LiFePO4 Powerbank (it says its 313Wh but from my testing and current measurements its roughly 260Wh or something; yes i know there is energy loss but still, anyways - still heaps more than overpriced Cellinks).

So I was planning to use my ESP32 to build a cool system. I will try to cut off my dashcam at 20% SOC for the Lifepo4, which equates to around 12.8V. So some issues I have, most dashcams (infact all, my U1000, Viofo A139) have cutoffs from like 11.8-12.4v. According to my research, 12.4v is NOT 20% SOC for LifePo4s so I thought to use my ESP32 to monitor voltage using a voltage sensor (ordered 10pcs off Ebay :D). So now I need a relay to actually cut power from the dashcam using my ESP32. I've seen tutorials on the web, that use ESP32 to make a Wi-Fi Switch and all and they use "5V SPDT Relays". Something like this (https://www.ebay.com.au/itm/224345421381).

But I have also seen some 12v relays, exactly the same, for example these ones (https://www.ebay.com.au/itm/224642336798). So the main question here is, which one do I exactly need? Because online tutorials are controlling devices even like fans and other things which obviously use more than 5V from the mains electricity, all this by using 5V relays and ESP32. So I thought I'd use what they used, but having seen there are 12V relays for ESP32 as well, do I need the 5V or 12V? Because the powerbank I have has a 12V output, so i will just plug that into my hardwire kit using splicing, and throw this relay in the middle as a middleman with ESP in the middle too, controlling it. So if I am getting 12V to the relay and through to the hardwire box/U1000, don't I need the 12V version? or 5v?

Got no idea :p Appreciate if anyone has an idea.

Thanks people.
 
You have to consider the output of the pin you are going to use to control the relay from the ESP32
Depending on the voltage from that pin and the total amount of current it can sink will help you work out what is the most suitable relay to use.

The relays you gave the links to will have no trouble switching the current for a Dashcam. They are rated at 10 Amps @ 30V
Keep in mind when you switch a relay you will get back emf which could destroy your cct or put a spike on the dashcam line.

Cheers.
 
Check out m5Stack, they have an ecosystem of ESP32 devices and accessories.
 
You have to consider the output of the pin you are going to use to control the relay from the ESP32
Depending on the voltage from that pin and the total amount of current it can sink will help you work out what is the most suitable relay to use.

The relays you gave the links to will have no trouble switching the current for a Dashcam. They are rated at 10 Amps @ 30V
Keep in mind when you switch a relay you will get back emf which could destroy your cct or put a spike on the dashcam line.

Cheers.
Oh okay makes sense. In regards to back emf, what can I do to protect against it (I have 0 idea haha, never studied electrical)?

Cheers.
 
Oh okay makes sense. In regards to back emf, what can I do to protect against it (I have 0 idea haha, never studied electrical)?

Cheers.
You can place a diode across the + and gnd

Here’s a simple video that demonstrates back emf.
?t=1m30s

Cheers.
 
Back
Top