TUTORIAL: How to Measure / Read Voltages Into Arduino - (Part 3/3 Voltage Dividers - Analogue)

preview_player
Показать описание
A tutorial in which I talk about reading voltage into Arduino. There are two main paths to take; Less than 5v and greater than 5v. I talk about how to handle both scenarios.

This video is about voltage dividers in practise - This video is a demonstration with wireup and code for a specific example.

Рекомендации по теме
Комментарии
Автор

Nice video Antony. Love your laid back style in teaching your information. You are awesome! Please keep videos like this one coming!👍👍

kenadams
Автор

Anthony, Thanks for your vid. It did cover everything really well and easy to follow.
I now have this issue and need some help.

I followed your instructions to the letter:
Used four NodeMCU ESP8266 and build this voltage measure unit to constantly test my solar backup batteries.


I used two 10kOhm and a 4.75kOhm resistors.

After setting it up on a breadboard I connected all four to the same Laptop Power supply. 15Volt and 4Amp to finetune the formulas so all would be giving the exact same reading.
They were connected for about 10 days and I also connected to a battery charger that acts as a battery providing 13.4 volts.


So far I had no issues, just twigging the formula.
Today I decided to swop over to the batteries I want to monitor. It is Gel batteries 12 Volt each 200 Ah batteries.
After connecting I double-checked the + and - and hook op the power supply to the USB cable. At the time I think I heard a soft pop sound, but continue connecting.
After I connected three I thought I should first check if the readings are published to my MQTT server as expected.


No readings:- So I tested the power supply that was feeding the NodeMCU's and all seemed fine.
When I connected the last one I heard an audible thump sound and a small flash inside the protective box.
When I opened it, I noticed that two connectors from the micro USB that are soldered to the PCB were burned and caused the flash.


I am really baffled as I did follow your instructions, tested the set for about 10 days and the ONLY thing that changed, was the AMPS.
from 4 Amp to 200 Amp


Any ideas?

onlyiwilknow
Автор

This was a great explanation. Very clear. THANK YOU.

MikeR
Автор

Thanks! I'm powering an ESP32 circuit with a pair of 18650 cells (in series), using an
LM2596 to step down the voltage. I want to keep an eye on the voltage. Dividing the voltage by three with three 100K Ohm resistors gave me the expected one third voltage. I'm reading it with an ADS1115 as I've heard the analog input on the ESP32 is sub-par and I already had the ADS1115 in my project, so this wasn't really a problem. Seems to be working great. Adding the additional battery voltage sensor (and a second sensor with battery in percentage) within ESPHome was a snap.

Dorff_Meister
Автор

Next step, '555' timer 🤭

I'm in the process of building a gps speedometer for my Virago XV400.
Going to add a 'battery voltage /charge indicator using a Ws2812b led.
Some comments / inputs from your previous videos on this.
1. I'd use an external Vref for the arduino, say 3.3V from voltage regulator. This would avoid any Vsupply issues. Note, I found setting vref to INTERNAL was' iffy', DEFAULT worked better. Of course, EXTERNAL if you go that way.
2. To protect the A input, I'd try a zener diode maybe 4V7 on the input if using 3V3 ref.
3. For me, the top end voltage I'll use 20V as could get that high if the voltage regulator goes North.
4. Someone commented when using an LED segment display it's too fast around the loop(). Try using the Watchdog Timer, say set @ 500mS and update the display within the ISR.
I might do some experiments this week see what's a good combination.
I've seen on some MPPT solutions, an R/10V zener used as voltage divider. I haven't got my head around that one, yet!

petermccool
Автор

This vdo save my life THANK YOU SO MUCH!

ggrizzisabear
Автор

Very well explained. I now understand. Thanks 👍🙂

stuffoflardohfortheloveof
Автор

I am planning to measure high voltage like 300v-500v DC from this method. It is possible right?
thank you

sasankasulakshana
Автор

Thank you so much for your excellent vid:-

I want to monitor my four PV system batteries and the voltages have to be spot on.
(I want to use that info via my MQTT server and with Node-RED trigger, contactors to protect batteries)

So with a constant supply of 13.4 Volt, I added a 19.72 K Ohm and 4.94 K Ohm resistors.
I then measured with a digital multimeter:-
Battery input 13.4V
Input AO and Gnd 2.66 Volt
Node MCU ESP8266EX 3.22 Volt.

My calculations then are:

MVPC: 2.66 / 1024 * 1000 = 3.14453125
Multiplier: 13.44 / 2.66 = 5.03759398

I then get a reading of 14.21 Volts
(With an analog count of 897)


What am I doing wrong?

- It is .81 Volt off, and for Deep cycle batts it is a lot

Regards

Frits

onlyiwilknow
Автор

Hi!
I realise this is an older Tutorial, but I stumbled across this to figure out how to make sure my LiPos don't get below a certain Voltage, to protect them.
After watching all three of these Tutorials, I'Ve come to wonder if this method works with Lipos without problem... I have a 1s and a 2s LiPo that I need to Monitor this way.

Thank you very much for your time and thank you for these great Tutorials!

BasilHerb
Автор

I had a question. Basis on the voltage detected by the arduino can I program it in such a way that it says the arduino should turn on only if voltage exceeds 13 volts?

kashifshad
Автор

can you help me out with RMS voltage measurement with mains supply for three-phase I have tried Emonlib it works well but not working for individual voltage sensors.

shehriyarbinak
Автор

What resistors would I need to make it draw less current and handle a max of 17 volts just to be safe cuz my charger charges at 16 volts?

blakerhoades
Автор

Can we measure current with this process? Or is there any easier way with Arduino.

pettypavlow
Автор

what is MVPC, anyone can explain it to me ?

LoiNguyen-umde
Автор

what if i had a source made only with a full bridge rectifier, a 47u capacitor and a 100k resistance in paralel, ....i want to measure that voltaje with arduino in the way you do....but there is a problem, the arduino ground always may have the same reference that the source, but the dc voltage of this source is compound of (for example) +50v and -50v, and arduino would measure 100v....what hapend if i conect -50 to the arduino ground? a ask you that beacause i did that, i made a voltage divisor, and sometimes i had a -50v conected to the arduino ground and the arduino measured that 100v without problems almost 20 times but then arduino died :( ....i dont know exactly why at the begining it didnt crash, and then it did, ....im confused

joseespinosa
Автор

Now go back and do a revisit on code updates to make the ADC more accurate by implementing the code to check for internal chip voltage 😎 jk

Good work on your presentations.
One thing I didn't notice you say (which, you may have and I just missed it) is that the higher the voltage you are dividing, the worse the resolution becomes. Also, the more dividers that are used, the worse the resolution. This can be an important factor when needing to measure high voltage (like mains for example) and you can only get 0.1V resolution. Kinda skews kWh usage after awhile.

korishan
Автор

sir you did not mention that where did you get the value of mvpc=4.55?. and what it indicates for?.

zawirzahid