How to read voltage and use the power at the same for (EX. Servo)

Hello forum,
I am experimenting with Arduino reading voltage with a 10k resistor. I have successfully done that but I realised I can’t use power when the mini USB cord is not in the Arduino Nano. I would like to use it when it is not plugged in like a lcd screen or anything else. I would only like to use resistors not a voltage sensor. If anyone would like to reply to me that would be great.

Arduino Nano
10k resistor
2x 1.5 alkaline batteries
< 5 volts

Regards SSzabo

Not sure I get the question

Do you plan to power your Arduino Nano with 3V?

Hi, welcome to the forum.

The "MKR" series have a connector for a battery.
The basic model is the MKR Zero: https://store.arduino.cc/products/arduino-mkr-zero-i2s-bus-sd-for-sound-music-digital-audio-data.

A cheap 8 MHz Arduino Pro Mini will run with three AAA batteries.

Some use a Arduino Uno with a 9V battery, but don't do that. That battery can not give enough power.

A normal multimeter is designed to last a long time on a battery. The Arduino boards are not designed for that. When you use a LCD screen, then the backlight needs current, so you need a bigger battery for that.

If you use an Arduino board to measure a voltage, then you need a good voltage reference. A Arduino has a internal voltage reference, but then you probably need a voltage divider (a voltage divider is two resistors).

Sorry there is no such thing as a resistance sensor. You can only sense voltage or current, you infer the resistance from one of those two things.

The circuit you posted will only ever read the voltage of the battery, until you get into the tens of meg ohm region.

The circuit is wrong i actually will use 3 AA batteries but in the schematic is shows only 2 sorry about that.

4.5 volt input = 5V pin

I mean not use a voltage sensor like the B25 voltage sensor. I would like to create my own out of resistors either a voltage divider or just a single resistor.

Some tutorials I watches are here - -

Thankyou for the replies

The Arduino Uno and Nano can measure their own VCC.
The VCC is used as reference voltage to measure its internal voltage reference. By reversing the calculation, the VCC can be calculated if the internal voltage reference is known.

If you connect the battery to the 5V pin, then you don't need to add any resistors of any wire. The Arduino can measure that voltage.

Search for "arduino secret voltmeter" or something like that.

Not all Youtube videos are good. You might learn wrong things.
We don't measure a voltage with the 5V as reference when it is not a stable voltage. We don't fix a (temporary) lower 5V in the sketch. We calculate the voltage in a different way. We don't use String when it is not needed.
You should also be careful with Instructables.com, there are also some questionable tutorials over there.

Yes we got that bit. The thing that is wrong is that you only have a single series resistor. That will not affect the voltage you read. You need a potential divider to measure voltage and then some calculations to turn it into a resistance.

To a great extent the accuracy will be determined by the accuracy of your fixed resistor.
I think @Koepel has the right idea here.

Oi! make your own voltage divider, cool!

Voltage Divider Calculator (ohmslawcalculator.com)

I use 10K for R2. If using a 5V MCU use 5V for Vout, if using a 3.3V MCU use 3.3V for Vout.

Thank you for the replies I’ll do some research and get back to you.
:slight_smile:

SOLVED

Thanks everyone I worked it out, using a voltage divider. I had 2, 1K resistors in series with it connected to VIN and ground.

CASE CLOSED

Also works with 4.5 volts

Aspart from the fact that you have no current limiting resistor on that LED.
D13 hasn't contained a series resistor for over a decade.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.