# DIY Cross Platform Data Acquisition System using Python and Arduino

**URL:** <https://forum.arduino.cc/t/diy-cross-platform-data-acquisition-system-using-python-and-arduino/1347440>\
**Category:** Tutorials\
**Created:** [January 27, 2025, 7:55am UTC](https://forum.arduino.cc/t/diy-cross-platform-data-acquisition-system-using-python-and-arduino/1347440 "2025-01-27T07:55:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xnth2021](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/xnth2021/32/1188433_2.png) [@xnth2021](https://forum.arduino.cc/u/xnth2021)\
**Post date:** [January 27, 2025, 7:55am UTC](https://forum.arduino.cc/t/diy-cross-platform-data-acquisition-system-using-python-and-arduino/1347440/1 "2025-01-27T07:55:12Z")

</div>

![arduino-python-pc-temperature-data-logger](https://europe1.discourse-cdn.com/arduino/original/4X/d/e/7/de701a5b1117479c3cdddf098f810c6ebde3ec19.jpeg)

We will build a low cost multi channel data acquisition and logging system using **Python** & **Arduino UNO** board that will **log** and save data to a **CSV (Comma Separated Values)** text file on the disk.

You can use this as a starting point for building your own simple data logging setup.

The DAQ System will work on **Windows** and **Linux Platforms**.

It **can** also work on **mac OS** based Systems, i have not tested it. Feel free to try it out on a mac OS machine and let me know about it.  
I don't have a **mac** so unable to check it out

# Logged data on Excel File along with Graph

 ![creating-charts-in-excel](https://europe1.discourse-cdn.com/arduino/original/4X/8/0/c/80c1eb93f49111d415eb95e988cb9622bbae07c6.jpeg)

 ![temperature-data-logger-python-output](https://europe1.discourse-cdn.com/arduino/original/4X/3/a/a/3aa257c4c7943082d247500a8868f62932b49ee5.jpeg)

  

# Contents

1. Arduino DAQ Design Video with Code Explanation
2. Online Tutorial + Source Codes Download
3. Things You should Know
4. Screenshots of the Program running on Windows and Linux
5. Hardware Setup
6. Datalogger CSV File Format
7. Basic Connection Setup
8. Notes

  

## Design Video with Code Explanation

[![](https://europe1.discourse-cdn.com/arduino/original/4X/5/0/f/50faa6e12843e8cad7155fdc53be4e6817863187.jpeg "Build a 4-Channel CSV data logging and acquisition system (DAQ) using Arduino and Python 3") ](https://www.youtube.com/watch?v=hpHv4Iux6_s)
  

## Online Tutorial + Source Codes

- [Build your own Data Acquisition and Logging System to CSV file using Python and Arduino](https://www.xanthium.in/python-data-acquisition-system-daq-arduino-log-to-csv-file)

- [Running the Arduino Datalogger on Linux](https://www.xanthium.in/serial-port-data-acquisition-system-logs-csv-file-linux-arduino-and-python)

- [Source Codes for Data Logging system on GitHub](https://github.com/xanthium-enterprises/Arduino-Python-Cross-platform-Data-logging-to-CSV-file-/)

Linux specific parts are on a seperate page

# Things You should Know

Here we will be using Python Serial Port Programming on the PC side to talk with the Arduino.  
So you should have a basic understanding of **Python** Language and **PySerial** Library.

If you are new to PySerial,

- Do Check out our Tutorial on Python Serial Port Programming using Pyserial on Windows and Linux Systems

Other thing is that we are using OS Signals (CTRL+C ) to stop the logging. So do check out

- [Python OS Signal Programming tutorial](https://www.xanthium.in/operating-system-signal-handling-in-python3)

# Screenshots of the Program running on Windows and Linux

The code is written to run on the command line using Python.

Here is the code running on **Windows** system

 ![python-data-logging-software-win32](https://europe1.discourse-cdn.com/arduino/original/4X/5/3/c/53cf5d96c39caa9fd11a5cb6f54852b7b5e85202.jpeg)

Code running on **Linux** system

 ![run-python-arduino-data-logger](https://europe1.discourse-cdn.com/arduino/original/4X/a/4/c/a4c6658a4ce8bab326a459b6e0f06671d4c1e7fb.jpeg)  
 ![logging-data-arduino-python](https://europe1.discourse-cdn.com/arduino/original/4X/6/7/d/67d46bef62af79dfc7013bee2b4f49f49e856092.jpeg)

# Hardware Setup

 ![arduino-python-pc-temperature-data-logger](https://europe1.discourse-cdn.com/arduino/original/4X/d/e/7/de701a5b1117479c3cdddf098f810c6ebde3ec19.jpeg)

  

Hardware Setup Consists of

1. Four LM35 analog temperature Probes
2. 4 Channel LM35 signal opamp amplifier board
3. Arduino UNO
4. Laptop PC running Windows/Linux OS system

The Arduino, specifically an Arduino UNO, is connected to the PC via the USB serial port to transmit data. It sends temperature values to the PC through serial communication in the format: Temp1-Temp2-Temp3-Temp4.

Here is a video of assembling the whole thing from Scratch

[![](https://europe1.discourse-cdn.com/arduino/original/4X/9/c/9/9c99fa7df65ad8cc586bdacc91fa004cb518f029.jpeg "Building Hardware of 4 channel Arduino LM35 temperature data acquisition system using Python") ](https://www.youtube.com/watch?v=OrigmVd3aYI)
  

## LM324 opamp amplifier board

 ![lm35-amplifier-board-full-assmbly](https://europe1.discourse-cdn.com/arduino/original/4X/1/a/a/1aa6861a2a997dfeacd66fd74f8a6182bf10429d.jpeg)

Link to the [LM324 opamp board Design and Specification](https://www.xanthium.in/lm35-temperature-sensor-analog-amplifier-board-arduino)

# Datalogger CSV File Format

Here datalogger uses a **CSV** or **Comma Separated Values** file format as shown below.

- **No,Date,Time,AN1,AN2,AN3,AN4**

Python code will create a text file on the hard disk using the current data and time with a file extension .csv.

For eg _ard\_18\_February\_2024\_21h\_29m\_43s\_daq\_log.csv_

CSV File on Windows 10 System

 ![python-csv-file-format](https://europe1.discourse-cdn.com/arduino/original/4X/8/7/4/874a087255664c4049923d4e1204690882df5383.jpeg)

CSV File on Linux (Ubuntu) System

 ![python-csv-file-output](https://europe1.discourse-cdn.com/arduino/original/4X/0/f/b/0fb8e66d0a8bd3af2694a1deef22c4459e3b6a8e.jpeg)

# Basic Setup

 ![arduino-python-pc-data-logger-system](https://europe1.discourse-cdn.com/arduino/original/4X/f/e/9/fe9526dde20d6c9f5a54718f595c57c2fbe6a98d.jpeg)

- The system consists of four LM35 temperature sensors connected to an LM324 amplifier board, which serves as the analog front-end for the Arduino.
- The analog signals from the amplifier board are converted to digital values by the Arduino's ADC and sent to a PC, Mac, or Linux computer using Arduino Serial Port .
- A **Python script** running on the computer monitors the serial port and receives the temperature data from the Arduino.
- The script writes the received temperature values to a CSV (comma-separated values) text file.
- To terminate the script, simply press the CTRL + C keyboard combination.

# Notes

- **Please note that LM324 opamp board is optional** , i have one lying around it so i used one.
- You can also use any other opamp to suit your needs Or you can **directly connect the Analog inputs** to Arduino Analog Pins.
- Here i am only using 4 Analog inputs, You can use all the available analog inputs of Arduino or just one depending upon your need.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [July 26, 2025, 11:03am UTC](https://forum.arduino.cc/t/diy-cross-platform-data-acquisition-system-using-python-and-arduino/1347440/19 "2025-07-26T11:03:22Z")

</div>

Closed on July 26, 2025, 11:03am UTC

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