When I used my BMP180 barometric pressure sensor, I needed to know whether breadboards on which it is attached are on a flat plain or not to make sure that my measurements related to pressure, temperature and altitude are accurate, hence the use of the tilt sensor. I choose using a mercury sensor instead of using a tilt sensor module like KY-020 due to its accuracy. According to the data digitally generated by the mercury sensor, when it is detected that BMP180 barometric pressure sensor on a tilted plain, vibration motor pins are activated as a notification and a reminder along with the dedicated false led pin.
To support my projects and articles, you can visit my website here.
It is easy to use for a sensor managing a very complex readings. First of all, download its library and get more information before continuing to read here.
After downloading SFE_BMP180 library, solder male header to the module and connect SDA, SCl pins to the dedicated pins defined in the source code down below.
Now, you can get pressure, temperature and altitude values from BMP180 sensor with regard to a baseline pressure in mb, defined at the source code.
If you want to, you can use a tilt sensor module instead a mercury sensor.
Connect its first leg to GND, 10K resistor and D8 in this order, and its second led to 5V directly.
After that, read - digitalRead(tilt); - the data digitally generated as 0 and 1, or LOW and HIGH.
To control the vibration motor, just write HIGH or LOW to the dedicated pin, in this case it is D11.
On a flat plain;
Tilt sensor is HIGH,
OK is HIGH,
FALSE is LOW,
Vibration motor is LOW,
Pressure, temperature and altitude values are displayed.
On a tilted plain;
Tilt sensor is LOW,
OK is LOW,
FALSE is HIGH,
Vibration motor is HIGH,
Error message is displayed - "Please balance on a flat plain!".
All board connections are well-explained at the source code down below.
Make components connections as explained down below and the project fritzing file.
Comments