Hardware components | ||||||
| × | 3 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 4 | ||||
| × | 1 | ||||
| × | 1 | ||||
| × | 1 | ||||
Software apps and online services | ||||||
|
The practical project “Smart Bike” that gathers various information regarding the rider performance basing the sensors that are mounted on the bike. The sensors are interfaced using an Arduino UNO. This project also aims to provide the real-time assessment of a rider’s performance along with the increasing the ease of the operation of bicycle during the ride and to provide security features to the bike.
The project presents the usage of sensors like heartbeat sensor, temperature and humidity sensor, ultrasonic sensor for rear vehicle approach indication, GPS SD card logger for recording the details of the ride, LEDs for left and right indication and Hall effect sensor for measuring the cadence, speed, and distance travelled.
The information calculated is displayed on the LCD display which is provided with buttons which enable the user to alter the information.
connection of hall effect sensors
The red line indicates the Vcc pin which is connected to 5V on the Arduino UNO Board and the Blackline indicates ground which is connected to the GND pin on the Arduino board. Then the Blue line indicates the digital input of the sensor to the Digital I/O pin on the sensor
Temperature and Humidity sensor
The Red wire indicates the Vcc pin which is connected to the 5V pin on the Arduino UNO.
The Blue wire indicates the Data input pin which is connected to the one of Digital I/O pins on the Arduino UNO.
GPS ULTIMATE LOGGER SHIELD CONNECTED TO ARDUINO UNO
Functional diagram of the smart bike
The Hall effect sensors are connected on the pedal and on the front tyre fork and the magnets are connected to the spikes on the front tyre and opposite to the pedal pad when the sensor passes through the magnet the voltage fluctuates giving rise to the number of times the Revolution per second which is converted into speed and distance traveled. These sensors are wired to the Arduino UNO which is present at the handlebar.
Ultrasonic ranging module is used to obtain the non-contact ranging information. There are a total of three ultrasonic sensors that are used in the project. These sensors are mounted on the rear tyre fork one on each side to cover the maximum field of view indicating the vehicles or obstacle’s that are approaching the bike.
GPS ultimate logger shield is used to track the whereabouts of the bike’s location and is interfaced with the Arduino UNO on the handlebar. All the coordinates will be logged on to the SD card.
The LEDs are also mounted on the back-tyre fork to indicate the left and right turnings at the time of ride so as avoid any accidents that can be caused due to overlooking.
The functional diagram of the project would be depicted as shown below where all the sensors are connected to the Arduino UNO and the LCD display takes the information from the Arduino and the sensors.
The Ultrasonic sensors are used to indicate an object that is approaching towards the vehicle. Three ultrasonic sensors are used in the project and are optimized such that a maximum field of view is obtained. The working of the three ultrasonic sensors is the same as explained in the background theory and all the three sensors are operated simultaneously to maintain perfect synchronization between sensors.
Architecture diagram:
#include <Wire.h>
#include <Adafruit_RGBLCDShield.h>
#include <utility/Adafruit_MCP23017.h>
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
#include <DHT.h>;
#define USE_ARDUINO_INTERRUPTS true
#include <PulseSensorPlayground.h>
#define I2C_ADDR 0x3F
#define RED 0x1
#define YELLOW 0x3
#define GREEN 0x2
#define TEAL 0x6
#define BLUE 0x4
#define VIOLET 0x5
#define WHITE 0x7
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
const int PulseWire = 0;
const int LED13 = 13;
int Threshold = 550;
PulseSensorPlayground pulseSensor;
int trigPin1=10;
int echoPin1=3;
int trigPin2=4;
int echoPin2=5;
int trigPin3=6;
int echoPin3=7;
int chk;
float hum;
float temp;
void setup() {
Serial.begin(115200);
pulseSensor.analogInput(PulseWire);
pulseSensor.blinkOnPulse(LED13);
pulseSensor.setThreshold(Threshold);
if (pulseSensor.begin()) {
Serial.println("We created a pulseSensor Object !");
}
dht.begin();
lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.setCursor(0,1);
lcd.setBacklight(WHITE);
pinMode(trigPin1, OUTPUT);
pinMode(echoPin1, INPUT);
pinMode(trigPin2, OUTPUT);
pinMode(echoPin2, INPUT);
pinMode(trigPin3, OUTPUT);
pinMode(echoPin3, INPUT);
}
uint8_t i=0;
uint8_t new_buttons=BUTTON_LEFT;
void loop() {
uint8_t buttons = lcd.readButtons();
if(buttons)
new_buttons=buttons;
hum= dht.readHumidity();
temp= dht.readTemperature();
long duration1, distance1;
digitalWrite(trigPin1, LOW);
delayMicroseconds(2);
digitalWrite(trigPin1, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin1, LOW);
duration1 = pulseIn(echoPin1, HIGH);
distance1 = (duration1/2) / 29.1;
long duration2, distance2;
digitalWrite(trigPin2, LOW);
delayMicroseconds(2);
digitalWrite(trigPin2, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin2, LOW);
duration2 = pulseIn(echoPin2, HIGH);
distance2= (duration2/2) / 29.1;
long duration3, distance3;
digitalWrite(trigPin3, LOW);
delayMicroseconds(2);
digitalWrite(trigPin3, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin3, LOW);
duration3 = pulseIn(echoPin3, HIGH);
distance3= (duration3/2) / 29.1;
if (new_buttons) {
lcd.clear();
lcd.setCursor(0,0);
if (new_buttons & BUTTON_UP) {
lcd.print("Humidity:");
lcd.print(hum);
lcd.setCursor(0,1);
lcd.print("Temperture:");
lcd.print(temp);
lcd.setBacklight(RED);
}
if (new_buttons & BUTTON_DOWN) {
lcd.clear();
lcd.setCursor(0,0);
lcd.print("S1");
lcd.print(distance1);
lcd.setCursor(7,0);
lcd.print("S2");
lcd.print(distance2);
lcd.setCursor(0,1);
lcd.print("S3");
lcd.print(distance3);
}
int myBPM = pulseSensor.getBeatsPerMinute();
if (pulseSensor.sawStartOfBeat()) {
Serial.println("♥ A HeartBeat Happened ! ");
Serial.print("BPM: ");
Serial.println(myBPM);
}
if (new_buttons & BUTTON_LEFT){
lcd.setCursor(0,0);
lcd.print("BPM:");
lcd.print(myBPM);
}
Serial.print ( "Sensor1 ");
Serial.print ( distance1);
Serial.println("cm");
Serial.print("Sensor2 ");
Serial.print(distance2);
Serial.println("cm");
Serial.print("Sensor3 ");
Serial.print(distance3);
Serial.println("cm");
}
}
Comments