Monitoring Voltage with ESPHome, D1 Mini ADC, and Home Assistant

preview_player
Показать описание
Monitor power supplies or other low voltage DC supplies with Home Assistant and an ESP8266 D1 Mini ADC circuit. Use an external voltage sensor module voltage divider. Use Grafana to watch values over time.

Join this channel to get access to perks:

If you would like to support me:

Products I reference in my videos (Contains affiliate links)

DISCLAIMERS: Some of the links above take you to affiliate sites that may or may not pay a small commission to me. As an Amazon Associate I earn from qualifying purchases. It doesn't increase the cost to you, but it does help support me in making these videos.

00:00 Intro
00:42 Program ESP8266
06:03 Volt Divider/ESP8266 Overview
08:35 Completed Wiring
10:20 Voltage Output and Multiplier
12:11 Add Sensor Integration to HA
13:00 Determine Multiplier Offset
16:24 Build Sensor Template
18:28 Display Sensor in Grafana
20:45 Overvolt Alert Automation
22:09 Final Thoughts and Wrap

Want to send me something? Send it here!
Mostlychris
24165 IH-10 West
STE 217 #164
San Antonio, TX 78257
Рекомендации по теме
Комментарии
Автор

I like how you're straight to the point, no cheesy jokes, no cringe "I'm the ultimate dad" vibes, just very technical and to the point yet slow and clear enough to follow and not get lost. Thanks for your quality content!

Mobytts
Автор

Very good tutorial. I added a few extra lines in the template for the esp config in case anyone is interested. It also removes the need for an extra sensor in HA config. Just adjust the lambda value to suit.

sensor:
- platform: adc
pin: A0
name: "Your choice"
unit_of_measurement: "Volts"
icon: "mdi:car-battery"
accuracy_decimals: 1
update_interval: 60s
filters:
- multiply: 3.3
- lambda: return (x - 0.06)*5;

jackofmosttrades.masterofsome
Автор

Thank you. This is a good walkthrough and bonus Graffana intro for me!

mohitrahaman
Автор

You can eliminate the need for a template sensor entirely by adding a lambda section to the filters and doing the adjustment calculation in there.
filters:
- multiply: 3.3
- lambda: return (x-0.08)*5;

primusnz
Автор

It is nice to see someone creating an example using HA, ESPhome and, finally the automation. There is a real need for basic training in the areas discussed. We have enough pages or websites that explain functionality at the knowledgable programmer level.

MaxGoddur
Автор

Thank you for this video, Very helpful to get started. I am using this voltage monitor for my 24V off-grid battery bank. My ESP32 ADC needs to work between about 100mV and 900mV. Expecting voltages of up to 30V, I added a 1k resistor to the voltage divider output (just soldered it between A0 and GND because that was easier than messing with the smd resistors on the "voltage sensor module". Next time, I won't use the voltage sensor module, but rather build a matching voltage divider immediately.

marcjacquinot
Автор

Instead of performing the additional calculations, I would just change the filter from 3.3 to 15.8 then the ESP32 would report the actual PSU voltage directly back to HA.

Corgitronics
Автор

I think I learned more about how to build things with ESPHome and Home Assistant in this video than in many others. Not to mention it was well thought out and easy to follow. Now I'm off to set up a voltage monitor for a solar attic fan.

webluke
Автор

Long time subscriber Chris! I'm finally getting around to using this setup to monitor my vehicle batteries. Ordered the voltage dividers today. Thanks for the awesome videos man!!

mikesmods
Автор

The voltage divider in the Wemos D1 is a pair of resistors, one below the actual ADC block and one towards the input which you now attach to the center of another pair of resistors, so one towards ground and one towards the voltage you want to measure, but ... the two resistors inside the Wemos are now in parallel with the external one to ground, so the total resistance is no longer what you thought your voltage divider would provide. Since the value inside the Wemos is known, you can better simply add a single resistor from the ADC pin of the Wemos to the voltage you want to measure, basically increasing the factor the new voltage divider created this way will use.

MisterkeTube
Автор

Interesting video. One time no one could hear me on my radio. I bumped the knob on my power supply. I don't remember the voltage but it was very low. 🤣 I'm switched to 100% solar for all communication gear now though. I get voltage reports from my charge controller via modbus to MQTT with Tasmota now. Works great

jmr
Автор

If it's a linear power supply and the regulator fails, the output immediately jumps to 30 V - not gradually. There should be a crowbar protection circuit inside the PS that shorts the output on over voltage so that it blows the fuse before the connected load is damaged. Still nice to know voltage, especially for PS without a meter and for a PS mounted remotely where you wouldn't see the meter anyway!

I love the video and the work.! Thanks

markanderson
Автор

What do I need to add to this set to measure a 24v battery whose value reaches up to 29v?

Anniu-qupb
Автор

Great video

May i know which video editor you used for recording screen together with your face cam?

TechnoEveryday
Автор

if you need or want to become confused you are doing a great job ! ;-)

Doerakker
Автор

How to monitor lifepo4 12v from esphome? What should I multiply to get the correct value?

PaisitW
Автор

If the power supply goes up to 30 volts, I don't know if it will blow up whatever you have it supplying power to, but I think it could blow up the ESP32, even after going through the voltage divider. 30 V / 5 = 6 V > 3.3 V. You may want to change your setup so that the Tasmota switch turns the power supply off automatically as soon as it gets to 3.3 V * 5 = 16.5 V.

chesshooligan
Автор

how many of this sensors can be connected to a one ESP to measure three different power sources?

andrewsucre
Автор

21:04 in the automation you should not use state but instead use numerical state.

Now if your power suply goes from 13.9 to 14.1 your automation will not fire. With numerical state you can set a above or below value

PetervanHofwegen
Автор

Chris I finally got this going and got the template to report correctly. Question 1 is how to get the corrected voltage to report to the HA dashboard. Question 2 is how to set a voltage trigger to alert me if the voltage goes to some preset voltage (ie 11 volts)
Thanks Steve

stephengansky