I think it's a great idea to receive an e-mail with temperature and humidity in your house, when you get home.
Major components- Raspberry Pi Zero W
- DHT11 Sensor
- HC-SR04 Ultrasonic Sensor
DHT11 Temperature and Humidity sensor :
The DHT11 is a 4-pin (one pin is unused) temperature and humidity sensor capable of measuring 20% - 90% relative humidity and 0 to 50 °C. The sensor can operate between 3 and 5.5V DC and communicates using its own proprietary OneWire protocol. This protocol requires very precise timing in order to get the data from the sensor. The LOW and HIGH bits are coded on the wire by the length of time the signal is HIGH. The total time to take a reading is at most 23.4 ms. This includes an 18 ms delay required to start the data transfer and a window of up to 5.4 ms for the data. Individual signals can be as short as 20 μs and as long as 80 μs.
HC-SR04 Sensor
The HC-SR04 ultrasonic sensor uses sonar to determine distance to an object like bats do. It offers excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package. It comes complete with ultrasonic transmitter and receiver modules.
To control the sensor we are going to use the Adafruit DHT11 Python library. To install it we are going to clone a git repository. Enter the terminal and run the following command in a folder of your choice.
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
After we clone the repository change the directory in the newly downloaded folder:
cd Adafruit_Python_DHT
Install the library dependencies with the following command:
sudo apt-get install build-essential python-dev
Then to install the library run the following command:
sudo python setup.py install
Code is written in Python and tu run it we use :
python project.py
DescriptionIf ultrasonic sensor detects movement will print "E-mail sent " and we will receive an e-mail with all information.
This is the descripion of GPIO board, that may help you how to connect the sensors
Comments