Hardware components | ||||||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
Software apps and online services | ||||||
![]() |
| |||||
|
Most of the times in offices or hospitals the dustbins are not managed that well. So the idea of a dustbin which can sense the dustbin's level arises. Also, public dustbins can use the same concept but the problem of managing the system arises, in case of fire or theft,
Mainly this project shows about a dustbin which sends the user an email whenever the dustbin is about to get full.
The length of the dustbin can be varied accordingly in the code.
Configuring Integromat
Firstly download the json file available down below in the code section.Then in the intergromat select your workspace and go to the Bolt IoT's workspace.1. Add your API of Bolt Wifi module as shown in the figure.2. Add your bolt ID "BOLTXXXX" in the device name section.Follow the steps as shown in the image:
Just select "my bolt connection" which you created in the first section.
Now in this math bubble change the value 100 to the value of the height at which you have kept the sensor.For the dot between email and maths bubble:In my case the the total length of the dustbin is 16 cms. So I have kept the value as 14 so as to get email whenever the bin gets full.
#include <Ultrasonic.h>
#include <BoltIoT-Arduino-Helper.h>
#define ULTRASONIC_TRIG_PIN 12
#define ULTRASONIC_ECHO_PIN 13
Ultrasonic ultrasonic(ULTRASONIC_TRIG_PIN,ULTRASONIC_ECHO_PIN);
int distance=0;
String getDistance(String *arguments){
distance = ultrasonic.read();
String returnString=""+String(distance);
return returnString;
}
void setup() {
boltiot.begin(Serial);
// put your setup code here, to run once:
boltiot.setCommandString("RD\r",getDistance);
boltiot.setCommandString("GetDistance",getDistance);
}
void loop() {
boltiot.handleCommand();
// put your main code here, to run repeatedly:
}
{
"name": "Water Level Detection",
"flow": [
{
"id": 15,
"module": "app#bolt-iot:executeCommand",
"version": 1,
"parameters": {
"__IMTCONN__": 445281
},
"mapper": {
"command": "serialBegin",
"parameters": {
"baud": "9600",
"deviceName": ""
}
},
"metadata": {
"designer": {
"x": 8,
"y": -3
},
"restore": {
"command": {
"label": "Initialize serial communication"
},
"__IMTCONN__": {
"label": "My Bolt connection"
}
},
"parameters": [
{
"name": "__IMTCONN__",
"type": "account",
"label": "Connection",
"required": true
}
],
"expect": [
{
"name": "command",
"type": "select",
"label": "Command",
"required": true,
"validate": {
"enum": [
"digitalWrite",
"digitalRead",
"analogRead",
"analogWrite",
"serialBegin",
"serialWrite",
"serialRead",
"version",
"restart",
"isAlive"
]
}
},
{
"name": "parameters",
"spec": [
{
"name": "deviceName",
"type": "text",
"label": "Device name",
"required": true
},
{
"name": "baud",
"type": "number",
"label": "Baud",
"required": true
}
],
"type": "collection",
"label": "Parameters"
}
]
}
},
{
"id": 1,
"module": "app#bolt-iot:executeCommand",
"version": 1,
"parameters": {
"__IMTCONN__": 445281
},
"mapper": {
"command": "serialWrite",
"parameters": {
"data": "GetDistance",
"deviceName": ""
}
},
"metadata": {
"designer": {
"x": 300,
"y": 0
},
"restore": {
"command": {
"label": "Send serial data output"
},
"__IMTCONN__": {
"label": "My Bolt connection"
}
},
"parameters": [
{
"name": "__IMTCONN__",
"type": "account",
"label": "Connection",
"required": true
}
],
"expect": [
{
"name": "command",
"type": "select",
"label": "Command",
"required": true,
"validate": {
"enum": [
"digitalWrite",
"digitalRead",
"analogRead",
"analogWrite",
"serialBegin",
"serialWrite",
"serialRead",
"version",
"restart",
"isAlive"
]
}
},
{
"name": "parameters",
"spec": [
{
"name": "deviceName",
"type": "text",
"label": "Device name",
"required": true
},
{
"name": "data",
"type": "text",
"label": "Data",
"required": true
}
],
"type": "collection",
"label": "Parameters"
}
]
}
},
{
"id": 14,
"module": "app#bolt-iot:executeCommand",
"version": 1,
"parameters": {
"__IMTCONN__": 445281
},
"mapper": {
"command": "serialRead",
"parameters": {
"till": "10",
"deviceName": ""
}
},
"metadata": {
"designer": {
"x": 600,
"y": 0
},
"restore": {
"command": {
"label": "Read incoming serial data"
},
"__IMTCONN__": {
"label": "My Bolt connection"
}
},
"parameters": [
{
"name": "__IMTCONN__",
"type": "account",
"label": "Connection",
"required": true
}
],
"expect": [
{
"name": "command",
"type": "select",
"label": "Command",
"required": true,
"validate": {
"enum": [
"digitalWrite",
"digitalRead",
"analogRead",
"analogWrite",
"serialBegin",
"serialWrite",
"serialRead",
"version",
"restart",
"isAlive"
]
}
},
{
"name": "parameters",
"spec": [
{
"name": "deviceName",
"type": "text",
"label": "Device name",
"required": true
},
{
"name": "till",
"type": "number",
"label": "Till",
"required": true,
"validate": {
"max": 127,
"min": 0
}
}
],
"type": "collection",
"label": "Parameters"
}
]
}
},
{
"id": 18,
"module": "math:EvaluateExpression",
"version": 1,
"parameters": {},
"mapper": {
"expression": "100-{{parseNumber(14.value)}}"
},
"metadata": {
"designer": {
"x": 869,
"y": -2
},
"expect": [
{
"name": "expression",
"type": "text",
"label": "Expression",
"required": true
}
]
}
},
{
"id": 13,
"module": "google-email:ActionSendEmail",
"version": 1,
"parameters": {
"account": 445282
},
"filter": {
"name": "Check if water level to high",
"conditions": [
[
{
"a": "{{18.result}}",
"b": "60",
"o": "number:greater"
}
]
]
},
"mapper": {
"cc": [],
"to": [
],
"bcc": [],
"html": "Water level has reached {{18.result}}cms.",
"subject": "Warning! Water Level is too high!!",
"attachments": []
},
"metadata": {
"designer": {
"x": 1145,
"y": -3
},
"restore": {
"cc": {
"mode": "chose",
"items": []
},
"to": {
"mode": "chose",
"items": [
"undefined"
]
},
"bcc": {
"mode": "chose",
"items": []
},
"account": {
"label": ""
},
"attachments": {
"mode": "chose",
"items": []
}
},
"parameters": [
{
"name": "account",
"type": "account",
"label": "Connection",
"required": true
}
],
"expect": [
{
"name": "to",
"spec": {
"name": " ",
"type": "email",
"label": "Email address",
"required": true
},
"type": "array",
"label": "To",
"labels": {
"add": "Add a recipient",
"edit": "Edit a recipient"
},
"required": true
},
{
"name": "subject",
"type": "text",
"label": "Subject"
},
{
"name": "html",
"type": "text",
"label": "Content"
},
{
"name": "attachments",
"spec": [
{
"name": "fileName",
"type": "filename",
"label": "File name",
"required": true,
"semantic": "file:name"
},
{
"name": "data",
"type": "buffer",
"label": "Data",
"required": true,
"semantic": "file:data"
},
{
"name": "cid",
"type": "text",
"label": "Content-ID"
}
],
"type": "array",
"label": "Attachments",
"labels": {
"add": "Add an attachment",
"edit": "Edit an attachment"
}
},
{
"name": "cc",
"spec": {
"type": "email",
"label": "Email address"
},
"type": "array",
"label": "Copy recipient",
"labels": {
"add": "Add a copy recipient",
"edit": "Edit a copy recipient"
}
},
{
"name": "bcc",
"spec": {
"type": "email",
"label": "Email address"
},
"type": "array",
"label": "Blind copy recipient",
"labels": {
"add": "Add a blind copy recipient",
"edit": "Edit a blind copy recipient"
}
}
]
}
}
],
"metadata": {
"version": 1,
"scenario": {
"roundtrips": 1,
"maxErrors": 3,
"autoCommit": false,
"sequential": false,
"confidential": false,
"dataloss": false,
"dlq": false
},
"designer": {
"orphans": []
},
"zone": "eu1.integromat.com"
}
}
Comments