My local food pantry wanted to get temperature monitoring for a bank of chest freezers. The problem that I ran into is they often shut one freezer down when they can to save energy. Commercial solutions didn't offer an easy way to shut alarming on and off and I wanted something wired. I experimented with putting a switch inline with each sensor on the power lead. When attempting to read the sensor with the switch off I got 185. I wrote a script to check the sensors hourly and if they were above 15 degrees and not equal to 185 it would alert. I also log the temperatures a few times a day. Their internet is nat'd so I have a reverse ssh tunnel back to my house that I monitor to make sure everything is still alive at the pantry. I just instructed everyone to make sure the switch is on if the freezer is on and off if it is off. So far it is working great.
Hello, thank you for making this! Very straight forward tutorial. Please could you explain what the purpose of the "pull up resistor" does? What would happen without it? I'm new to electronics, thank you
For many applications it is to make sure the default state of a pin is "HIGH." For others it depends on how the sensor communicates with the microcontroller. In the case of the sensor in this video, the only reason I know a pull up resistor is needed is because the datasheet says it's needed. I would assume it's for boosting the signal or making sure the data is read properly by the raspberry pi, but that's getting into areas I'm not super familiar with, to be totally honest.
the pull up resister is part of what allows all of the devices to share the same data line. formally this is a open collector circuit that implements a 'wired and' logic element. search for those terms to get a full explanation.
I only did that to attached the pull up resistor directly to the wires, if you put in on a breadboard or have a version of the sensor like on a breakout board then you dont need to solder at all.
@@jacobleetech Thanks, I do have a breadboard. If you don't mind can you also clarify if the resistors I have would work? The ones I have say "1kΩ" and "10kΩ" would I use the 10Ω one?
@@jacobleetech Im not entirely sure what the means to be honest. I can see in your video that you put one in the top row and the other end in the bottom right corner of the top left section. Where would I put the second one?
Yo dude - I found this video for a similar project and have been pulling my hair out trying to get the sensor to work, do you NEED to use the breadboard? The tut I'm following doesn't mention it so I assumed I could connect sensor directly to PI
You don't need a breadboard but you do need to have a pull-up resistor on the data line to the power line. If I don't want to use a breadboard I've just soldered the resistor between them. The breadboard is strictly for convenience.
I don't think so. That depends on the screen too though so I wouldn't really be able to help you much with that. The only thing I would recommend checking is to make sure your sensor isn't shorting out your power.
By default it measures in C but you can change the "get_temperature" line to "get.temperature(Unit.DEGREES_F)", but you also need to add "Unit" to the import line to look like "from w1thermsensor import W1ThermSensor, Unit" pypi.org/project/w1thermsensor/ This page will have more documentation.
Thanks a lot. I would like to configure 4 temp sensors and they should display the temperatures on my phone over the internet. It should also log so that I can see a graph over time. Any ideas on how to do this easiily ? Thanks :)
Well I want to display the output from some sensors including a couple of DS18B20's in a GUI on a 800x480 display and getting one to display would help me off to a good start.@@jacobleetech
1-Wire Sensors have an ID about 15-20 characters long or so (at least these temperature sensors do). If you use multiple devices, then you will need to use the part of the library that allows you to create multiple instances of the sensor using their respective IDs.
@@jacobleetech the sensor l have has a little board attached to do it. And the red light is on this little board when l plug the sensor to pin 7 or 8 (ceo), I am using raspberry pi 4
@@maherkhaznaji I see, then the light turning on is probably normal. Look to see if the board already has a resistor on it. If it does, then you probably don't need to add one of your own since it already has one.
Unfortunately I don't have any experience with android on the raspberry pi. I would guess if you have a python editor you do something similar, but I can't say for sure.
Thanks, man!
for the people who wonder how big the resistor must be, I used 2K, and worked well.
My local food pantry wanted to get temperature monitoring for a bank of chest freezers. The problem that I ran into is they often shut one freezer down when they can to save energy. Commercial solutions didn't offer an easy way to shut alarming on and off and I wanted something wired. I experimented with putting a switch inline with each sensor on the power lead. When attempting to read the sensor with the switch off I got 185. I wrote a script to check the sensors hourly and if they were above 15 degrees and not equal to 185 it would alert. I also log the temperatures a few times a day. Their internet is nat'd so I have a reverse ssh tunnel back to my house that I monitor to make sure everything is still alive at the pantry. I just instructed everyone to make sure the switch is on if the freezer is on and off if it is off. So far it is working great.
That’s awesome! Sounds like a great use case.
Hello, thank you for making this! Very straight forward tutorial. Please could you explain what the purpose of the "pull up resistor" does? What would happen without it? I'm new to electronics, thank you
For many applications it is to make sure the default state of a pin is "HIGH." For others it depends on how the sensor communicates with the microcontroller. In the case of the sensor in this video, the only reason I know a pull up resistor is needed is because the datasheet says it's needed. I would assume it's for boosting the signal or making sure the data is read properly by the raspberry pi, but that's getting into areas I'm not super familiar with, to be totally honest.
the pull up resister is part of what allows all of the devices to share the same data line. formally this is a open collector circuit that implements a 'wired and' logic element. search for those terms to get a full explanation.
@@gngdunn great info, thank you!
Thanks for the video! I'm completely new to this, you mentioned soldering wires? Is that necessary? I was a bit confused about that part
I only did that to attached the pull up resistor directly to the wires, if you put in on a breadboard or have a version of the sensor like on a breakout board then you dont need to solder at all.
@@jacobleetech Thanks, I do have a breadboard. If you don't mind can you also clarify if the resistors I have would work? The ones I have say "1kΩ" and "10kΩ" would I use the 10Ω one?
10k might work but if you put 2 in parallel then that would be the equivalent resistance of 5k and that should definitely work
@@jacobleetech Im not entirely sure what the means to be honest. I can see in your video that you put one in the top row and the other end in the bottom right corner of the top left section. Where would I put the second one?
Awesome, thanks. This is exactly what I need to get started
Glad I could help!
May I know why we need the resister to the data cable please?
I'm not sure, the datasheet says to use one so it's just something about the design of the sensor that requires the pullup.
Yo dude - I found this video for a similar project and have been pulling my hair out trying to get the sensor to work, do you NEED to use the breadboard? The tut I'm following doesn't mention it so I assumed I could connect sensor directly to PI
You don't need a breadboard but you do need to have a pull-up resistor on the data line to the power line. If I don't want to use a breadboard I've just soldered the resistor between them. The breadboard is strictly for convenience.
Just got a Raspberry Pi and have absolutely no idea how to use it. Trying to Google around to just get something going!
Can i use another gpio pin instead of gpio4 pin because i got another sensor connected to that specific pin
I THINK you can use any pin, you just have to configure it in the code. Don't quote me on that though
Is it normal that the raspberry pi screen turns off when I plugged in the voltage pin to 3.3v pin?
I don't think so. That depends on the screen too though so I wouldn't really be able to help you much with that. The only thing I would recommend checking is to make sure your sensor isn't shorting out your power.
is the measure in degree celcius or fahrenheit ??
By default it measures in C but you can change the "get_temperature" line to "get.temperature(Unit.DEGREES_F)", but you also need to add "Unit" to the import line to look like "from w1thermsensor import W1ThermSensor, Unit"
pypi.org/project/w1thermsensor/
This page will have more documentation.
@@jacobleetech Thanks mateee
Thanks a lot.
I would like to configure 4 temp sensors and they should display the temperatures on my phone over the internet. It should also log so that I can see a graph over time.
Any ideas on how to do this easiily ?
Thanks :)
Adafruit IO is a great tool to do that. I had a project I made a video about that I used Adafruit IO to display data for 9 enclosures.
How do I get this to show in a label ?
I'm not sure what you mean?
Well I want to display the output from some sensors including a couple of DS18B20's in a GUI on a 800x480 display and getting one to display would help me off to a good start.@@jacobleetech
@@jacobleetech simply, I don't understand python enough to code for output from a ds18b20 to be displayed in a widget and updated.
At the beginning of the video, you mention a feature of the one wire protocol is that it is addressable. Is the DS18B20 addressable in this way?
1-Wire Sensors have an ID about 15-20 characters long or so (at least these temperature sensors do). If you use multiple devices, then you will need to use the part of the library that allows you to create multiple instances of the sensor using their respective IDs.
When you plug the sensor, is it normal that it emits a red light please?
The sensor doesn't have a light on it unless you have a breakout board that has one. Are you talking about the raspberry pi?
@@jacobleetech the sensor l have has a little board attached to do it. And the red light is on this little board when l plug the sensor to pin 7 or 8 (ceo), I am using raspberry pi 4
@@maherkhaznaji I see, then the light turning on is probably normal. Look to see if the board already has a resistor on it. If it does, then you probably don't need to add one of your own since it already has one.
I installed Android on mi Raspberry Pi 3, is there a way to read the value of the DS18B20 sensor form an Android App?
Unfortunately I don't have any experience with android on the raspberry pi. I would guess if you have a python editor you do something similar, but I can't say for sure.
Don't even need the resistor with the updated OneWire library, at least for Arduino. Unsure about Raspi.
I get an error message "could not find any sensor"
The sensor in on the circuit but gets extremely hot. Is that alright?
Definitely shouldn't get hot. How are you wiring it up?
😇 thank you
For sure! =D
neat