Join us at GITEX 2025! Discover our solutions at Hall 4, Booth H-30 Schedule a Meeting Today.
Automate Marketing Initiatives with Salesforce Marketing Cloud Learn More
Join us at GITEX 2024! Discover our solutions at Hall 4, Booth H-30 Book your live demo today.

Raspberry Pi & Arduino UNO Current Measurement System

In this article, we show you how to measure the AC Current and AC Voltage using the ACS712 current sensor and ZMPT101B voltage sensor. In addition to the Wattmeter, this circuit also acts as a Voltmeter and Ammeter which are used to measure voltage and current, respectively. If the connection is correctly managed, ACS712 measures the current accurately. We have worked with many of the current detectors, like SCT-013-030 and INA219, which are not as precise. 

As a low-cost and smaller AC sensor, ACS712 is selected for this project instead of conventional current transformers. With the ACS712 current sensor, current can be accurately measured when induced. It detects the magnetic field surrounding an AC wire and gives analog output voltage. The microcontroller processes the analog voltage output to measure the current flow through the load.

Raspberry pi

Raspberry Pi is a small single-board computer. Connecting peripherals like keyboard, mouse, and display to the Raspberry Pi will act as a mini personal computer.

art 1

Arduino Uno – Arduino Uno is a microcontroller board based on the ATmega328P. An ICSP header, a USB connection, a power jack, a 16 MHz ceramic resonator, a reset button, and 14 digital input/output pins (of which 6 can be chosen as PWM outputs) are all included.

art 2

Hardware Specifications for Measurement System 

These are some common hardware components:-

  1. Raspberry Pi  
  2. Arduino Uno  
  3. Bread Board  
  4. ZMPT101B Voltage sensor  
  5. ACS712 Current sensor 
  6. Jumper wire 
  7. Switch Board 

Software Specifications for Measurement System

These are some common hardware components:-

 

  1. Arduino Compiler 
  2. MC Programming Language: C
  3. VNC Viewer for Raspberry Pi
  4. MC Programming Language of Raspberry Pi: Python
  5. IP Scanner (for finding the IP Address of Raspberry pi)

Connection of Device and Software Setup – Step By Step

 

These are some common hardware components:-

  • Hardware connection of voltage sensor with Arduino Uno as well as with current sensor.
  • Hardware setup for serial communication.
  • Raspberry Pi Software setup.
  • Serial communication (with UART).
  • Code for current and voltage measurement in Arduino IDE.

1. Hardware connection of voltage sensor with Arduino Uno and current sensor respectively

For the connection established by the microcontroller i.e., Arduino Uno and the sensor. First, set the 5v and GND (ground pin) of our Arduino Uno to the breadboard. One point of the breadboard is common for the GND (ground pin). The other 5v pin is common for the power pin.

After that, we use a current sensor and a voltage sensor to measure the current and the voltage, respectively. At the beginning of the connection, check whether our voltage sensor model is ZMPT101B or not. Similarly, check if the current sensor model is ACS712.

  • Connection of Voltage sensor and Arduino Uno   

We can begin by checking the 5v pin, OUT pin, and GND pin of both devices. When that is completed, connect the pins. The GND pin of the voltage sensor has to be connected to the GND pin of the Arduino Uno device. The 5v pin of the Arduino Uno has to be connected to the VCC pin of the voltage sensor. Also, make sure the OUT pin of the voltage sensor is connected to the input pin of our Arduino Uno device, i.e., A0.

art 3 2

Connection of current sensor and Arduino Uno  

You can now check the 5v pin, GND pin and input pin of both devices. Connect according to the same pin of our Arduino device and sensor. Then, connect the 5v pin of the device to a current sensor of the VCC pin, the GND pin of the device connects to the sensor of the GND pin, and then the input pin of the device, i.e., (A1) is connected to the current sensor of OUT pin.

art 4

2. Hardware setup for serial communication

We have connected the Raspberry Pi and Arduino for serial communication via USB. A USB cable connector is the easiest way to connect an Arduino Uno and Raspberry Pi.

 

Note: Make sure your Arduino Uno is connected to a computer so that you can upload the code. Then, you will need to connect the USB cable to the Raspberry Pi. Through this cable, the Raspberry Pi can power the Arduino.

3. Raspberry pi software setup

Download and install the Arduino IDE in Raspberry Pi OS.

Install Python Serial library on Raspberry pi

We installed the pyserial library using the command prompt for the serial connection interface.
By using the command given below:

 // sudo pip install pyserial 

Locate the Arduino board

Typically, you should see the Arduino appear as /dev/ttyACM0, or /dev/ttyUSB0 (sometimes the number is different

For example: /dev/ttyACM1) when connected via USB cable.  

4. Serial communication (with UART)

For the serial communication of the Raspberry pi and Arduino Uno UART protocol is used. 

UART protocol

UART stands for ‘Universal Asynchronous Reception and Transmission’. Asynchronous allows communication between the two boards. Arduino has one UART in our device that can be seen either with a USB cable or from the RX/TX pins. Neither pin used at the same time. On the Raspberry Pi, it can connect to many serial devices on the USB ports. Using Raspberry Pi also uses the GPIOs (RX0/TX0) for an additional UART. 

 

5. Code for current and voltage measurement in Arduino IDE 

 

Let’s start with a simple program.

 

  1. Go to the Arduino IDE in our Raspberry pi VNC viewer
  2. Create a new file and save it on the Arduino IDE
  3. After saving the code, compile the code mentioned above 
  4. Go to the tools setting. Choose serial monitor
  5. Inside the serial monitor, you will see the current and voltage reading

 

Code for current and voltage measurement

ar 1 2 1024x607 1
ar 2 3 1024x635 1
ar 3 2 1024x590 1

A place for big ideas.

Reimagine organizational performance while delivering a delightful experience through optimized operations.

Testing the Application

When testing the application, you need to connect the raspberry pi and the Arduino Uno to check the power supply. Before connecting the current sensor, ensure to check the ground pin (GND), voltage output pin (VCC), and input pins of our sensor. Finally, you connect all of the pins using our soldering iron. Check the input pins, voltage pin VCC, and GND pins for the voltage sensor. After connecting the device to the 3-phase line, we will connect the relay to protect our device from damage.

 

For connection of the relay and Raspberry Pi, connect the JD-VCC pin of the relay to voltage pin 3.3 v of the Raspberry Pi and the VCC pin of the relay connects to the 5v of our Raspberry Ri. Similarly, the relay’s input pin (IN1) is connected to the GPIO12 pin and its ground pin (GND) is connected to the GND pin. Now we can connect our relay module to the supply. The red blink light indicates the ON position of the relay. When it is not blinking, it indicates the OFF position.

 

Advantages

  1. We can easily measure current and voltage using the Raspberry Pi and Arduino Uno.
  2. We can easily move both microcontrollers from one place to another.
  3. Its quite cost-effective.
  4. We can measure both current alternating current as well as direct current
  5. It is an easy-to-use tool.

 

Disadvantages

  1. Raspberry Pi cannot be operated on Windows operating system.
  2. If we use it continuously for 6-7 hours. then it heats above 70-degree Celsius.
  3. It lacks graphics processor
  4. It lacks internal storage in our microcontroller, which is why its performance is lesser than others.
  5. Its boot time speed is very slow during the initial setup.
  6. Sometimes, the system takes time to upload the data depending on the internet speed and module baud rate.

Conclusion

The presented smart system measures the current and voltage using the Raspberry pi and Arduino Uno serial connection. The multiple use cases of this using our Arduino IDE monitor include energy management, saving power from the power section, automatic control of energy meter, to make customers monitor their energy usage pattern, and power flow graph.

For more detail about the ACS712 current sensor follow the below reference link:-
https://embedded-lab.com/blog/a-brief-overview-of-allegro-acs712-current-sensor-part-1/

Top Stories

Odoo ERP Implementation (1)
How Indian MSMEs Can Use Budget 2026 Subsidies to Fund Their Odoo ERP Implementation
India’s Union Budget 2026–27 has sent a strong signal to small and medium enterprises: technology adoption is no longer optional — it is strategic. With a ₹10,000 crore MSME-focused fund, a ₹2,000 crore top-up for the Self-Reliant India Fund, and renewed emphasis on digital modernization, the government is actively encouraging
Sap’s critical 9.9 vulnerability
SAP’s Critical 9.9 Vulnerability: Why Mid-Market Companies Are Rethinking Their ERP Security
Resource Planning (ERP) systems sit at the center of business operations. When a vulnerability with a CVSS score of 9.9 is disclosed in SAP environments, it immediately draws attention — not because of hype, but because of operational risk. During the February 2026 SAP Security Patch Day, multiple high-severity security notes were released, including one
Odoo
Odoo v14 End of Life: What the October 2026 Kill Date Means for Your Business
If you’re still running your business on Odoo v14, you now have a hard stop on the calendar 31 October 2026. That’s when Odoo v14 will reach the end of life on Odoo.sh, and any database still on that version will be blocked from normal use. It’s not just a technical detail it’s a real business continuity risk if you ignore
10 Proven Tips for Successful Odoo Module Customization
10 Proven Tips for Successful Odoo Module Customization
Odoo is famous for its customizable nature. Businesses from around the world choose Odoo because of its scalability and modality. Regardless of the business size, Odoo can cater to the unique and diverse needs of any company. Odoo has proven its capacity and robust quality in terms of helping businesses
How Odoo is Transforming Traditional Education with E Learning
How Odoo is Transforming Traditional Education with E-Learning?
Does your school need to centralize data to easily access and share information between applications? Odoo provides an ERP system that can do so. Using multiple software applications for every department can be dragging. With Odoo, you can systematize your operations for efficiency, user-friendly navigation, uniform cross-functional practice, and increased
How Can Odoo Module Customization Revolutionize Your Purchase Management Workflow
How Can Odoo Module Customization Revolutionize Your Purchase Management Workflow?
Odoo ERP’s modules are engineered with a robust structure to drive efficiency across your entire organization. Each module is specifically designed to address distinct business functions, from finance and inventory to sales, marketing, and purchase management. This tailored approach ensures that every part of your company has the tools it needs to excel. The true power of

          Success!!

          Keep an eye on your inbox for the PDF, it's on its way!

          If you don't see it in your inbox, don't forget to give your junk folder a quick peek. Just in case.



              You have successfully subscribed to the newsletter

              There was an error while trying to send your request. Please try again.

              Zehntech will use the information you provide on this form to be in touch with you and to provide updates and marketing.