Pages: [1]   Go Down
Author Topic: Using Python to retrieve data from an Arduino board (sample code for a DHT)  (Read 1202 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
AL.




* TempHumidityPython.py (3.43 KB - downloaded 15 times.)
* TempHumidityArduino.ino (0.95 KB - downloaded 11 times.)

* Capture d’écran 2014-06-03 à 23.23.52.png (149.63 KB, 1090x933 - viewed 49 times.)

* IMG_0867.jpg (1784.24 KB, 2448x3264 - viewed 22 times.)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13478
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks for sharing!
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

* TempHumidityPython2.py (4.25 KB - downloaded 15 times.)
* TempHumidityArduino2.ino (1.38 KB - downloaded 12 times.)
« Last Edit: June 05, 2014, 08:43:24 pm by alina » Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13478
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The .ino file attached is empty ...
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 1
Posts: 6
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry about that. I just re-updated the document. Thank you!
Logged

Pages: [1]   Go Up
Jump to: