# Need help with arduino sampling voltage and current

• HHOboy
In summary: Processing.In summary, the conversation is about building an electrolytic cell that uses electricity to break water into hydrogen and oxygen. The person is testing efficiency and needs to calculate the average current draw and voltage drop over a period of time for the cell. They have some experience with Arduinos but are confused about adding memory and outputting data via serial cable to a laptop. Suggestions are given for using analog input sampling and the analogRead() function. The idea of using a voltage divider and diodes is also mentioned to ensure the input to the Arduino stays within 0-5V. The person also asks about graphing the data and is given suggestions for using the Serial.println() function and
HHOboy
Hi, I built a electrolytic cell that uses electricity to break water into hydrogen and oxygen. I am testing efficiency and need a way of calculating the average current draw and voltage drop over a period of time for the cell. I have some experience using Arduinos in projects but not much. I know I will have to take samples then use a function to calculate the average voltage and current. By the way the current is measured using a shunt so 1mv = 1amp. The voltage drop averages around 40 volts. I have researched some but am still very confused on adding memory to the arduino and outputting data via serial cable to a laptop. Any help would be much appreciated. Thanks in advance.

Engineering news on Phys.org
Sounds like you want to do some analog input sampling. Remember the Ardunio can only measure inputs between 0-5V, so you want to design a circuit with a voltage divider and some diodes to ensure that the input to the Arduino never exceeds the value it can take (trust me, you'll fry the thing if you don't).

Have a look at this one:
http://fritzing.org/projects/voltage-divider/

As for the actual analog signal sampling, the Arduino is very useful and userfriendly. Have a look at the analogRead() function:
http://blog.littlebirdelectronics.com/tutorial-arduino-and-the-aref-pin

Last edited by a moderator:
Thanks for the reply, I now understand how to read the voltages with the arduino, but I don't totally understand the serial functions that are used to output the data that is recorded. I understand that I can use the Arduino environment to process this serial data input but I was wondering if you know a good way to maybe make a graph out of the data. Again thanks for all of your help.

Last edited:
No worries!
Well, what serial functions are you using at the moment?

An easy, but slow, method that I sometimes use when I need to graph data is to use the Serial.println( ); function, and then simply graph the data I get versus time in some other software (Excel)

Hello,

It sounds like you are working on an interesting project! Sampling voltage and current with an Arduino can be a useful tool for analyzing the efficiency of your electrolytic cell. To calculate the average current draw, you can use the formula I = Q/t, where I is the current, Q is the charge (measured in coulombs), and t is the time. Since you are using a shunt to measure the current, you will need to convert the voltage reading to current using Ohm's law (I = V/R). As for calculating the average voltage, you can simply take the average of all the voltage readings over a period of time.

To add memory to your Arduino, you can use an external EEPROM (Electrically Erasable Programmable Read-Only Memory) module. This will allow you to store the voltage and current readings over a longer period of time. You can then use the serial cable to output the data to a laptop for further analysis.

I would suggest doing some research on using EEPROM with Arduino and familiarizing yourself with the code needed to read and write data to it. Additionally, you may find it helpful to use a data logging shield, which will make it easier to store and retrieve data from the EEPROM.

I hope this helps and good luck with your project!

## 1. What is Arduino?

Arduino is an open-source microcontroller platform that allows you to create interactive electronic projects. It consists of a programmable board, software IDE, and a community of users and developers.

## 2. How can I sample voltage and current using Arduino?

To sample voltage and current with Arduino, you will need to use analog inputs. These inputs can measure voltage levels between 0 and 5 volts. You can use a voltage divider circuit to reduce the voltage to within this range, and a current sensor to measure current.

## 3. What is the purpose of sampling voltage and current with Arduino?

Sampling voltage and current with Arduino allows you to monitor and control electronic devices and systems. This data can be used for data logging, automation, and other applications where accurate measurements are required.

## 4. Can I use Arduino to control voltage and current?

Yes, you can use Arduino to control voltage and current by using digital outputs. These outputs can provide a voltage of either 0 or 5 volts, which can be used to control electronic devices such as motors, lights, and relays.

## 5. Are there any limitations to sampling voltage and current with Arduino?

While Arduino can accurately sample voltage and current, it is important to note that it has a limited range and resolution. The analog inputs can only measure up to 5 volts, and the resolution is limited to 10 bits, which means there are 1024 possible values. Additionally, external circuitry may be required for more precise measurements.

Replies
32
Views
3K
Replies
22
Views
1K
Replies
1
Views
1K
Replies
7
Views
4K
Replies
5
Views
3K
Replies
8
Views
2K
Replies
4
Views
3K
Replies
11
Views
6K
Replies
78
Views
8K
Replies
2
Views
1K