DIY Speedometer using Arduino and Processing Android App
Yes, you can also use this as a power bank for your mobiles on the go as the 18650 has high charge density and can easily be charged and discharged. and tested. The cool feature here is that you can customize your android app for your personalisation and add more features according to your creativity. But, if you do not want to build the app by yourself and just build the Arduino part then no worries, just download the APK file (read further) and install in your Android mobile phone. Also check the full Video at the end. So let’s see what materials we would need to build this project, and plan our budget. All these components are easily available; if you have trouble buying any of these let me know in the comment section.Hardware Requirements:
Arduino Pro Mini (5V 16MHz) FTDI board (for programming mini you can also use UNO) 3V to 5V DC-DC Boost converter with USB output charger TP4056 Lithium battery Module Bluetooth Module (HC-05/HC-06) Hall effect sensor (US1881/04E) 18650 Lithium Cell Small piece of magnets Perf Board Berg sticks connectors (Male and Female) Soldering Kit Small enclosure boxes to mount the kit.Programming Requirements:
Arduino IDE Processing IDE with android ADK (Only if you want to code your own app.) Windows/Mac PC Android Mobile Phone. It might look like a handful of components and materials, but trust me once you complete this project you would feel they are worth the time the effort.Measuring Speed using Hall Sensor and Arduino:
To measure the speed we have to stick a small piece of magnet onto the wheel of the vehicle, each time the magnet crosses the hall sensor it will detect it and sends the information to the Arduino. An interrupt will be received by the Arduino each time the magnet is detected. We run a continuous timer by using millis() function and calculate the time taken for the wheel to complete two rotations (to minimise error) by using the below formulae: Timetaken = millis() ᾠpevtime; Once we know the time taken we can calculate the rpm by using the below formulae: rpm = (1000/timetaken) * 60; Where (1000/timetaken) gives the rps (Revolutions per second) and it is multiplied by 60 to convert rps to rpm (Revolutions per minute). After calculating the rpm we can calculate the velocity of the vehicle using the below formulae provided we know the radius of the wheel. v= radius_of_wheel * rpm * 0.37699;Schematics and Hardware Part:
The complete Circuit diagram of the project is given below: This module has over charge/discharge protection and Reverse polarity protection. Hence the battery can be easily charged using a normal micro USB charger and can be safely discharged till it reaches the under voltage cut off limits. Some important details of the TP4056 charge module is given in the table below.
2.4V | |
4.2V | |
1A | |
Over Voltage and reverse polarity protection | |
TP4056 (charger IC) and DW01 Protection IC | |
Red- Charging in Progress Green ᾠCharge Complete |
5v | 5v |
GND | GND |
Digital Pin no. 36 | DI (data in) |
RMC | Recommended Minimum sentence C |
HHMMSS.SSS | Time in hour minute seconds and milliseconds format. |
A | Status // A=active and V= void |
Latitude | Latitude 49 deg. 16.45 min. North |
N | Direction N=North, S=South |
Longitude | Longitude(Coordinate) |
E | Direction E= East, W=West |
Speed | speed in knots |
Angle | Tracking angle in degrees |
Date | DATE in UTC |
MV | Magnetic Variation |
W | Direction of variation E/W |
CMD (*6A) | Checksum Data |
$GPGGA | Global Positioning system fix data |
HHMMSS.SSS | Time in hour minute seconds and milliseconds format. |
Latitude | Latitude (Coordinate) |
N | Direction N=North, S=South |
Longitude | Longitude(Coordinate) |
E | Direction E= East, W=West |
FQ | Fix Quality Data |
NOS | No. of Satellites being Used |
HDP | Horizontal Dilution of Precision |
Altitude | Altitude (meters above from sea level) |
M | Meter |
Height | Height |
Checksum | Checksum Data |
RMC | Recommended Minimum sentence C |
HHMMSS.SSS | Time in hour minute seconds and milliseconds format. |
A | Status // A=active and V= void |
Latitude | Latitude 49 deg. 16.45 min. North |
N | Direction N=North, S=South |
Longitude | Longitude(Coordinate) |
E | Direction E= East, W=West |
Speed | speed in knots |
Angle | Tracking angle in degrees |
Date | Time stamp (Date in UTC) |
MV | Magnetic Variation |
W | Direction of variation E/W |
CMD (*6A) | Checksum Data |
$GPGGA | Global Positioning system fix data |
HHMMSS.SSS | Time in hour minute seconds and milliseconds format. |
Latitude | Latitude (Coordinate) |
N | Direction N=North, S=South |
Longitude | Longitude(Coordinate) |
E | Direction E= East, W=West |
FQ | Fix Quality Data |
NOS | No. of Satellites being Used |
HPD | Horizontal Dilution of Precision |
Altitude | Altitude from sea level |
M | Meter |
Height | Height |
Checksum | Checksum Data |
S.no. | Message | Operation |
1 | #A.fan on* | Fan ON |
2 | #A.fan off* | Fan OFF |
3 | #A.light on* | Light ON |
4 | #A.light off* | Light OFF |
5 | #A.tv on* | TV ON |
6 | #A.tv off* | TV Off |
7 | #A.all on* | All ON |
8 | #A.all off* | All OFF |
Stop | 0 | 0 | 0 | 0 | Stop |
Forward | 0 | 0 | 0 | 1 | Forward |
Backward | 0 | 0 | 1 | 0 | Backward |
Right | 1 | 0 | 0 | 1 | Right |
left | 0 | 1 | 0 | 1 | Left |
analogRead(pin); analogReference(); analogReadResolution(bits); |
analogWrite(3,VALUE); |
Serial.begin(9600); receiveddata = Serial.read(); |
analogWrite(9,VALUE); |
analogRead(pin); analogReference(); analogReadResolution(bits); |
analogWrite(3,VALUE); |
analogRead(pin); analogReference(); analogReadResolution(bits); |
#include <Servo.h> Servo servo; servo.attach(3); servo.write(degrees); |
#include "LedControlMS.h" #define NBR_MTX 1 LedControl lc=LedControl(4,3,2, NBR_MTX); lc.writeString(0,"CIRCUITDIGEST"); lc.clearAll(); |
analogRead(pin); analogReference(); analogReadResolution(bits); |
analogWrite(3,VALUE); |
#include <Adafruit_BMP085.h> #include <Wire.h> #include <LiquidCrystal.h> Serial.begin(9600); String PRESSUREVALUE = String(bmp.readPressure()); String TEMPARATUREVALUE = String(bmp.readTemperature()); |
L | L | Red |
L | H | Blue |
H | L | Clear (no filter) |
H | H | Green |
L | L | Power Down |
L | H | 2% |
H | L | 20% |
H | H | 100% |
Int frequency = pulseIn(10, LOW); |
#include <Keypad.h> const byte ROWS = 4; // Four rows const byte COLS = 4; // Three columns // Define the Keymap char keys[ROWS][COLS] = { {'1','2','3','A'}, {'4','5','6','B'}, {'7','8','9','C'}, {'#','0','*','D'} }; // Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins. byte rowPins[ROWS] = { 0, 1, 2, 3 }; // Connect keypad COL0, COL1 and COL2 to these Arduino pins. byte colPins[COLS] = { 4, 5, 6, 7 }; // Create the Keypad Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); char key = kpd.getKey(); |
analogRead(pin); analogReference(); analogReadResolution(bits); |
/* Now since the default reference if 5V and resolution is 10bit so for every 5/1024 = 5mV, we get one increment is count, The sensor provides increment voltage of 1.3V for every 1Gauss increment if field. So we need to divide ADC value by 3.76 for getting the gauss value, now the 0 gauss output of sensor is 2.5V so we need to subtract that first. To hold a 0V read at 0Gauss field. */ |
Serial.begin(9600); data = Serial.read(); |
#include <Servo.h> Servo sg90servo; Sg90.attach(servo_signal_pin_attached_to); Sg90.write(needed_position_ angle); |
pinMode(ledPin, OUTPUT) analogWrite(pin, value) |
pinMode();
shiftOut(dataPin, clockPin, data); |
Less 26 | 0% | 0 | Off |
26 | 20 % | 51 | 20% |
27 | 40% | 102 | 40% |
28 | 60% | 153 | 60% |
29 | 80% | 204 | 80% |
Greater 29 | 100% | 255 | 100% |
Movement of hand | Input for Arduino from gesture | ||||
Stable | 0 | 0 | 0 | 0 | Stop |
Tilt right | 0 | 0 | 0 | 1 | Turn Right |
Tilt left | 0 | 0 | 1 | 0 | Turn Left |
Tilt back | 1 | 0 | 0 | 0 | Backward |
Tilt front | 0 | 1 | 0 | 0 | Forward |
Input Commands | Output | Movement of Robot | ||||
Left Motor | Right Motor | |||||
S. | Stop | |||||
Turn Right | ||||||
Turn Left | ||||||
Backward | ||||||
Forward |
LS | RS | LM1 | LM2 | RM1 | RM2 | |
0 | 0 | 0 | 0 | 0 | 0 | Stop |
0 | 1 | 1 | 0 | 0 | 0 | Turn Right |
1 | 0 | 0 | 0 | 1 | 0 | Turn Left |
1 | 1 | 1 | 0 | 1 | 0 | Forward |
1 | Supply voltage; 5V (+35V to -2V) | Vcc |
2 | Output voltage (+6V to -1V) | Output |
3 | Ground (0V) | Ground |
High | Low | High | Turn Right |
High | High | Low | Turn Left |
High | Low | Low | Stop |
High | High | High | Stop |
pinMode(ledPin, OUTPUT) analogWrite(pin, value) analogWriteResolution(neededresolutionnumber) |
analogRead(pin); analogReference(); analogReadResolution(bits); |
#include <LiquidCrystal.h> lcd.begin(16, 2); LiquidCrystal lcd(0, 1, 8, 9, 10, 11); lcd.print("hello, world!"); |
NiCd | -20 | 60 | 1.2 | 20 | 800 | Heavy |
NiMH | -20 | 70 | 1.2 | 30 | 500 | Middle |
Low Self Discharge NiMH | -20 | 70 | 1.2 | 1 | 2000 | Middle |
Li-ion (LCO) | -40 | 70 | 3.6 | 10 | 1000 | Light |
Li-ion (LFP) | -40 | 80 | 3.2 | 5 | 12000 | Light |
LiPo (LCO) | -40 | 80 | 3.7 | 10 | 1000 | Lightest |
Li-Ti (LTO) | -40 | 55 | 2.4 | 5 | 20000 | Light |
LMO | - | 85 | 3.7 | - | 700 | Heavy |
Lithium Nickel Manganese Cobalt Oxide (LiNiMnCoO2) ᾠNMC | |||||
2.40V | 3.70V | 3.30V | 3.70V | 3.70V | |
Typical operating range | 1.8Vᾲ.85V | 3.0Vᾴ.2V | 2.5Vᾳ.65V | 3.0 Vᾴ.2V | 3.0 Vᾴ.2V |
50Ᾰ0Wh/kg | 150ᾲ20Wh/kg | 90ᾱ20Wh/kg | 200-260Wh/kg | 150ᾲ00Wh/kg. | |
1C typical; 5C maximum, charges to 2.85V | 0.7ᾱC, charges to 4.20V | 1C typical, charges to 3.65V | 0.7C, charges to 4.20V, fast charging possible with some cells | 0.7ᾱC, charges to 4.20V | |
10C possible, 30C 5s pulse | 1C, 2C possible on some cells | 1C, 25C on some cells | 1C | 1C | |
3,000ᾷ,000 | 1000ᾲ000 | 5000-7000; up to 12000 possible in some cells | 500 | 500ᾱ000 | |
200°C + | 210°C (410°F) | 270°C (518°F) | 150°C (302°F) | 150°C (302°F) | |
~$1,005 | ~$420 per | ~$580 | ~$350 | - | |
Electric vehicles, UPS, etc | E-bikes, E-Rikshaw, industrial equipment, etc | E-bikes, E-Rikshaw, Battery Energy storage system for discoms, offices and homes | Medical devices, industrial equipment, electric vehicles | Smart watches, mobile phones, tablets, laptops, cameras |
Super Capacitor | Battery | |||
Placement | Inside | Outside | Inside | Outside |
Sp3-37 | 1.3uW/sec | 237uW/Sec | - | - |
Dual Solar panel | 2.1mW/sec | - | 5.6mW/sec | 135.5mW/Sec |
Channels | 6 |
RF range | 2.4055 ᾼU+393C> 2.475 GHz |
Bandwidth | 500KHz |
Band | 140 |
RF Power | Less than 20dBm |
2.4G system | AFHDS 2A and AFHDS |
Sensitivity | 1024 |
Low voltage warning | Less than 4.2V |
DSC Port | PS2 |
Output | PPM |
Charger Point | No |
ANT length | 26mm*2 (dual antenna) |
Weight | 392gm |
Power | 6V 1.5AA*4 |
Display mode | Transflective STN positive type 128*64 dot matrix |
Size | 174*89*190 mm |
On-line update | Yes |
Certificate | CE0678, FCC |
Channels | 6 |
RF range | 2.4055 ᾠ2.475 Hz |
Band | 140 |
RF Power | Less than 20dBm |
2.4G system | AFHDS 2A |
ANT length | 26mm*2(dual antenna) |
weight | 16.4g |
Power | 4.0-6.5V |
Size | 42.6*26.1*15.1mm |
RX Sensitivity | -105dBm |
Certificate | CE0678, FCC |
i-Bus port | Yes |
Data acquisition port | Yes |
Input Voltage (DC) | 4.8V ᾠ6.0V | 4.8V-15.0V | MC- 4.8V-5.5V VU-7.2V-26.0V | 12V ᾠ16V | 7V | MC:4.8V~5.5V VU Input: 7.4V ~ 26.0 V |
Processor | Atmel 644PA 8 bit AVR | STM 32bit with 28 kb flash & 20kb RAM | ----------------- | ATMEGA2560, ATMEGA32U-2 | 32bit STM32F427 Cortex M4 | ------------------- |
Sensors | 6050 MCU (acc & gyro ) | Acc & gyro sensor | Acc, gyro, Barometer, Magnetometer | Acc, gyro, Barometer, | Acc, gyro, Barometer, magnetometer | Acc, gyro, Barometer, Magnetometer |
Programmer | Not Required (Tune by buttons on it) | Required | Required | Required (Arduino Compatible) | Requires (supports Linux/Unix) | Required |
Type of Copter | 2,3,4,5,6,7,8 | 4,6 | 4,6 | 4,6 | 4,6 | 4,6,8 |
Telemetry (Ext) | No | No | Yes | Yes | Yes | Yes |
Gimbal | Yes (except octa copter) | Yes (for quad & hex only) | Yes (for quad & hex only) | Yes | Yes | Yes |
PC Required | No | Yes | Yes | Yes | Yes | Yes |
Weight (gm) | 26 | 25 | MC: 25, VU: 20 | 82 | 40 | MC:27g PMU:28g |
Firmware | Pre-installed | Open Pilot | DJI NAZA | Ardu copter | Mission Planner | DJI NAZA |
GPS (Ext) | No | Yes | Yes | Yes | Yes | Yes |
Pin Density Ratio | PCBs layer(s) |
more than 1.0 | 1 |
0.6-1.0 | 1 or 2 |
0.4-0.6 | 4 |
0.3-0.4 | 4 or 6 |
0.2-0.3 | 8 or 10 |
Less than 0.2 | 10 or 12 or 14 |
Dark image on light background | Light image on Dark Background |
Front and rear polarizers are perpendicular to each other | Front and rear polarizers are aligned to each other |
Used in areas with high ambient light, the backlight can also be used. | Used in areas with low ambient light, hence the backlights are often used. |
Background can be of multiple colours | Pixels can be of multiple colours |
Can be used in any display technique | Only possible with transmissive display |
Brightness | Size | Inverter required | Power consumption | Durability | Life (in hours) | |
Medium | Small | No | Low | High | 100,000 | |
High | Medium | No | High | Low | 10,000 | |
Low | Small | Yes | Low | High | 15,000 | |
High | Medium | Yes | Medium | 60,000 | ||
Medium | Small | No | High | High | 100,000 |
, the display is illuminated through backlight, embedded in the display | , an outside source of light is used for illumination of the display | , can be illuminated through a backlight or the outside ambient lighting |
Contrast is better than transreflective polarizer but not as good as reflective polarizer | It has the highest contrast ratio | Contrast is not as sharp as the reflective polarizer |
Without a backlight it is difficult to be read | Backlighting is not possible due to an opaque reflector | It can be used with or without a backlight |
Consumes highest energy | Consumes lowest energy | Consumes low energy when backlight is turned off. |
Passive Display | Active Display | |||
Twisted Nematic (TN) | STN | FSTN Film Super-twisted nematic | TFT Display | |
Cost | Low | medium | High | Very High |
Viewing angle | Low | Medium | High | Very High |
Contrast sharpness | Low | Medium | High | Very High |
Power Consumption | Low | Medium | High | High |
Operation temperature range | -10 to 60 C | 0 to 50 C | 0 to 50 C |
Static Drive | Multiplex Drive | |
Segment pins | Individual pins for all segments | Multiple segments can have the same pins |
Common pin | Only one common pin in the LCD | Multiple common pins |
Complexity of operation | Easier to operate | Complex to operate |
Most optimum application | Optimum for LCDs with few segments | Optimum for LCDs with a large number of segments |
Operating voltage | Single operating voltage | Multiple operating voltages |
Contrast Ratio | Better contrast ratio than multiplex drive | Lower contrast ratio than the static drive |
Elastomer connection or Zebra strip | Silicon Strips of alternate conductor and insulator. Fast assembly and disassembly. Preferable to use in an environment with high vibrations, but are not suitable for harsh environments. Yields higher conduction than pins Requires a specialized compression bezel Minimum contact patch 0.5mm |
Pins | Attached directly to the display. Easiest to work with during product. prototyping or production of smaller batches. Provides excellent protection from a harsh environment with vibrations and shock. Have the lowest number of interconnects per inch. Minimum contact patch 1.5mm |
Flat Flex Cable | PCB and LCD are connected by flex cable using heat and pressure. Suitable for harsh environmentsand offer better protection to breakage due to external stress. A high density of contact points. Not suitable for smaller costs as initial setup cost is high. Minimum contact patch 0.28mm |
Chip on board or surface mounted device | PCB is mounted behind the glass. It can contain extra circuits of the product in addition to the LCD circuitry. Connections have to be designed on the display. Higher designing cost and higher cost due to extra components. Complex assembly process. |
Chip on glass | Utilises the LCD glass to have the driver circuit, thus reducing the size. The COG LCD is connected to other circuits with above-mentioned LCD connection methods. All connections such as a driver and ICs are present on the display. Lower designing cost and lower cost of parts. Simple assembly process. |