# Voltage reading (+5V)

Hello people! thanks for reading me, I have a question, im doing my tesis with arduino and I need to make a comparing graph about following sun sistem for solar cells and I want to read the voltage from a cell but my cell gives 12Vdc as max. but I cant conect that to arduino, you guys have any idea about what to do? I thought about 7805 transistor but then I wont have correct readings about voltaje, do you have any idea?
Thanks for reading me

LOL sry, i got it, with a voltage divisor, but then... grounds most be together? ground from my arduino and ground from solar cell most be together? could some one tell me?

Connect GNDs.

.

Yes. Tie all of the grounds together. Place a 100Kohm and a 25KOhm resistor in series across the input voltage. With 12V input this will give you 2.4Volts across the 25K which you can read from the Arduino and code to get the correct value. Max input V with these values will be 25V to show 5V at the input pin

--
Mark

I thought about 7805 transistor but then I wont have correct readings about voltaje, do you have any idea?

A 7805 is not a transistor. It is a monolithic voltage regulator.
5V = 41.66 % of 12V so you need a voltage divider that has 58.33k ohms connected in series with 41.66 k ohms with the 41.66 k ohm resistor connected to GND and the 58.33 k ohm resistor connected to the solar cell 12V output:

12V * 41660/58330 = 4.9992 V (4.9992/0.00488 V = 1024 analog counts (will read as 1023)

You convert it back to the solar cell voltage by multiplying it by the reciprocal of the voltage divider resistor ratio (ie: 100000/41660 (2.4003840614498319731156985117619)

4.9992V * 2.4003840614498319731156985117619 = 12V

Thank you very much! it will be very usefull, Im going to check how to get those data into a txt to get a graph using sun follower and without it. Thanks again! =D

Just print the values to the Serial Port and capture them with a terminal capture program and then plot the text file output with Excel.

raschemmel:
A 7805 is not a transistor. It is a monolithic voltage regulator.
5V = 41.66 % of 12V so you need a voltage divider that has 58.33k ohms connected in series with 41.66 k ohms with the 41.66 k ohm resistor connected to GND and the 58.33 k ohm resistor connected to the solar cell 12V output:

12V * 41660/58330 = 4.9992 V (4.9992/0.00488 V = 1024 analog counts (will read as 1023)

You convert it back to the solar cell voltage by multiplying it by the reciprocal of the voltage divider resistor ratio (ie: 100000/41660 (2.4003840614498319731156985117619)

4.9992V * 2.4003840614498319731156985117619 = 12V

raschemmel:
A 7805 is not a transistor. It is a monolithic voltage regulator.
5V = 41.66 % of 12V so you need a voltage divider that has 58.33k ohms connected in series with 41.66 k ohms with the 41.66 k ohm resistor connected to GND and the 58.33 k ohm resistor connected to the solar cell 12V output:

12V * 41660/58330 = 4.9992 V (4.9992/0.00488 V = 1024 analog counts (will read as 1023)

You convert it back to the solar cell voltage by multiplying it by the reciprocal of the voltage divider resistor ratio (ie: 100000/41660 (2.4003840614498319731156985117619)

4.9992V * 2.4003840614498319731156985117619 = 12V

12V * 41660/58330 = 4.9992 V (4.9992/0.00488 V = 1024 analog counts (will read as 1023)

1. Assuming ArduinoUNO Platform with DEFAULT AREF (5V) for the ADC.

2. So, calculation is:
(1023*4.9992)/5 =1022.8 = 1023 (how is it 1024?).

It's 1024 if V in (analog) >5V

The UNO won't report anything > 1023 so the only way to know that the analog input voltage is greater than 5V is to measure it with a meter.
It can safely tolerate > 5 V as long as the overvoltage is less than one diode drop (0.7V).
It's easier if you just round off the values to whatever your DMM can display. ( two digits to the right of the decimal point).

raschemmel:
4.9992V * 2.4003840614498319731156985117619 = 12V

Wow such precision when speaking about result of ADC with at best +/- 1mV accurancy. When voltage reference is “somewhere around 5V” depending on load, noise from switching CPU and anything else connected to it I think real accurancy is +/- 10%

If you want to get some reasonable readings the OP should at least use internal reference and measure it with something trustworthy! The reference is said to be stable but it’s value may he other than the nominal 1.1V.

There's no need for precision in this application.
The fact that I used copy & paste from the calculator doesn't imply I think there is any need for precision. It just implies I was too lazy to round it off.

raschemmel:
There's no need for precision in this application.

You know how much precision OP needs?

raschemmel:
The fact that I used copy & paste from the calculator doesn't imply I think there is any need for precision. It just implies I was too lazy to round it off.

Many decimal digits do imply precision. Or that author was too lazy or stupid to remove them. Poor OP may be fooled into believing he will get some precision this way. He will not unless he get stable and known reference voltage and known ratio of resistor.

It's up to the OP to decide how much precission to use, not us. It is also up to him to choose the rounding tolerance. You don't need more than 1 digit precission if all your doing is measuring the output of a solar panel. Calling the use of uneditted calculator copy and paste "stupid" is no help to the OP who never stated his tplerance criteria. The fact that I didn't make tgat choice for him simply means I respect the OP's right o do so.
Why get sidetracked critizing me ? Why not just ASK the OP what resolution accuracy he needs ?

You know how much precision OP needs?

Huh, duh. It's a solar cell. The output is going to be a function of the weather. It makes no sense to use precision when the voltage is affected by clouds . The only useful information is the AVERAGE voltage !

I need to make a comparing graph about following sun sistem for solar cells and I want to read the voltage from a cell but my cell

You don't have to be a rocket scientist to realize that.