0 Comments

Introduction:

By taking the help of modern engineering and technology, we have designed a better digital display system in which the fuel level of tank, gear and speed of bike are displayed in a LCD. This system notifies the bike rider about the current dynamic  parameters of bike.

Block diagram:

Components required

  1. Microcontroller
  2. LCD
  3. Transistor
  4. Resistor
  5. Capacitor
  6. LED
  7. Motor
  8. Wheel
  9. Hall sensor
  10. Magnetic float sensor


Working:

There is a magnetic float sensor situated inside the fuel tank. When the tank is full with petrol, the level of fuel is mentioned in display. When the level of fuel is low, rider has to fill up the tank at the nearest petrol pump. The gear lever contains two small pieces of magnets closer to two respective hall sensors. When we increase the gear by pressing the lever, the hall sensor sends an analogue signal to the microcontroller which changes the pulse width modulation(PWM) signal fed to the dc motor to increase its revolution per minute (rpm). Similarly when we lower the gear, the rpm of the motor decreases. There are four number of gears available and the percentage speed is divided in four parts accordingly. Gear 1 is associated with the lowest speed(25%) and Gear 4 is associated with the highest speed(100%).

Advantage:

This display system alerts the rider about his fuel availability as well as gear and speed level.

Microcontroller Code:

//Su-Din Technology   contact 9861004895.
//Speed control of bike with Hall sensor & float sensor.
#include <LiquidCrystal.h>
// initialize the interface pins
LiquidCrystal lcd(2,3,4,5,6,7);
int floatSensor=12;
int led=13;
int buttonState=1; //reads pushbutton status
const int hallAnalogPin0=A0;
const int hallAnalogPin1=A1;
const int led0 = 10;
const int led1 = 11;
int hallAnalog0;
int hallAnalog1;
int pwmPin=9;
int i;
int Gear=0; 
int Speed=0;
void setup() {
  Serial.begin(9600);
  lcd.begin(16, 2);
  pinMode(led0, OUTPUT);
  pinMode(led1, OUTPUT);
  pinMode(pwmPin,OUTPUT);
  analogWrite(pwmPin,i=255);
  pinMode(floatSensor,INPUT_PULLUP);
  pinMode(led,OUTPUT);
}

void loop() {
  buttonState=digitalRead(floatSensor);
  if(buttonState==HIGH){ //Yellow wire of float sensor upside
    digitalWrite(led,LOW);
    Serial.println("Fuel Level - HIGH");
    lcd.setCursor(7,0);
    lcd.write("Fuel-HIGH"); 
  }
  else{    
    digitalWrite(led,HIGH);
    Serial.println("Fuel Level - LOW");
    lcd.setCursor(7,0);
    lcd.write("Fuel- LOW"); 
      }
  // reading analog input at pin A0 for gear up
  hallAnalog0 = analogRead(hallAnalogPin0);
  // reading analog input at pin A1 for gear down
  hallAnalog1 = analogRead(hallAnalogPin1);
  Serial.print(" AnalogRead0:  ");
  Serial.println(hallAnalog0);
  Serial.print(" AnalogRead1:  ");
  Serial.println(hallAnalog1);
  Serial.print(" Gear:  ");
  Serial.println(Gear);
  lcd.setCursor(0,0);
  lcd.print("Gear:");
  lcd.setCursor(5,0);
  lcd.print(Gear);
  Serial.print(" Speed(%):  ");
  Serial.println(Speed);
  lcd.setCursor(0,1);
  lcd.print("Speed(%):       ");
  lcd.setCursor(10,1);
  lcd.print(Speed);
  
//For gear up  
    if(hallAnalog0 > 530){ 
      digitalWrite(led0, HIGH);
      delay(1000);
      digitalWrite(led0, LOW);
      Gear=Gear+1;
      Speed=Speed+25;
      
        if(Gear==1)  {
          analogWrite(pwmPin,i=120);
          delay(500);}
                           
 
        if(Gear==2)  {
          analogWrite(pwmPin,i=80);
          delay(500);}
        
        if(Gear==3)  {
          analogWrite(pwmPin,i=40);
          delay(500);}
                            
        if(Gear==4)  {
          analogWrite(pwmPin,i=0);
          delay(500);}
                             
          if(Gear>=4){
          Gear=4;  
          Speed=100; }                      
}

// For gear down
if(hallAnalog1 > 520) {
      digitalWrite(led1, HIGH);
      delay(1000);
      digitalWrite(led1, LOW);
      Gear=Gear-1;
      Speed=Speed-25;
      
        if(Gear==0)  {
          analogWrite(pwmPin,i=255);
          delay(500);}
                             
        if(Gear==1)  {
          analogWrite(pwmPin,i=120);
          delay(500);}
   
        if(Gear==2)  {
          analogWrite(pwmPin,i=80);
          delay(500);}
        
        if(Gear==3)  {
          analogWrite(pwmPin,i=40);
          delay(500);}
                             
        if(Gear==4)  {
          analogWrite(pwmPin,i=0);
          delay(500);}
                             
          if(Gear<=0) {
          Gear=0;
          Speed=0;    }
                       
 }
  delay(500);
}

Designer:
Er. Anil Kumar Prusty
Phone No. :- 9861004895

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts