These projects introduce some concepts and technologies to build robust and reliable monitoring software of serial port devices in the easy way.
- Board: Arduino UNO
- Sensor: DHT11
Connect DHT11 pin 1(VCC,left,power) -> Arduino +5V
Connect DHT11 pin 2(DATA,signal) -> your DHTPIN in Arduino UNO,for example pin 3
Connect DHT11 pin 4(GND,right) -> Arduino GROUND
Connect DHT11 pin 2(DATA,signal) -> a 10K resistor -> DHT11 pin 1 (VCC)
- Open ArduinoDHTSensor.ino, build and upload to Arduino
-
Python3.5
-
PyQt4, PySerial, PythonQwt, Tornado
-
Goto Unofficial Windows Binaries for Python Extension Packages page
-
Download the suitable release (distributed as a “wheel” archive) series that matches your Windows and Python versione. In the filename, the digits after “cp” indicate the Python version, e.g.
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyqt4
PyQt4-4.11.4-cp35-cp35m-win_amd64.whl
is the installer of PyQt4-4.11.4 for 64-bit Python 3.5 and windows.
- From an administrative command prompt, install the downloaded wheel using pip.
>pip install PyQt4-4.11.4-cp35-cp35m-win_amd64.whl
-
A threaded GUI Monitor with Python and PyQt4 plots live data using PythonQwt
-
Packages:Python3.5,PyQt4, PySerial, PythonQwt, Thread
-
Launching the app
>python DHT_monitor_app.py
- The GUI application is modified from: mba7 https://github.com/mba7/SerialPort-RealTime-Data-Plotter,
-
A web monitor with Tornado web server enables real-time plotting of DHT11 signals in the browser(support websocket)
-
Key Points: tornado server + websocket + flotr2
-
Enjoying live data on COM4
-
if your board serial port is not COM4, you may change:
def openSerial(): port = 'COM4' # you shoule change to your board serial port
-
1) Launching the web server
>python app.py
2) Open a web browser and go to :
http://localhost:8000
You should see the graph and be able to select the curves to display.
-
Arduino
-
Arduino: http://www.arduino.cc/
-
Wiring: http://wiring.org.co/
-
Arduino and Python: http://playground.arduino.cc/Interfacing/Python
-
-
Python
-
PythonQwt: https://github.com/PierreRaybaut/PythonQwt
-
Tornado Web Server: http://www.tornadoweb.org/en/stable/
-
Noah Gift. Practical threaded programming with Python. http://www.ibm.com/developerworks/aix/library/au-threadingpython/index.html
MIT