Learn to build your own Data Acquisition System (.csv file) using Python and Arduino
Here we will build a low cost multi channel data logging system using Python and Arduino UNO board that will log and save data to a CSV (Comma Separated Values) file on the disk.
The system can monitor temperature data from 4 independent sources at the same time and log the data to the disk.
The system will use an Arduino and an analog front end based on LM324 opamp to measure temperature from 4 LM35 temperature sensors.
The analog values are digitized by the Arduino UNO’s (ATmega328P) 10 bit ADC and transmitted to a PC or MAC using Virtual Serial Port communication.
Please note that here we will be using
- Python Signal SIGINT to control the program flow of the data logging software
- and Pyserial based Python Serial Port Programming to connect with the data logger
Please check out the above tutorials ,if you are not familiar with those concepts.
Website code may be partial or pseudo code just enough to highlight relevant techniques or methods.
Please use the full source codes from our Github Repo to avoid errors
- Browse Data Acquisition System (.csv file) using Python & Arduino Code Repo
- Download Data Acquisition System (.csv file) using Python & Arduino Code as Zip
Block Diagram of Arduino Python Datalogger system
The system comprises of 4, LM35 temperature sensors connected to a LM324 amplifier board which acts as an analog front end for the Arduino board.
The Analog signal from the amplifier board are digitized by the ADC on the Arduino and send to a PC MAC or Linux computer.
A Python script running on the PC will monitor the serial port and receive the temperature values from the Arduino.
The script will write the received values to a CSV file
You can terminate the script by using the CTRL + C Keyboard combination
Hardware setup is shown above,
It consists of
- Four (4) LM35 temperature Probes
- 4 Channel LM35 signal opamp amplifier board
- Arduino UNO
- Laptop PC running Windows/Linux OS system
The weak signals from the LM35 temperature sensor probes are amplified by the opamp amplifier by a gain of 3.44 and is connected to the ADC inputs of the Arduino UNO.
Original Tutorial of Build your own Data Acquisition System (.csv file) using Python and Arduino can be found here