logo elektroda
logo elektroda
X
logo elektroda

[Solved] Creating a blackout notification system with Raspberry Pi 4b, Domoticz and DS18B20

DestiX 915 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19427416
    DestiX
    Level 10  
    Hello, I am putting together a circuit for myself to monitor temperature. I am using Raspberry Pi 4b + Domoticz + DS18B20 sensor for this. I would additionally like to create a system based on this sensor to inform me of power outages. What would this look like?

    I would power the Raspberry from a UPS so that it would still work for about 20 minutes despite a power outage, I would like to power the sensor with a normal power supply from the socket without the UPS. In my mind it looks like if the sensor doesn't get power it will show some strange values (maybe 0 degrees or maybe some minus temperatures) then Domoticz will send an alert email.

    Is such a thing even possible? If so, how do I put it all together?

    If wrong section then sorry and please move to the correct one.
    Do you have a problem with Raspberry? Ask question. Visit our forum Raspberry.
  • ADVERTISEMENT
  • Helpful post
    #2 19427463
    Slawek K.
    Level 35  
    A reading error from the DS18B20 manifests itself as a temperature reading of -127 deg, except that this can also indicate a sensor error, lack of connectivity, etc., so it is not synonymous with a power failure.

    Best regards
  • #3 19427481
    DestiX
    Level 10  
    It still saves me because it will be clear that something is wrong and that is what I care most about as this "system" will be in the server room. The question is can I connect it as I described above?
  • ADVERTISEMENT
  • Helpful post
    #4 19427489
    Slawek K.
    Level 35  
    The GND of the power supply and the Raspberry must be connected together. The question is how far is the sensor from the RPi ?
  • #5 19427551
    DestiX
    Level 10  
    I think 2-3m is the maximum but I would bet more on a distance of about 1m.
  • ADVERTISEMENT
  • #6 19427577
    janek_wro
    Level 29  
    DestiX wrote:
    I would additionally like to create a system on the basis of this sensor which informs of power failure
    And why such a combination? Isn't it better to do it directly? At least reading the data from the UPS, via its port. Or, if the UPS is poor and doesn't have this boon, you can feed the supply voltage, after rectification and filtering, to an optocoupler, and output to the GPIO on the RPi. There are probably many more ways.
  • #7 19427585
    DestiX
    Level 10  
    janek_wro wrote:
    DestiX wrote:
    I would additionally like to create a system based on this sensor to inform of power failure
    And why such a combination? Isn't it better to do it directly? At least reading the data from the UPS, via its port. Or, if the UPS is poor and doesn't have this boon, you can feed the supply voltage, after rectification and filtering, to an optocoupler, and outlet to the GPIO in the RPi. There are probably many more ways.


    This combination because it is easier for me to figure out. What you have written is not very clear to me and therefore I would probably have a lot of trouble putting it together, and soldering the power supply cable is a much easier task.
  • ADVERTISEMENT
  • Helpful post
    #8 19427751
    Ondo
    Level 11  
    Slawek K. wrote:
    The reading error from the DS18B20 manifests itself with a temperature reading of -127 deg, only that this can also mean a sensor error, lack of connectivity, etc., so it is not synonymous with a power failure.
    Lack of power during a measurement attempt results in a measurement result of 85*C, this is described in the specification. Interestingly the DS18B20 has the ability to check if the thermometer has power remotely via the bus with the instruction "READ POWER SUPPLY [B4h]".
  • #9 19430928
    DestiX
    Level 10  
    Okay, so I managed to build a system that actually works. Admittedly the sensor when the power goes out shows about 37 degrees and not 85 or -127 but it doesn't make much difference, in fact none. Should anyone need it, here is a simple wiring diagram drawn in painter.

    Thank you all for your help and best regards.

    Creating a blackout notification system with Raspberry Pi 4b, Domoticz and DS18B20 .
  • #10 19431676
    DestiX
    Level 10  
    Okay, so I managed to build a system that actually works. Admittedly the sensor when the power goes out shows about 37 degrees and not 85 or -127 but it doesn't make much difference, in fact none. Should anyone need it, here is a simple wiring diagram drawn in painter.

    Thank you all for your help and best regards.

    Creating a blackout notification system with Raspberry Pi 4b, Domoticz and DS18B20 .

    Added after 7 [hours] 53 [minutes]: .

    Solution above.

Topic summary

A user is developing a temperature monitoring system using a Raspberry Pi 4b, Domoticz, and a DS18B20 sensor, with the intention of creating a blackout notification system. The Raspberry Pi will be powered by a UPS to maintain functionality during power outages, while the DS18B20 sensor will be powered directly from the mains. The user seeks to configure the system so that if the sensor loses power, it will report abnormal temperature readings, triggering an alert via Domoticz. Responses indicate that the DS18B20 can show various erroneous readings when power is lost, and it is essential to connect the ground of the power supply to the Raspberry Pi. The user successfully implemented the system, reporting that the sensor displayed a temperature of approximately 37 degrees during a power outage, which still served the purpose of indicating a fault.
Summary generated by the language model.
ADVERTISEMENT