Project tutorial
Car-e-OK

Car-e-OK © GPL3+

Follow these steps to prevent your car from turning into a greenhouse.

  • 2,564 views
  • 0 comments
  • 8 respects

Components and supplies

Bolt 6 nzcjro4zrr
Bolt IoT Bolt WiFi Module
Gives me the power of the CLOUD!
×1
MQ-2
Measures Carbon Monoxide.
×1
MQ-135
Measures Carbon Dioxide.
×1
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
A000066 iso both
Arduino UNO & Genuino UNO
Does all the heavy lifting of interfacing Bolt and the sensors together.
×1

Apps and online services

About this project

Hey there. Finding a parking spot near your office is a big hassle, isn't it ? Well let me tell you a more annoying problem. Parking your car in the sun for long hours. We all know what it's like to park your car in the sun, but when you have no other option, this is what you are forced to do.

Now, you have parked your car in the scorching heat and went about your business for a couple of hours. When you get back to your car and open the doors to get in, a hot blast hits you. We all are annoyed by that heat and that is probably the only reason why we refrain from parking our cars in hot sun. But "my car turned into a hot oven" shouldn't be your only concern.

It is not just the heat that has gotten into your car. When your car is closed for a long time in the sun, it turns into a greenhouse. Don't know what a Greenhouse is? It's basically a container that traps gases like Carbon Dioxide, Carbon Monoxide, water vapor, etc.

Alright thanks for the science lesson, but why should I care ? This is what a lot of people think when they are in a hurry to reach someplace and just get into their cars and put their air conditioners on full throttle and roll up their window panes and drive off in a potential greenhouse.

Concerned?

Relax, we got this. Just follow through.

Step One

Get all the required components and assemble your circuit. Take a look at the provided schematic as a guide to assembling the circuit.

Here, the Arduino is connected to the Bolt Wifi Module via, UART (Universal Asynchronous Receiver Transmitter).

Take a look at this amazing documentation regarding the communication between Bolt and Arduino over UART, before you go any further.

Note: If you are using these sensors with a breakout board or sensor module, than Vcc goes to 5v and GND to Ground, and you can connect the OUT pin to any of the desired Analog pins of your Arduino.

Step Two

Now, it's time to make the Arduino talk to the sensors and the Bolt WiFi Module. Checkout this firmware which allows you to do so.

#include <BoltIoT-Arduino-Helper.h>
#include "MQ135.h"
#include "MQ2Lib.h"
#define   RZERO     206.85
int mq135_pin = A0;
int mq2_pin = A1;
float co_value = 0;
float co2_value = 0;
MQ2 mq2(mq2_pin,true);
MQ135 mq135(mq135_pin);
String pushData(String *data){
 co_value = mq2.readCO();
 co2_value = mq135.getPPM();
 return String(co2_value)+","+String(co_value);
}
void setup(){
 mq2.begin();
 boltiot.Begin(Serial);
 boltiot.setCommandString("RD\r",pushData);
 boltiot.setCommandString("GetData",pushData);
 pinMode(mq135_pin,INPUT);
 pinMode(mq2_pin,INPUT);
}
void loop(){
 boltiot.handleCommand();
}

There are three libraries used in this sketch. Here are the links to them.

1. Library for MQ-2 sensor to monitor Carbon Monoxide

2. Library for MQ-135 sensor to monitor Carbon Dioxide

3. Bolt Arduino Helper Library

Note: Hobby sensors such as the MQ sensors are difficult to calibrate hence the mentioned libraries do that for you.

Step Three

It's time to harness the power of the cloud and get a step closer to completing your application. So far you have assembled your hardware and uploaded the firmware to your Arduino, now it's time for things to get real. See this awesome tutorial on how to connect your Bolt WiFi Module to the Bolt Cloud and access various Bolt APIs.

Credits : Bolt IoT, Inventrom Private Limited.

Now we have all the parts ready for assembly, so let's move towards the final step of the application.

Step Four

For this final step, we will be writing a simple python script to notify us whenever the condition in our parked car worsens and what steps we should take. First of all let's install the Bolt Python API to help us easily communicate with the Bolt Cloud and our Bolt WiFi Module. To do so, open up your terminal and type in the following commands:

pip install boltiot

After doing this, the Bolt Python API is installed onto your system.

Now simply paste the following code into any blank python file (blank file with.py extension).

from boltiot import Bolt,Sms
from time import time
# Setup communication to Bolt by supplying your API key and Bolt ID
bolt = Bolt('your-api-key','your-bolt-id')
# Setup communication to your Twilio account and APIs
ssid = 'You can find SSID in your Twilio Dashboard'
auth_token = 'You can find your auth token on your Twilio Dashboard'
from_number = 'This is the no. generated by Twilio. You can find this on your Twilio Dashboard'
to_number = 'number to send the sms to'
sms = Sms(ssid, auth_token, to_number, from_number)
while(1):
   bolt.serialWrite('RD\r')
   received_data = bolt.serialRead(10).split(',')
   
   # Check if the values of Carbon Monoxide or Carbon Dioxide
   # exceed the given threshold.
   if(float(received_data[0]) > 5.0 or float(received_data[1] > 40.0)):
       sms.send_sms("
           Mayday! Mayday! Hey your cars turning into a Greenhouse. Here are           a few suggestions to help you.
       1. Park your car in a shade or,
       2. Roll down your windows for a few minutes and turn your AC on full swing or,
       3. If you can't do any of that right now, before getting into the car, open all the gates for a few minutes and drive with your windows rolled down to avoid any kind of troubles.
       Commander Car-e-OK Over and Out !
       ")
   
   # Let's loop this and monitor values every 5 minutes
   time.sleep(300)

Now executing this script will bring things to life. To execute this script run the following command on the terminal:

python <the_name_of_the_file>.py

Now let the script run in the background while you go about your work.

Congratulations! If you have came this far, you receive an amazing Fist Bump. Now, you are safe from any sort of threats.

And, don't worry, if in future any such threats should arise, you could always summon me and we will fight it together. Cheers!

Schematics

Putting Things Together
car-e-ok_CdbGg7YJe1.fzz

Comments

Similar projects you might like

Bolt Controlled Robot Car

Project tutorial by Team Bolt

  • 1,508 views
  • 1 comment
  • 13 respects

Water Level Alerting System

Project tutorial by Pranav Kundaikar and Vinayak Shantaram Joshi

  • 1,947 views
  • 0 comments
  • 5 respects

Humidity and Temperature Monitoring System

Project tutorial by Vinayak Shantaram Joshi

  • 4,799 views
  • 2 comments
  • 16 respects

Spooky Candy Box

Project tutorial by Shoeb Ahmed

  • 864 views
  • 0 comments
  • 5 respects
Add projectSign up / Login