Coder Social home page Coder Social logo

daniel-collins97 / speeduino Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 28.34 MB

Repo holding all relevant files for my "Speeduino" Project for module Project Semester 2 of my I.O.T degree

Home Page: https://daniel-collins97.github.io/Speeduino/

Arduino 100.00%
speedometer bike hall-effect-sensor arduino

speeduino's Introduction

Project Proposal for semester 2

Title: Bike Speedometer

Description: For my Digital Bike Speedometer, i have a Hall Effect Sensor connected to an LCD screen. The Hall Effect sensor should be connected to a static position on a bike near the wheel. Then, a Magnet should be attached to the wheel. When the magnet passes the Sensor, a value of High is received by the Arduino. The Code then uses the wheels diameter and the amount of revolutions to determine the speed and distance travelled of the bike. Then, it will print these values to the LCD screen.

Image of project

Equipment needed:

  • Arduino
  • Hall Effect Sensor
  • Magnet
  • LCD screen (16x2)
  • Power Source (7V-12V battery)
  • Battery Connector
  • 2 way switch
  • Breadboard
  • Wires
  • Function for calculating Speed and Distance (code)

Other Practical Skills needed: Programming, Soldering, Web Development, Wiring, Digital Electronics, Math.

This is the code that updates the Speed and Distance variables for my project;

void updateSpeedAndDistance()
{
  distance = tire_circumference * revolutions;
  distance /= miles_in_inches;
  float ipm = tire_circumference / (float)last_interval;
  mph = ipm * k_ipm_2_mph;
}

This is the code that prints the values to the LCD Screen;

void loop()                                                  // Continuously loops over following code to update the variables "mph" and "distance"
{
  int hall_val = digitalRead(2);
  if (hall_state != hall_val && hall_val == LOW)
  {
   revolutions++;
   last_interval = millis()-last_fall;
   last_fall = millis();
 }

 hall_state = hall_val;
 updateSpeedAndDistance();                                   // Calls "updateSpeedAndDistance" function here

 lcd.setCursor(0, 0);                                        // Sets Cursor to first row first column
 lcd.print("Mph:");                                          // Prints "Mph" on screen
 lcd.print(mph);                                       // Prints value for Mph on screen
 lcd.setCursor(0, 1);                                        // Sets Cursor to first row second column
 lcd.print("Miles:");                                        // Prints "Miles" on screen
 lcd.print(distance);                                        // Prints value for distance on screen
}

Daniel Collins 20076240

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.