Onewire and DS18B20
Re: Onewire and DS18B20
It works (tried using the new library that Damien supplied)
Thank you very much guys, now to actually make something awesome with it.
Thank you very much guys, now to actually make something awesome with it.
- danicampora
- Posts: 342
- Joined: Tue Sep 30, 2014 7:20 am
- Contact:
Re: Onewire and DS18B20
Works. Thanks for sorting this outdanicampora wrote:Thanks Damien for the library, and for changing the output to fixed point .
I am attaching the beta WiPy firmware that needs to be used in order to test the library.
Although, I think there is an issue with the reading...
The WiPy reading:
Code: Select all
devices: [bytearray(b'(\xfd\xa0\x05\x05\x00\x00\xa1'), bytearray(b'(\x94\xb4\x00\x05\x00\x00\x16')]
temperatures: [2212, 2218]
Room thermometer: 21.2 deg C
Raspi DS18B20: 21.5 deg C
I'm puzzled with this reading offset. Can you explain the 1 deg C offset from temperature measured with a room thermometer and one other DS18B20 connected via Raspberry Pi.
All three sources of measurement are in the same microclimate (5 cm from one another ).
Re: Onewire and DS18B20
Great that the driver works!
It's strange to have a discrepancy... Can you check if it's a constant 1 degree difference by making them all hotter (say 30 degrees) using the same heat source at the same time?
It's strange to have a discrepancy... Can you check if it's a constant 1 degree difference by making them all hotter (say 30 degrees) using the same heat source at the same time?
Re: Onewire and DS18B20
If I stand near one of my room thermostats, the heat from my breath can cause it to go up.
So I wouldn't necessarily be surprised that the RPi one is a bit warmer (the RPi itself will run hotter and some of that heat may be getting to the sensor).
The DS18B20 datasheet https://www.maximintegrated.com/en/prod ... 18B20.html says +/-0.5 degree accuracy so your readings are within the specs.
So I wouldn't necessarily be surprised that the RPi one is a bit warmer (the RPi itself will run hotter and some of that heat may be getting to the sensor).
The DS18B20 datasheet https://www.maximintegrated.com/en/prod ... 18B20.html says +/-0.5 degree accuracy so your readings are within the specs.
Re: Onewire and DS18B20
This is the "test setup":
@Damien: I tried with hairdryer (up to ~30C). Same relative discrepancy.
@dhylands: I don't have the problem with discrepancy of DS and analog thermometer. I've tested up to 4 DSes on the same bus and on the same spot (milimeters away) with the Raspi and their results were within 2% of each other (or ~0.05 C).
What bothers me is that the same sensor now shows 0.8 C difference when the only difference is that it's connected via WiPy.
I've measured (with cheap IR temp meter) WiPy at 26.9 C, so I believe it can't that much influence the sensor.@Damien: I tried with hairdryer (up to ~30C). Same relative discrepancy.
@dhylands: I don't have the problem with discrepancy of DS and analog thermometer. I've tested up to 4 DSes on the same bus and on the same spot (milimeters away) with the Raspi and their results were within 2% of each other (or ~0.05 C).
What bothers me is that the same sensor now shows 0.8 C difference when the only difference is that it's connected via WiPy.
- danicampora
- Posts: 342
- Joined: Tue Sep 30, 2014 7:20 am
- Contact:
Re: Onewire and DS18B20
Maybe there is a difference in Vcc (both 3.3V or 5V), which causes that deviation? I do use a lot of those sensors for years and they differ in temperature readings all across the board within the already mentioned tolerance. So imo their readings are to be interpreted "relative" only.
There might also be a reason hidden in parasite-powered mode of them!?
In the last iteration of our sensor network (spread across 6 data-centers) we decided to not use them in parasite-powered mode, which makes them far more reliable in means of reading performance.
There might also be a reason hidden in parasite-powered mode of them!?
In the last iteration of our sensor network (spread across 6 data-centers) we decided to not use them in parasite-powered mode, which makes them far more reliable in means of reading performance.
Re: Onewire and DS18B20
ds18b20 works here with the new onewire.py and latest firmware. Just using regular gnd and 3v3 vdd instead of GP1 and GP3, that did not work for me. 4k7 pullup. Reading in ice water got as low as 200, not a precision device.
Looking forward to the LoRa device - why I'm brushing up on MicroPython
Looking forward to the LoRa device - why I'm brushing up on MicroPython
Code: Select all
>>> from machine import Pin
>>> from onewire import OneWire, DS18X20
devices: [bytearray(b'(j\x8b\x8d\x04\x00\x00s')]
temperatures: [2656]
>>> dat = Pin('GP2')
>>> ow = OneWire(dat)
>>> ds = DS18X20(ow)
>>> ds.read_temp()
2643
>>> ds.read_temps()
[2650]
>>> ds.roms
[bytearray(b'(j\x8b\x8d\x04\x00\x00s')]
Re: Onewire and DS18B20
Hi,
I do use the library from Damien and it works pretty good so far.
sometimes I do get such a result - in this case data[4] is printed as \x004, how can that be?
I do use the library from Damien and it works pretty good so far.
Code: Select all
...
data = ow.read_bytes(9)
data
bytearray(b'\x0f\x00\x00\xcb\x004\x00\x00\xe8')