I am involved in a project and wanted to do exactly what you have shown to check multiple temperatures in several locations and have it displayed on my monitor. Thank you your awesome! I will definitely be doing this! 😉👍
Excellent tutorial. It's exactly what I've been wanting to do. Watching this gave me the confidence to jump into RPI and build my own Whole House T/H Monitor. It's been running two sensors (more to come) for a couple of days and has revealed hard data about why I hate my HVAC system and what I might do about it. E.g., we set the thermostat down at night during winter. It's scheduled to come back up at 6:30am. But the sensors show that it's been resetting between 2am and 3am. Say what!
what is the best way to learn everything about making rasberry pi autonomous systems? I need to learn python right? could I use that to design a software? where can I learn how to make custom PCBs specifically in the realm of pi?
This is really really awesome just what I've been looking for but..... instead of writing to a service can it write to a database where the information can be written to a module for MagicMirror? That would be VERY useful :)
Yeah, absolutely possible - it's what I'm currently doing. I track temp, pressure, humidity and light levels across multiple sensors. All pi's sample every 30 mins and cache locally before a sync routine pushes all entries to a central DB. I'm in the process of adding a rain sensor to one of them. I used Grafana for the data visualisation and dashboard.
@@Initialstate could you do a tutorial on how to use a Jetson Nano to run a tensorflow ML to both analize their bowel movements and optimize bidet targeting? *pew, pew pew*
This is a really great idea! im looking at doing this to monitor a couple freezers so I know if they get too warm when I go on vacation, are there sensors available that would work in such environment? I don't believe the ones shown in this video are rated for condensating environments, also, is it possible to hook 2 sensors to 1 PI to save on cost and if so what modifications to the code would be required to do that?
All of you must be better than I am. I had NO luck getting this going. I tried multiple Pi Zeros and multiple sensors. I started with this error " temp_f = format(temp_c * 9.0 / 5.0 + 32.0, ".2f")" TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'" and continued on getting other errors. Finally after reading on the Adafruit website that there are KNOWN ISSUES with the DHT22 and the Pi Zero I gave up. Tried it on a Pi 4 and could get it to run ONE time but if I stopped it and started it again it would give me the "Unable to set line 4 to input error". I'm glad you guys seem to have gotten it working but for me, this was a total failure. Nothing like $50 down the tubes.
I want to do something similar... But not looking for 1 single pi to do 1 sensor... also the idea of using a external service is not enticing. no external service needs my data.
You're the best!!! Thank you very much for the video, I was looking for something like this a long time ago and this is better than what I was looking for !!!
Is there a free web based dashboard that you know of? My hesitation to try this project only lies in the fact it requires a monthly subscription at this time. Tough to swing at $60/yr × however many deployments this tech ends up being incorporated in.
What can we do for the RP to translatevthis data to SNMP ? I mean, What if we would like to connect the temp sensor to a system like Nagios to collect the temp reader data ?
@@Initialstate Here is what I'm thinking: 2 3V chargers providing input to the RPi. One is plugged into a regular plug and one is plugged into a plug that is also powered by a back-up generator. Under normal conditions, both will provide a signal which the PRi which will be tracked. In the event of a power failure, plug 1 will not provide a signal - this would prompt a notification which would include the status of plug 2. Basically "your power is out but the generator is working" or "your power is out and there is a problem with the generator".
I need help please. I Installed Adafruit_DHT to my pi but when I run the tempsensor.py code I get an error saying "no module named Adafruit_DHT" How can I fix this?
Isn't there a way to connect multiple sensors to one raspberry? It seems that you don't really need invest 30 bucks for each sensor. But only 6 bucks for the sensor and wiring.
@@Initialstate even when I would like to use two sensors, it would save me abou 20 bucks, which is like third of expenses. Some sensors can be put together on one gpio, and others could possibly be used on multiple hpios on rpi (there are like 17 possible inputs, right). This would be useful whe you have possibility to use wires.
@@alesjaterka2155 I'm interested in having multiple sensors connected to the one raspberry for logistical reasons. I'm completely new to all of this, can you please point me in the right direction of some detailed information? Would it be a matter of using some sort of basic expansion IO board with multiple sensors attached which is then connected to the raspberry? thanks
@@paulw2278 Hi, to be honest, I havent tried it by myself, becaues I need to buy all the stuff first. But there are several ways how to do it, depending on a sensors you are going to use. For sensors of type DHTxx (DHT11 or DHT22, i didnt look for any others of this kind) it is bit complicated coz you can not use multiple of them on one PIN, so you have to utilize more pins on RPI (there are several you can use). or you can use I2C chip to connect sensors through this chip (it is going to be harder to write program to do this). For sensors DS18B20 (or this kind of sensors, again, i didnt look for any other yet) it is easier to do, becaus you can connect multiple of them to one pin, and read values from them, becaus they have easier comunication as a device. (The device is accesible at it given folder/file in the system as other devices in linux/unix are.) You have to choose what proggraming language you are going to use (most manuals are with python, but you can use C# 8.0 as well). There are plenty of libraries for those sensors, as well as for I2C chips. So you just have to take a look around and select what is best suited for you. You have to choose type of Pi you want to use, there may be diferences beetween them, and their GPIO pins. You have to be carefull about length of cables you are going to use. And abou total length of cables you connect to RPi, because it is limited. At last some links: wiringpi.com/ - there is all about wiring, libraries, examples and pin description raspberryautomation.com/connect-multiple-ds18b20-temperature-sensors-to-a-raspberry-pi/ - Multiple DS18B20 connection and programing. raspberrypi.stackexchange.com/questions/33735/how-many-dht22s-can-be-connected-to-a-rpi - A bit about multiple DHT22 on one RPi. forum.arduino.cc/index.php?topic=516731.0 - a bit about cable length with multiple sensors www.maximintegrated.com/en/design/technical-documents/tutorials/1/148.html - a lot abou cable lengths and devices which can be connected in one "network" - this is by my opinion the most important part to read, so you are not surprised why it doesnt work, when it should. www.edn.com/read-10-or-more-switches-using-only-two-i-o-pins-of-a-microcontroller/ - some info about switches (i dont know if its relevant to this topic, but it was one of my steps on the way to knowledge :-D) This is what i found with my research on internet, I havent tried it by myself, so it might be a bit (or a lot) off the reality. What i was able to find is you are going to need Sensors DS18B20, DHT11, DHT22, RPi Zero WH (you can use any other, but zero is the cheapest one and it will do as well as others, but you have to have "WH" wersion, which has wi-fi and "pins" attached.), for this RPi you will need SD card with OS (it is called NOOBS), some breadboard, cables, diodes to indicate it works etc. (it is sold in packages, so you can use those to test if it works). I have read that people are using network cable CAT5, which works good for data transfer on DS15B20. For the expander of pins, I have found some sites where it was explained nicely, but those already dont work, so you have to take a look by yourself on some I2C expanders, there are plenty types, so choose one which hase libraries for your programming language. If needed I coul point out some shops where to buy stuff i mentioned, but mostly you can find it on RPi official sites, or on some hobby/electric sites. I have found many more stuff, but it mostly was not exactly what I needed, however it pushed me a bit further to stuff above. I would love to get a feedback if it was usefull for You. And if You found any other usefull info.
Actually, this is a good question. I spoke too soon. Looking further into this, it seems like you should probably use the 3.3V rail for power, which would, in turn, deliver 3.3v outputs back to the Pi. It looks like the spec sheets say you can use either 3.3V or 5V for power on the DHT22.
@@Initialstate I'm wondering what type of wire to buy so that I can place the sensor up to 50 feet away from the Pi. The short jumper wires you show in the video will not get my sensors into multiple rooms like you mention. Is there a specific name that I can search for to find long compatible wires? Thanks!
I purchased a 8" screen with superb quality and clarity and just got don't hooking it up about an hour ago. I highly recommend this one but you will need something to mount it in. US $60.00 | 8.8 inch Long Strip HSD088 HDMI TO MIPI 1920*480 Second Monitor Case Aida64 Display CPU GPU Information Sub Display a.aliexpress.com/_msTSfmT
Nice project and Intitial State is cool! Im getting this error intermittently. Any ideas? Traceback (most recent call last): File "tempsensor.py", line 19, in humidity = dhtSensor.humidity File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 263, in humidity self.measure() File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 209, in measure raise RuntimeError("A full buffer was not returned. Try again.") RuntimeError: A full buffer was not returned. Try again.
@@Initialstate I reached out, but they never got back to me...Also, Im looking to make a noise/decibel monitor but dont know what Im doing. I have an i2s microphone and have it running on a pi zero w, but dont know how to get your data streamer connected ???
That type of error usually happens when the value coming from the sensor read is bad. After the line "humidity, temp_c = Adafruit_DHT.read_retry(Adafruit_DHT.DHT22, 4)", add a "print temp_c" statement to see what is being read by the sensor.
Think this approach might be rather overkill and overpriced Raspberry Pi Zero W - $14 Raspberry Pi Charger - $8 Micro SD card - $4 DHT22 sensor - $5 /Case (optional) - $6/ ESP8266 or ESP32-C3 board - $4 Charger, A simple dollar store USB charger (or whatever you already have in a drawer) - $1 No micro SD card needed unless you want to keep big logs DHT22 Sensor - $5 /Case (optional) - just stick it in a matchbox or something/ That's one third the cost and programming might be a bit harder but it's cheaper and more power efficient. I like the idea, but I'd save my precious Pis for something that needs more power.
"Before we dive in, please like this video…“ Um no. Immediate down-vote how that. You're supposed to earn an up-vote by providing good content, and that alone.
I am involved in a project and wanted to do exactly what you have shown to check multiple temperatures in several locations and have it displayed on my monitor. Thank you your awesome! I will definitely be doing this! 😉👍
Excellent tutorial. It's exactly what I've been wanting to do. Watching this gave me the confidence to jump into RPI and build my own Whole House T/H Monitor. It's been running two sensors (more to come) for a couple of days and has revealed hard data about why I hate my HVAC system and what I might do about it. E.g., we set the thermostat down at night during winter. It's scheduled to come back up at 6:30am. But the sensors show that it's been resetting between 2am and 3am. Say what!
Subbed! Exactly what i was lookin for.
Whats the max sensors you can use per pi?
This is an awesome tutorial! Do you think I could add more sensors to this at some point, say PM2.5? Thanks!
what is the best way to learn everything about making rasberry pi autonomous systems? I need to learn python right? could I use that to design a software? where can I learn how to make custom PCBs specifically in the realm of pi?
Nice Elizabeth 👍☺️
I am curious as to why you chose pi over Arduino. No opinion just wondering
Thanks for putting this together! Love the Sounds shirt, being a Nashvillian myself :).
This is really really awesome just what I've been looking for but..... instead of writing to a service can it write to a database where the information can be written to a module for MagicMirror? That would be VERY useful :)
This was asked 5 months ago and still no reply. Does anyone have an answer on this?
Yeah, absolutely possible - it's what I'm currently doing. I track temp, pressure, humidity and light levels across multiple sensors. All pi's sample every 30 mins and cache locally before a sync routine pushes all entries to a central DB. I'm in the process of adding a rain sensor to one of them. I used Grafana for the data visualisation and dashboard.
Thank you for the video. Would be better if the screengrab of The code was grabbing a smaller portion of your screen so I can read the text
I want to do a restroom door sensor to let employees know what restrooms are available... and can collect data on high traffic times ;)
@@Initialstate could you do a tutorial on how to use a Jetson Nano to run a tensorflow ML to both analize their bowel movements and optimize bidet targeting? *pew, pew pew*
This is a really great idea! im looking at doing this to monitor a couple freezers so I know if they get too warm when I go on vacation, are there sensors available that would work in such environment? I don't believe the ones shown in this video are rated for condensating environments, also, is it possible to hook 2 sensors to 1 PI to save on cost and if so what modifications to the code would be required to do that?
Hey, I looking for the same thing, did you got something?
All of you must be better than I am. I had NO luck getting this going. I tried multiple Pi Zeros and multiple sensors. I started with this error "
temp_f = format(temp_c * 9.0 / 5.0 + 32.0, ".2f")"
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'" and continued on getting other errors. Finally after reading on the Adafruit website that there are KNOWN ISSUES with the DHT22 and the Pi Zero I gave up. Tried it on a Pi 4 and could get it to run ONE time but if I stopped it and started it again it would give me the "Unable to set line 4 to input error". I'm glad you guys seem to have gotten it working but for me, this was a total failure. Nothing like $50 down the tubes.
I want to do something similar... But not looking for 1 single pi to do 1 sensor... also the idea of using a external service is not enticing. no external service needs my data.
You're the best!!! Thank you very much for the video, I was looking for something like this a long time ago and this is better than what I was looking for !!!
Is there a free web based dashboard that you know of? My hesitation to try this project only lies in the fact it requires a monthly subscription at this time. Tough to swing at $60/yr × however many deployments this tech ends up being incorporated in.
You could try looking at Grafana...
Thanks for the information
What can we do for the RP to translatevthis data to SNMP ? I mean, What if we would like to connect the temp sensor to a system like Nagios to collect the temp reader data ?
did you find an answer for this? I'm trying to implement a temp sensor for PRTG with SNMP
where can i buy that module?
Thank you. Would love to see something similar for power outage using a sensor
@@Initialstate Here is what I'm thinking: 2 3V chargers providing input to the RPi. One is plugged into a regular plug and one is plugged into a plug that is also powered by a back-up generator. Under normal conditions, both will provide a signal which the PRi which will be tracked. In the event of a power failure, plug 1 will not provide a signal - this would prompt a notification which would include the status of plug 2. Basically "your power is out but the generator is working" or "your power is out and there is a problem with the generator".
I need help please. I Installed Adafruit_DHT to my pi but when I run the tempsensor.py code I get an error saying "no module named Adafruit_DHT" How can I fix this?
Nice !!! Thank you & love you!
Isn't there a way to connect multiple sensors to one raspberry? It seems that you don't really need invest 30 bucks for each sensor. But only 6 bucks for the sensor and wiring.
@@Initialstate even when I would like to use two sensors, it would save me abou 20 bucks, which is like third of expenses.
Some sensors can be put together on one gpio, and others could possibly be used on multiple hpios on rpi (there are like 17 possible inputs, right).
This would be useful whe you have possibility to use wires.
@@alesjaterka2155 I'm interested in having multiple sensors connected to the one raspberry for logistical reasons. I'm completely new to all of this, can you please point me in the right direction of some detailed information? Would it be a matter of using some sort of basic expansion IO board with multiple sensors attached which is then connected to the raspberry? thanks
@@paulw2278 Hi, to be honest, I havent tried it by myself, becaues I need to buy all the stuff first. But there are several ways how to do it, depending on a sensors you are going to use.
For sensors of type DHTxx (DHT11 or DHT22, i didnt look for any others of this kind) it is bit complicated coz you can not use multiple of them on one PIN, so you have to utilize more pins on RPI (there are several you can use). or you can use I2C chip to connect sensors through this chip (it is going to be harder to write program to do this).
For sensors DS18B20 (or this kind of sensors, again, i didnt look for any other yet) it is easier to do, becaus you can connect multiple of them to one pin, and read values from them, becaus they have easier comunication as a device. (The device is accesible at it given folder/file in the system as other devices in linux/unix are.)
You have to choose what proggraming language you are going to use (most manuals are with python, but you can use C# 8.0 as well). There are plenty of libraries for those sensors, as well as for I2C chips. So you just have to take a look around and select what is best suited for you.
You have to choose type of Pi you want to use, there may be diferences beetween them, and their GPIO pins.
You have to be carefull about length of cables you are going to use. And abou total length of cables you connect to RPi, because it is limited.
At last some links:
wiringpi.com/ - there is all about wiring, libraries, examples and pin description
raspberryautomation.com/connect-multiple-ds18b20-temperature-sensors-to-a-raspberry-pi/ - Multiple DS18B20 connection and programing.
raspberrypi.stackexchange.com/questions/33735/how-many-dht22s-can-be-connected-to-a-rpi - A bit about multiple DHT22 on one RPi.
forum.arduino.cc/index.php?topic=516731.0 - a bit about cable length with multiple sensors
www.maximintegrated.com/en/design/technical-documents/tutorials/1/148.html - a lot abou cable lengths and devices which can be connected in one "network" - this is by my opinion the most important part to read, so you are not surprised why it doesnt work, when it should.
www.edn.com/read-10-or-more-switches-using-only-two-i-o-pins-of-a-microcontroller/ - some info about switches (i dont know if its relevant to this topic, but it was one of my steps on the way to knowledge :-D)
This is what i found with my research on internet, I havent tried it by myself, so it might be a bit (or a lot) off the reality.
What i was able to find is you are going to need Sensors DS18B20, DHT11, DHT22, RPi Zero WH (you can use any other, but zero is the cheapest one and it will do as well as others, but you have to have "WH" wersion, which has wi-fi and "pins" attached.), for this RPi you will need SD card with OS (it is called NOOBS), some breadboard, cables, diodes to indicate it works etc. (it is sold in packages, so you can use those to test if it works). I have read that people are using network cable CAT5, which works good for data transfer on DS15B20. For the expander of pins, I have found some sites where it was explained nicely, but those already dont work, so you have to take a look by yourself on some I2C expanders, there are plenty types, so choose one which hase libraries for your programming language.
If needed I coul point out some shops where to buy stuff i mentioned, but mostly you can find it on RPi official sites, or on some hobby/electric sites.
I have found many more stuff, but it mostly was not exactly what I needed, however it pushed me a bit further to stuff above. I would love to get a feedback if it was usefull for You. And if You found any other usefull info.
@@alesjaterka2155 Many many many thanks. This reply is simply outstanding! I will definitely report back in the future after some experimentation.
Doesn't the DHT22 use 5v signaling, requiring a resistor to the Pi's 3.3v GPIO?
Pi has a 5V rail (pins 2 and 4).
@@JamieBailey Yes, I know. I'm talking about the data pin the communication is done on. The SHT22 outputs 5v, the gpio on the Pi is 3v3.
@@NETBotic Ahh I understand your question now. You can get DHT22 sensors that have the pull-ups already on them in a nice, tight package.
Actually, this is a good question. I spoke too soon. Looking further into this, it seems like you should probably use the 3.3V rail for power, which would, in turn, deliver 3.3v outputs back to the Pi. It looks like the spec sheets say you can use either 3.3V or 5V for power on the DHT22.
@@JamieBailey Even better, thanks!
I did not understand but great video thumbs up
Can you specify the wire needed if I want to place the sensor far from the Pi, say 50 feet?
@@Initialstate I'm wondering what type of wire to buy so that I can place the sensor up to 50 feet away from the Pi. The short jumper wires you show in the video will not get my sensors into multiple rooms like you mention. Is there a specific name that I can search for to find long compatible wires? Thanks!
Thanks for the tutorial. I would like to attach 7" screen to the raspberry pi 4 and display output from the sensors to the monitor. Is it possible?
I purchased a 8" screen with superb quality and clarity and just got don't hooking it up about an hour ago. I highly recommend this one but you will need something to mount it in.
US $60.00 | 8.8 inch Long Strip HSD088 HDMI TO MIPI 1920*480 Second Monitor Case Aida64 Display CPU GPU Information Sub Display
a.aliexpress.com/_msTSfmT
@@Randy2747 Thanks Randy
@@Initialstate Is it possible to get the sensor data output offline after logged in? Gonna use it for my scooter
Crazy how when this was made, pi zeros were only $15. Now they're $60-$80
Thanks for video
What is the maximum number Raspberry Pi's could I put on the initial state
@@Initialstate thank you so much for telling me
Nice project and Intitial State is cool! Im getting this error intermittently. Any ideas?
Traceback (most recent call last):
File "tempsensor.py", line 19, in
humidity = dhtSensor.humidity
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 263, in humidity
self.measure()
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_dht.py", line 209, in measure
raise RuntimeError("A full buffer was not returned. Try again.")
RuntimeError: A full buffer was not returned. Try again.
@@Initialstate I reached out, but they never got back to me...Also, Im looking to make a noise/decibel monitor but dont know what Im doing. I have an i2s microphone and have it running on a pi zero w, but dont know how to get your data streamer connected ???
@@Initialstate Doh! It was in my drafts folder. Thank you!
@@Initialstate The new code is working way better. Im going to let it run for a while to make sure, but its much better so far! Thanks for the help.
error: Traceback (most recent call last):
File "tempsensor.py", line 20, in
temp_f = format(temp_c*9.0 / 5.0 + 32.0, ".2f")
TypeError: unsupported operand type(s) for *: 'NoneType' and 'float'
That type of error usually happens when the value coming from the sensor read is bad. After the line "humidity, temp_c = Adafruit_DHT.read_retry(Adafruit_DHT.DHT22, 4)", add a "print temp_c" statement to see what is being read by the sensor.
@@JamieBailey thank you
Think this approach might be rather overkill and overpriced
Raspberry Pi Zero W - $14
Raspberry Pi Charger - $8
Micro SD card - $4
DHT22 sensor - $5
/Case (optional) - $6/
ESP8266 or ESP32-C3 board - $4
Charger, A simple dollar store USB charger (or whatever you already have in a drawer) - $1
No micro SD card needed unless you want to keep big logs
DHT22 Sensor - $5
/Case (optional) - just stick it in a matchbox or something/
That's one third the cost and programming might be a bit harder but it's cheaper and more power efficient. I like the idea, but I'd save my precious Pis for something that needs more power.
Where's the tutorial text pls ?
need a free version...
Darn! That echo makes it unwatchable.
Damn paid for services. No thanks
"Before we dive in, please like this video…“
Um no. Immediate down-vote how that. You're supposed to earn an up-vote by providing good content, and that alone.
The guy who never really tried contributing content himself.