Go Down

Topic: Using Python to retrieve data from an Arduino board (sample code for a DHT) (Read 1 time) previous topic - next topic

alina

Project description:

- On one side, an Arduino Uno board, with a DHT sensor to measure Humidity and Temperature
-- ref. https://learn.adafruit.com/dht/overview
-- attached the code (.ino) to run on the board side

- On the other side, a computer with a Python script running, to get then to draw the temperature and humidity data
-- Personally, I use the "Anaconda" Python redistribution (ref. http://www.continuum.io)
-- In addition I installed the "pyserial" package for communicating with the Arduino (ref. http://pyserial.sourceforge.net)
-- For drawing the data, I use the matplotlib package (ref. http://matplotlib.org/1.3.1/index.html)
-- See screenshot

Enjoy :)
AL.




robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

alina

Updated version: now the Python code send parameters to the Arduino program to modify the sampling rate parameter, and to start/stop the logging of data.

My next step: wrapping up the command communication in a utility class (Python and Arduino side). Same to receiving data among a period of time.

AL.

robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

alina


Go Up