srikanta kumar dash
Published

Chimney Dust Alert System

Send SMS alert to the mobile when dust level increases in the chimney filter.

BeginnerFull instructions provided1 hour1,092
Chimney Dust Alert System

Things used in this project

Story

Read more

Schematics

Hardware Setup

The HC-SR04 Ultrasonic Sensor is at the center of the Chimney Filter. The
breadboard diagram is as follows:

Dust Alert Circuit

Software Setup

The Arduino Code linked in below measures the distance using the Ultrasonic sensor and thereafter sends it to the Bolt Wi-Fi module over serial communication.

A Python Script (running on a server or your PC, for instance) queries the Bolt Cloud for this distance value using the Bolt Python Library, which in turn is based on the Bolt open APIs for Serial Read.

The Python script then checks if the distance is less than a preset threshold is too high in the filter. In case the dust is full in filter, an SMS alert is sent out using the Twillio SMS service.

Code

Dust Check Distance Code

Arduino
Arduino modified Ultrasonic simple example from
Ultrasonic library to send data from sensor over serial to
Bolt.
/*
* Ultrasonic Simple
* Prints the distance read by an ultrasonic sensor in
* centimeters. They are supported to four pins ultrasound
* sensors (liek HC-SC04) and three pins (like PING)))
* and Seeed Studio sesores).
*
* The circuit:
* * Module HR-SC04 (four pins) or PING))) (and other with
* three pins), attached to digital pins as follows:
* --------------------- ---------------------
* | HC-SC04 | Arduino | | 3 pins | Arduino |
* --------------------- ---------------------
* | Vcc | 5V | | Vcc | 5V |
* | Trig | 12 | OR | SIG | 13 |
* | Echo | 13 | | Gnd | GND |
* | Gnd | GND | ---------------------
* ---------------------
* Note: You need not obligatorily use the pins defined above
*
* By default, the distance returned by the distanceRead()
* method is in centimeters, to get the distance in inches,
* pass INC as a parameter.
* Example: ultrasonic.distanceRead(INC)
*/

#include <Ultrasonic.h>

/*
* Pass as a parameter the trigger and echo pin, respectively,
* or only the signal pin (for sensors 3 pins), like:
* Ultrasonic ultrasonic(13);
*/
 Ultrasonic ultrasonic(12, 13);

  void setup() {
    Serial.begin(9600);
   }
  Serial.println(ultrasonic.distanceRead());
  delay(1000);
   }

Dust Alert Code

Python
This is the Python Script you run on your PC to
check the distance against a threshold and send
SMS alert.
from boltiot import Bolt, Sms #Import Sms and Bolt class from boltiot library
import json, time

dust_full_limit = 5 # the distance between device and filter in chimney in cm

API_KEY = "your Bolt Cloud api key"
DEVICE_ID = "your device id"

# Credentials required to send SMS
SID = 'your twilio sid'
AUTH_TOKEN = 'your twilio auth token'
FROM_NUMBER = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
TO_NUMBER = 'This is your number. Make sure you are adding country code in the beginning'

mybolt = Bolt(API_KEY, DEVICE_ID) #Create object to fetch data
sms = Sms(SID, AUTH_TOKEN, TO_NUMBER, FROM_NUMBER) #Create object to send SMS
response = mybolt.serialRead('10')
print response

while True:
response = mybolt.serialRead('10') #Fetching the value from Arduino
data = json.loads(response)
garbage_value = data['value'].rstrip()
print "Garbage level is", garbage_value
if int(garbage_value) < garbage_full_limit:
response = sms.send_sms('Hello, i am full - Dust Alert')
time.sleep(200)

Credits

srikanta kumar dash
1 project • 0 followers

Comments