A Simple Guide to Get the DS18B20 Running on Your Pi

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024

ความคิดเห็น • 46

  • @Gol-ha
    @Gol-ha ปีที่แล้ว +6

    Thanks, man!
    for the people who wonder how big the resistor must be, I used 2K, and worked well.

  • @robertlane6675
    @robertlane6675 2 ปีที่แล้ว +2

    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.

    • @jacobleetech
      @jacobleetech  2 ปีที่แล้ว +1

      That’s awesome! Sounds like a great use case.

  • @MrAgreeandDisagree
    @MrAgreeandDisagree 2 ปีที่แล้ว +4

    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

    • @jacobleetech
      @jacobleetech  2 ปีที่แล้ว

      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.

    • @gngdunn
      @gngdunn 2 ปีที่แล้ว +1

      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.

    • @jacobleetech
      @jacobleetech  2 ปีที่แล้ว

      @@gngdunn great info, thank you!

  • @LeetGoose
    @LeetGoose ปีที่แล้ว +1

    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

    • @jacobleetech
      @jacobleetech  ปีที่แล้ว

      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.

    • @LeetGoose
      @LeetGoose ปีที่แล้ว

      @@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
      @jacobleetech  ปีที่แล้ว

      10k might work but if you put 2 in parallel then that would be the equivalent resistance of 5k and that should definitely work

    • @LeetGoose
      @LeetGoose ปีที่แล้ว

      @@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?

  • @wimpiepieterse1228
    @wimpiepieterse1228 2 ปีที่แล้ว +1

    Awesome, thanks. This is exactly what I need to get started

  • @irrinfo2011
    @irrinfo2011 7 หลายเดือนก่อน

    May I know why we need the resister to the data cable please?

    • @jacobleetech
      @jacobleetech  7 หลายเดือนก่อน

      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.

  • @sald234
    @sald234 ปีที่แล้ว +1

    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

    • @jacobleetech
      @jacobleetech  ปีที่แล้ว

      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.

  • @nasondesign1636
    @nasondesign1636 2 ปีที่แล้ว

    Just got a Raspberry Pi and have absolutely no idea how to use it. Trying to Google around to just get something going!

  • @btxo24
    @btxo24 ปีที่แล้ว

    Can i use another gpio pin instead of gpio4 pin because i got another sensor connected to that specific pin

    • @jacobleetech
      @jacobleetech  ปีที่แล้ว +1

      I THINK you can use any pin, you just have to configure it in the code. Don't quote me on that though

  • @btxo24
    @btxo24 ปีที่แล้ว

    Is it normal that the raspberry pi screen turns off when I plugged in the voltage pin to 3.3v pin?

    • @jacobleetech
      @jacobleetech  ปีที่แล้ว +1

      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.

  • @castromikelesterg.6611
    @castromikelesterg.6611 3 ปีที่แล้ว +1

    is the measure in degree celcius or fahrenheit ??

    • @jacobleetech
      @jacobleetech  3 ปีที่แล้ว +1

      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.

    • @castromikelesterg.6611
      @castromikelesterg.6611 3 ปีที่แล้ว

      @@jacobleetech Thanks mateee

  • @simonr921
    @simonr921 3 ปีที่แล้ว

    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 :)

    • @jacobleetech
      @jacobleetech  3 ปีที่แล้ว +1

      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.

  • @mbshaw1
    @mbshaw1 9 หลายเดือนก่อน

    How do I get this to show in a label ?

    • @jacobleetech
      @jacobleetech  9 หลายเดือนก่อน

      I'm not sure what you mean?

    • @mbshaw1
      @mbshaw1 9 หลายเดือนก่อน

      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

    • @mbshaw1
      @mbshaw1 8 หลายเดือนก่อน

      @@jacobleetech simply, I don't understand python enough to code for output from a ds18b20 to be displayed in a widget and updated.

  • @jefffogarty6470
    @jefffogarty6470 2 ปีที่แล้ว

    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?

    • @jacobleetech
      @jacobleetech  2 ปีที่แล้ว +1

      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.

  • @maherkhaznaji
    @maherkhaznaji ปีที่แล้ว

    When you plug the sensor, is it normal that it emits a red light please?

    • @jacobleetech
      @jacobleetech  ปีที่แล้ว

      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?

    • @maherkhaznaji
      @maherkhaznaji ปีที่แล้ว

      @@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

    • @jacobleetech
      @jacobleetech  ปีที่แล้ว

      @@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.

  • @diegoestrada7484
    @diegoestrada7484 3 ปีที่แล้ว

    I installed Android on mi Raspberry Pi 3, is there a way to read the value of the DS18B20 sensor form an Android App?

    • @jacobleetech
      @jacobleetech  3 ปีที่แล้ว +1

      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.

  • @DNA2000-8bit
    @DNA2000-8bit ปีที่แล้ว

    Don't even need the resistor with the updated OneWire library, at least for Arduino. Unsure about Raspi.

  • @rieksie7401
    @rieksie7401 3 ปีที่แล้ว

    I get an error message "could not find any sensor"
    The sensor in on the circuit but gets extremely hot. Is that alright?

    • @jacobleetech
      @jacobleetech  3 ปีที่แล้ว +1

      Definitely shouldn't get hot. How are you wiring it up?

  • @raquelortizgarcia8168
    @raquelortizgarcia8168 3 ปีที่แล้ว

    😇 thank you

  • @bowl0stu
    @bowl0stu 3 ปีที่แล้ว

    neat