Quick Byte for DS18B20 TO-92
McGyver
Posts: 36
in Propeller 2
When selecting the Quick Bytes link at, https://www.parallax.com/product/ds18b20-to-92-digital-thermometer-temperature-ic-sensor/
I can not locate the example code for it. What term may I be missing? My search here did not pull up any discussions. I do have the datasheet, so I am starting there, maybe I can flesh it out alone.
Comments
That sensor was also included in the P2 Holiday Kit.
https://www.parallax.com/product/p2-live-forum-holiday-spin2-kit/
Check the downloads tab under the product - should be some code lurking there.
I've got Spin code for the P1. Perhaps you could translate it to the P2?
-Phil
I've updated and attached archives for the DS18b20 demos that I wrote and presented last year.
Thank you all very much!
Hey @JonnyMac
I'm not seeing those demos at the QuickBytes page, but they would be a neat addition.
If you're OK with that, could you please confirm the connections needed between P2 and the 1-wire sensor ? (or point me to where that's published?)
Edit: ooh.,.. looks like the code uses SmartPin pullups, so just a direct connection the the IO needed? I should try it !
I went through my parts drawer to find a DS18b20 -- it works fine using the P2 internal pull-up. My sensor is on a 3-foot cable.
Looking warm over there Jon
I've added the code to a new QuickByte, "1-wire with the P2".
There's 2 or 3 new QB's going live for Christmas, and they all leverage your code, so BIG thanks !
Very good now. It all worked well for me. Now, where did I see something about several sensors chained and displayed as a matrix in terminal? With the P2 I have a lot of I/O available so I think I could just add more pins and display lines. This would be good for room damper controls. Going back to docs looking for line length specs.
Unless you do a cogless driver you'll want to put them on a single pin -- that's the whole point of the serial number. At least one of the demos shows how to connect to a specific device.
McGyver,
Per your PM request, I'm attaching my P1 temp sensor driver below. Be sure to call convert first, then wait for the period required in the datasheet before reading the temperature.
-Phil