SteamyTea Posted August 26, 2021 Share Posted August 26, 2021 When I calibrated a bunch of DS18B20s, I found the biggest variance was in the time they took to react to a temperature change. This can give the impression that they are less accurate than they are. Link to comment Share on other sites More sharing options...
TerryE Posted August 29, 2021 Share Posted August 29, 2021 On 26/08/2021 at 07:54, MJNewton said: You shouldn't have to calibrate these sensors. As old Ronald Reagan said: trust but verify. Actually doing the calibration was a very useful confidence exercise and meant that I could have trust in the sensor outputs. I've zero problems with my DS18B20-base temperature acquisition in the four years that I've been using it. Link to comment Share on other sites More sharing options...
Jenki Posted October 3, 2021 Share Posted October 3, 2021 On 10/06/2021 at 07:43, Adrian Walker said: I building a temperature monitor and logger at the moment. From a hardware point of view I'm using DS18B20 (12 bit gives 0.0625°C), Raspberry Pi Zero with a 1-wire HAT. How is this progressing? I'm new to RPi, but like the idea of having multiple sensors, some installed in the slab, some air mounted etc to monitor and essentially control heating / ventilation. Link to comment Share on other sites More sharing options...
Adrian Walker Posted October 5, 2021 Share Posted October 5, 2021 On 03/10/2021 at 15:45, Jenki said: How is this progressing? I'm new to RPi, but like the idea of having multiple sensors, some installed in the slab, some air mounted etc to monitor and essentially control heating / ventilation. Still work in progress as other projects (inc 4 poster bed) have over taken this. Link to comment Share on other sites More sharing options...
SteamyTea Posted October 5, 2021 Share Posted October 5, 2021 On 03/10/2021 at 15:45, Jenki said: How is this progressing? I'm new to RPi, but like the idea of having multiple sensors, some installed in the slab, some air mounted etc to monitor and essentially control heating / ventilation. Here is the code I use. Just change the 28-xxxxxxxxxxxx number to your sensors number. You can add more sensors by just copying and pasting in the part relating to the sensor while incrementing the number by one. Then add the sensor number to the "writes to data file" line. #!/usr/bin/python #imports necessary libaries import os, time, datetime #load drivers os.system('modprobe w1-gpio') os.system('modprobe w1-therm') while True: #Sort out the time format dt = datetime.datetime.now() runday = dt.day dt.day == runday #sensor 1 tfile = open("/sys/bus/w1/devices/28-0306979462ca/w1_slave") text1 = tfile.read() tfile.close() temperature_data1 = text1.split()[-1] temperature1 = float(temperature_data1[2:]) temperature1 = temperature1 / 1000 #sensor 2 tfile = open("/sys/bus/w1/devices/28-031097946bbc/w1_slave") text2 = tfile.read() tfile.close() temperature_data2 = text2.split()[-1] temperature2 = float(temperature_data2[2:]) temperature2 = temperature2 / 1000 #sensor 3 tfile = open("/sys/bus/w1/devices/28-030197941c13/w1_slave") text3 = tfile.read() tfile.close() temperature_data3 = text3.split()[-1] temperature3 = float(temperature_data3[2:]) temperature3 = temperature3 / 1000 #sensor 4 # tfile = open("/sys/bus/w1/devices/28-03149794263a/w1_slave") # text4 = tfile.read() # tfile.close() # temperature_data4 = text4.split()[-1] # temperature4 = float(temperature_data4[2:]) # temperature4 = temperature4 / 1000 #opens and reads the time ts = time.time() #sets time to UTC and dd/mm/yyyy hh:mm:ss format UTC = datetime.datetime.utcfromtimestamp(ts).strftime('%d/%m/%Y %H:%M:%S') logfile = '/home/pi/monitoring/data/1wire-%s-%s-%s.csv' % (dt.day, dt.month, dt.year) #creates and opens or appends data to file tfile = open(logfile, "a") #writes to data file tfile.write("%s"%UTC + ",%s"%temperature1 + ",%s"%temperature2 + ",%s"%temperature3 + '\n') #closes data file tfile.close #sleeps for (n) seconds until next reading time.sleep(25) 1 1 Link to comment Share on other sites More sharing options...
MJNewton Posted October 5, 2021 Share Posted October 5, 2021 (edited) 17 minutes ago, SteamyTea said: tfile = open("/sys/bus/w1/devices/28-0306979462ca/w1_slave") Note that those sensors are likely to be fake - genuine Maxim sensors have four zeroes in the last 16 bits of the serial number. Genuine ones are only a few quid more at the likes of CPC etc and removes any doubt about accuracy, longevity etc. Edited October 5, 2021 by MJNewton 1 Link to comment Share on other sites More sharing options...
SteamyTea Posted October 5, 2021 Share Posted October 5, 2021 3 minutes ago, MJNewton said: Note that those sensors are likely to be fake - genuine Maxim sensors have four zeroes in the last 16 bits of the serial number. Genuine ones are only a few quid more at the likes of CPC etc. Yes, those ones may well be, they were less than a quid each. They work OK. Link to comment Share on other sites More sharing options...
TerryE Posted October 5, 2021 Share Posted October 5, 2021 On 26/08/2021 at 09:54, MJNewton said: You shouldn't have to calibrate these sensors As old Ronald Reagan said: trust, but verify. ? Link to comment Share on other sites More sharing options...
Jenki Posted October 5, 2021 Share Posted October 5, 2021 6 hours ago, SteamyTea said: Here is the code I use. Thanks ? Link to comment Share on other sites More sharing options...
Mr Punter Posted October 15, 2021 Share Posted October 15, 2021 I would find it quite handy to log temperatures in several rooms throughout the house. Does anyone do neat looking sensors that I can plug into an ethernet port, with a PC based program to view the data? Link to comment Share on other sites More sharing options...
SteamyTea Posted October 15, 2021 Share Posted October 15, 2021 1 hour ago, Mr Punter said: I would find it quite handy to log temperatures in several rooms throughout the house. Does anyone do neat looking sensors that I can plug into an ethernet port, with a PC based program to view the data? Why, is it running cables, even very small ones that is the problem? Here is an idea, using cheap parts, to start logging data. https://microcontrollerslab.com/micropython-bme280-esp32-esp8266-temperature-humidity-pressure/ Link to comment Share on other sites More sharing options...
Mr Punter Posted October 15, 2021 Share Posted October 15, 2021 1 hour ago, SteamyTea said: Why, is it running cables, even very small ones that is the problem? I would like to log and display temperature data from each floor in a 4 storey house. It has an ethernet network so I would like to use the CAT5 cable, even if I don't use proper ethernet - so maybe adapt leads either end - but proper ethernet would be my preference and view the data on my PC. Link to comment Share on other sites More sharing options...
SteamyTea Posted October 15, 2021 Share Posted October 15, 2021 (edited) 1 hour ago, Mr Punter said: but proper ethernet would be my preference and view the data on my PC Dead easy. Raspberry Pi Zero W, with BME 280, power off the ethernet (POE), connect to your router, or another router, either wirelessly or via USB to ethernet adapter, up to you. Then log data to a NAS (maybe a simple USB memory stick on the router) and read from that with the PC. (edit: always check that what is in the description is the correct article, I have a few BMPs rather than BMEs because of shifty traders) Edited October 15, 2021 by SteamyTea Link to comment Share on other sites More sharing options...
Jenki Posted October 16, 2021 Share Posted October 16, 2021 11 hours ago, SteamyTea said: Dead easy. Raspberry Pi Zero W, with BME 280, power off the ethernet (POE), connect to your router, or another router, either wirelessly or via USB to ethernet adapter, up to you. Then log data to a NAS (maybe a simple USB memory stick on the router) and read from that with the PC. (edit: always check that what is in the description is the correct article, I have a few BMPs rather than BMEs because of shifty traders) In my wait for planning / building warrant, this is similar to the project I'm working on. you also have the option of using RPI pico (£4), if you only want temperature as it has inbuilt temperature. I'm early stages at the moment. Playing with options of sending the data to a web sql database, but linking to a NAS maybe more straight forward. I'm thinking of this RPi Display located centrally with a RPI located near the router to do the number crunching. but have not got to passing data between Pi's yet. long term I would like to be able to control the heating from this as well. the PICO could easily hide in one of these covers . Link to comment Share on other sites More sharing options...
SteamyTea Posted October 16, 2021 Share Posted October 16, 2021 38 minutes ago, Jenki said: you also have the option of using RPI pico (£4) If it uses MicroPython, it may well work with the existing BME280 libraries. I see there is some networking code on github for it. Oh, and some BME280 code. Micro electronics is just fantastic compared to mechanical engineering. Link to comment Share on other sites More sharing options...
TerryE Posted October 16, 2021 Share Posted October 16, 2021 As soon as you start instrumenting a house and wanting to do more them IMO, it is just easier to bite the bullet and install Home Assistant on an RPi 4. You get a Zigbee dongle for it and Zigbee thermometers cost a few £s each. No need for any wiring fabric. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now