The DS18B20 is a waterproof temperature sensor capable of being used for an automated aquarium, terrarium, or any environment in which the DHT22 cannot be deployed due to rust or other damage susceptibility. While DHT22’s are very accurate and give a variety of data such as humidity, heat index, etcetera, the problem is that it’s incapable of being protected from corrosion. This tutorial explains how to hookup, code, and deploy the DS18B20 waterproof temperature sensor.
The passive infrared sensor (PIR) is a sensory unit that detects infrared (heat) energy and can be configured to trigger events based upon it being active or inactive. We will be using the Elegoo micro-controller to manipulate its output, as well as learning some hardware information.
The PIR sensor is a cheap and easy to use unit that requires minimal effort on behalf of the user; with a few wires and taps of the keyboard you’ll be well on your way to implementing more complicated heat/ intrusion detection systems down the road.
Let’s first look at the PIR’s hardware and detail each of their functions:
The DS3231 is a real time clock utilized by the arduino micro-controller to remember and to trigger time based events. It features a CR2032 coin-cell backup battery pack, which will keep it powered for long periods of time when micro-controller power has failed by only powering the chip tasked with time keeping. During this power failure, the red LED which would normally be illuminated will be off during this time. Due to the various settings the module can be deployed it has a temperature-compensating chip that varies the oscillation cycle to adjust for high heat and cold. This unit retails on Amazon at 2 for $6.99 and is very easy to manipulate in the Arduino IDE.