Now a days, accidents are occurring more. many of people getting injured due to the accidents. once think, how it will be if the vehicle alerts when it comes close to another vehicles. today this project will help you to develop small prototype so that it will alerts you using Bolt and Arduino Uno. the distance can be taken using ultrasonic sensor.
Hence we, the developers at Bolt IoT, decided to come up with the safe distance alert system. it's essentially a setup which uses the popular Ultrasonic Sensor(HC-SR04), the Bolt Wi-Fi module, and an Arduino Uno to measure how much distance vehicle comes close to it. Hence collision between vehicles can be controlled.
the HC-SR04 Ultrasonic Sensor is at the center of the vehicle. The distance can be taken and alerts when it reaches below the safe distance.
1. Gather all the components and check if led and Ultrasonic sensor are working fine or not.
2. Connect the cathode of led to GND & anode to 13 pin of Arduino.
3. Connect the small pin of buzzer to GND & other pin to 11 pin of Arduino.
4. Connect the Ultrasonic Sensor pins VCC, GND, Trigpin, Echopin to 5V, GND, 9, 10 respectively to Arduino.
5. Connect the Tx and Rx of the Bolt to the Rx and Tx of Arduino respectively.
6. Finally, connect 5V pin of Bolt to GND of Arduino and GND of Bolt to GND of Arduino.
NOTE:Refer to the Schematics of any guidance
1. Download the Boltiot-arduino-helper library from Git Hub and add it to Arduino library.
2. Upload the code provide below to arduino Uno.
NOTE: Remove the Tx and Tx connection between Bolt and Arduino before uploading.
API calls
For taking measurements using API calls we will use the UART API's of bolt cloud.
First initialise serial communication between Bolt and Arduino via serialBegin API
For turning the led ON & buzzer we will require serialWrite API
To get response of each of serialWrite API call we will use serialRead API.
NOTE:In all the above API calls replace the API key and Bolt device ID with the one you got from Bolt account.
Working Principle:
The working principle is very simple. the Arduino continuously check for Serial command received from Bolt. if the command string ON it performs the corresponding functions.
When it receives ON if everything is right it performs analogWrite command. it checks the range of distance from ultrasonic sensor is in limit. if it is less than the limit the led and buzzer will be ON.
Hence in this way we can alert when a vehicle comes close to another vehicles.
video :
Comments