I will show you how to build a bike speedometer. It shows your speed,
the average speed,the temperature, the trip time and the total distance. You can change it using the button. Additionally, the speed is shown on a tachometer. I built it because I like building new things, I have not found anything like this on the internet so I want to show you how to build a good speedometer as the one on my bike is not as cool as I want π . So letβs get started.
Step 1: Parts:
This is a list of parts that you will need. They cost me about $ 40 but I bought them in Poland.
-arduino
-bike with reed switch
-LCD display 16Γ2
-servo
-breadboard
-thermometer DS18B20
-resistor 1.2k Ξ© , 4.7k Ξ©
-switch
-button
-potentiometer 10 kΞ©
-9V battery
-cables
-box
-tools (drill, soldering, knife, tape)
Step 2: Connection
I added a picture from Fritzing and verbal description of how to connect it. In the picture all red wires are connected to 5V, all blue cables are connected to GND.
- LCD display:
VSS β> GND Arduino
VDP β> 5V Arduino
VO β> output potentiometer (potentiometer VCC -> 5V Arduino, potentiometer GND -> Arduino GND).
RS β> pin 12 Arduino
RW β> GND Arduino
E β> pin 11 Arduino
D4 β> pin 5 Arduino
D5 β> pin 4 Arduino
D6 β> pin 3 Arduino
D7 β> pin 2 Arduino
A β> 5V Arduino
K β> GND Arduino
- Servo:
VCC β> 5V Arduino
mass β> GND Arduino
Data β> pin 6 Arduino
- Thermometer:
VCC β> 5V Arduino
mass β> GND Arduino
Data β> pin 1 Arduino
data and power is connected via a 4.7 kΞ©resistor
- Sensor on wheel:
one end -> 5V Arduino
second end -> A0 Arduino and resistor 1,2 kΞ©
The other end of the resistor to ground in the Arduino
- Button:
one end β> 5V Arduino
second end β> A1 Arduino
Step 3: Upload code:
Below I added the code in comments there is an explanation.
links to the download libraries:
http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip
https://github.com/milesburton/Arduino-Temperature-Control-Library
If you have a different wheel diameter you have to change it. You can calculate it with this formula:
circuit = Ο*d*2,54 (d=diameter of your wheel, I multiplied it by 2.54 to get the result in meters).
For more detail: DIY bike tachometer