GLCD-based digital car speedometer
Indicators in the dashboard of the car have always played and play an important role in the display of important indicators of the state of the vehicle. One of the important and installed in all cars is the speedometer – a device for displaying the speed of the vehicle.
Automobile speedometers installed in modern cars have a very attractive appearance, clearly and brightly display the readings in the dark. But what to do those whose car is an old production, and the speedometer leaves much to be desired in terms of perception of the information displayed?
The answer is simple – buy ready-made, but only for those who are not into electronics and do not like to make something with their own hands. That is why I decided to build a digital speedometer to replace the regular one in the car VAZ 2106 amateur friend.
Since I wanted the device to be modern and look nice, it was decided to use a modern element base and a graphic display to display information.
After a thorough and long review of articles on the internet the following main components were chosen for use:
A PIC18F2550 SOIC microcontroller – the “heart” of the speedometer, which performs all the necessary functionality.
The LM317 voltage regulator – a regulated voltage regulator, which is tuned to 10.5V, powers the backlight of the graphical display and the voltage regulator that powers the speedometer logic circuit.
Voltage regulator L1117 – voltage regulator with fixed voltage of 3.3V, which feeds the speedometer logic circuit.
Graphic LCD from Siemens S65 (LS020) – used to display all the information provided by the microcontroller.
A detailed list of components is presented in the board design and circuit diagram files in Diptrace format.
When designing the device, we wanted to add additional functions that would be of interest to the motorist, and which were not in the original speedometer:
Display of vehicle’s onboard voltage
Displays vehicle acceleration
Display car acceleration time from 0 to 100 km/h
The speedometer is capable of showing:
Speed from 0 to 255 km/h accurate to 1 km/h
On-board voltage in the range of 0 to 16 V accurate within 0.01 V
Vehicle acceleration from 0 to 255 m/s 2 with resolution up to 0.01 m/s 2
Acceleration time up to 100 km/h 0 to 255 s accurate within 0.1 s
Speedometer is powered from the car’s onboard 12 V network
To get information about the speed of the car in the gearbox was installed speed sensor from a car VAZ 2110, which is designed on the principle of the effect of Hall and is designed to convert the frequency of rotation of the drive shaft in the frequency of electrical impulses.
The speed sensor is directly connected to the speedometer board. In order to connect the sensor to the speedometer, the contacts must be oriented correctly:
The sensor outputs 6 pulses per meter traveled.
The signal from the sensor is digital and is in the form of pulses, which allows us to count these pulses in equal time intervals.
The pulse counting is based on the fact that the signal from the speed sensor comes to the port of the microcontroller configured for external interrupt operation. In the external interrupt handler the number of pulses is counted equal to the number of interrupts for a certain time interval, which is counted by the internal timer of the microcontroller.
The microcontroller itself runs at 48 MHz from a 20 MHz quartz resonator. Such a powerful controller and run at such a high clock frequency is not a coincidence. To display information quickly on the graphical LCD you need a fast output and that is what the PIC18F2550 Microcontroller was chosen for.
The calculated speed is displayed on the graphic LCD.
Based on the calculated current speed, other values such as acceleration and acceleration time to 100 km/h are calculated and also displayed on the graphic LCD.
The on-board supply voltage is fed to the ADC of the microcontroller through a divider, so that the voltage supplied to the contact of the microcontroller does not exceed the supply voltage (3.3V). The voltage is measured at equal time intervals, measured by one of the timers of the microcontroller. The measured voltage is processed and displayed on the graphic LCD.
Thus, we get on the screen of the digital speedometer full information about the character of the vehicle movement, as well as additional information about the state of the battery.
Schematic diagram of speedometer
The microcontroller program is written in the CCS PICC language. We used the MPLAB 8.66 development environment to write the project for the microcontroller program.
Case and installation
The speedometer board is made of double sided foil laminated textolite. Both sides are connected to each other with transition holes.
A picture of the digital speedometer board from both sides:
The board and the screen were installed in the case of the original VAZ 2106 speedometer. The OEM speedometer housing with the digital speedometer board was installed in the dashboard in its place.
Below is a picture of the car digital speedometer.
I want to thank the users of eletronix.ru forum for sharing their experience with Siemens S65 LCD.
Microchip PIC18F2550 microcontroller specifications
Vaz 2110 speed sensor datasheet
CCS PICC help language
Embedded C programming and the Microchip PIC – Richard Barnett, Larry O’cull, Sarah Cox, 2004
Arduino digital speedometer for car or motorcycle and electronic odometer with your own hands
An electronic speedometer assembled with your own hands will have three modes:
- Speedometer (determination of speed) and odometer (distance traveled)
- Task 1 – to go 32 km (20 miles)
- Task 2 – reach a speed of 30 km/h
The speedometer is assembled on Arduino, so there is no limit to your imagination.
Step 1: How it works
The principle of the project is simple, but you need to understand it to assemble it. At its simplest, it consists of a reed switch or magnetic switch mounted on the frame of the bike and another magnet mounted on the spoke of the wheel.
As the wheel rotates, the magnet activates the switch each time it rotates. The signal goes to the Arduino, which counts the number of revolutions and uses them to determine the distance covered (you will need to specify the diameter of your wheel first). The Arduino also monitors the time and calculates the speed. The data is shown on the display, where it is displayed in miles per hour (or kilometers if you refine the formula).
Step 2: Materials needed
The project is inexpensive and can cost you 300-700 rubles. Assembly will require some skills in soldering. Materials for the assembly:
- Arduino board – if you take the Arduino Pro Mini, you will also need an Arduino Uno or usb-ttl adapter for programming (how to program the Arduino Pro Mini via Arduino Uno) or use Arduino Micro or Arduino Uno.
- Arduino 16×2 display
- 3.7805 voltage regulator (no major difference -optional)
- 2x switch for backlight (optional)
- 220 ohm resistor
- Potentiometer for 10k ohm
- Mom and Dad jumper if you want the reed switch to be removable
- Reed switch
- Momentary switch to change modes
- 0.1uf capacitor to reduce the button’s dibaunce
- 10k ohm resistor
List of tools needed:
- Soldering iron
- Something like a dremel to cut holes in the case for mounting the electronics and display
- Hot glue or something similar to hold the components in place.
Step 3: Code
Before we get to the electronics, it’s a good idea to download the code so you don’t have the embarrassment of tossing and turning between wires that aren’t connected correctly. Upload the code to the Arduino, remembering to specify the wheel diameter of your bike before doing so.
Step 4: Electronics
The component wiring diagram is attached above, but I will also write it separately.
- 1 GND
- 2 VCC
- 3 VIPER PIN on the potentiometer (the ends to vcc and gnd and the center to pin 3 of the display)
- 4 13
- 5 gnd
- 6 12
- 7 —
- 8 —
- 9 —
- 10 –
- 11 11
- 12 10
- 13 9
- 14 8
- 15 VCC
- 16 GND
- Connect a 220 ohm resistor between pin 2 of the Arduino and ground
- Connect the momentary switch to pin 2 and vcc
- Place a 0.1 uf capacitor between the two terminals of the switch to reduce the dibaunce
- A reed switch on vcc and A0
- A resistor between A0 and gnd
After connecting all the components you can power the device and check that everything works.
Step 5: the case
The enclosure can be made of plastic or wood and should be sturdy and have enough space. After installing the switches, screen, button, and headers, test the device to make sure it works. Try to make the device watertight, because it will be in the worst possible conditions for operation.
Step 6: Testing and Troubleshooting
Power the device with a 9V battery and test all three modes. Bring the magnet close to the reed switch and the speed and distance should start to increase.
I am telling you how to make something with step by step pictures and video instructions.