DHT11 and DHT22 temperature humidity sensor code
I'm a complete newcomer to the hardware/circuit/IoT stuff and for my first hardware project I was thinking about doing something with the Omega and a DHTXX.
I've seen some examples of the DHTXX with Arduino and Raspberry, but I'm a little clueless about how to do it with the Omega since the output voltages seem to be different (only 2.8 for the Omega).
Can you please share a picture or diagram of your setup?!
It works! :+1:
On pin 1 and +3.3V
Mine works too!! :+1:
I'm a C dummy, how can I use it on my onion. Is there something in Python available.
@Thomas-Krampe Here an example in python:
# -*- coding: utf-8 -*- import subprocess pinNumber = 8 sensorModel = 'DHT11' proc = subprocess.Popen(['./checkHumidity ' + str(pinNumber) + ' ' + sensorModel], stdout=subprocess.PIPE, shell=True) (out, err) = proc.communicate() sensor_data = out.split('\n') humidity = sensor_data temperature = sensor_data print "Humidity:" print str(humidity) + "%" print "Temperature:" print str(temperature) + "°C"
@Riccardo-Chiarini this is the script that actually uses the same application. i don't think he was looking for that kind of an example :)
I'm a real newbie and can't solve a problem. after the line checkHumidity/bin# ./checkHumidity 11 DHT11 it says: syntax error: unexpected "(" (expecting ")")
What does that mean? I'm really hopeless..
@József-Schuck You're using the Omega1 binaries. They don't work on the Omega 2.
@WereCatf Where the binaries for omega2 can be found? Thanks.
Good news. I migrated original code successfully to work on Omega2!
See https://github.com/h0l0gram/omega2-checkHumidity for binary and source.
Make sure your Omega2 has firmware >=0.1.10 b160 or it won't work.
root@Omega-1234:~# oupgrade -c > Device Firmware Version: 0.1.10 b160 > Checking latest version online... > Repo Firmware Version: 0.1.10 b160 > Comparing version numbers > Device firmware is up to date! root@Omega-1234:~#
root@Omega-1234:~/checkHumidity# ./checkHumidity 19 DHT22 48.299999 28.299999