The reed switch and a magnet need to be fixed on the front wheel of the motor bike (Hero Honda’s Splendor). A small circular magnet (about 2 cm in diameter), normally used in speakers of small toys, can be used. Fix the magnet to the central drum of the wheel just below the spokes connected to the drum. Secure the magnet using hot glue or Araldite.
For fixing the reed switch, a PVC pipe contraption needs to be made so that the magnet and reed switch are aligned as shown in Fig. 3. The materials required to build the contraption are shown in Fig. 4. Cut a 3.2cm diameter PVC pipe measuring 15.2 cm in length perpendicularly into two halves. Use only one half of the PVC pipe. Mount and secure the reed switch using Araldite and cable ties on the plastic handle (normally used in emergency lights). Once it dries up, solder two wires to the two opposite end leads of the reed switch. Fix the plastic handle on the half cut PVC pipe using screws. Now, place the pipe on the front shock-absorber fork such that reed switch faces towards the magnet.
Connect a multimeter, set in continuity mode, to the two wires coming from the reed switch. Rotate the wheel slowly and see whether the reed switch closes when the magnet passes across it. If it does, the multimeter will give a continuity beep. When the magnet moves away from the reed switch, the beep will stop, indicating that the reed switch is open. Make a few trials to find the optimal position for mounting and fixing the PVC pipe such that the reed switch works smoothly. Mark the location on the front shock-absorber fork.
Now you can fix the PVC pipe contraption to the shock-absorber fork using hot glue as shown in Fig. 5. Use liberal amount of hot glue to secure it to the pipe. Carefully route the two wires up to the bike’s handle bar using cable ties to secure the wire. This completes the sensor mounting part.
The main circuit and the LCD module can be housed in suitable plastic enclosures, which are readily available in electronic projects shops. These enclosures should have precut slot for easy mounting of the LCD panel. If such boxes are not available, you can use the plastic boxes of electronic chokes by suitably removing some portions for the LCD panel.
Power supply can be taken either directly from the bike’s 12V battery or tapped from the console which houses horn, headlight and indicator light switches. For this, you need to remove the switch console and identify positive wire and ground wire using a multimeter. When carrying out this step, remember to turn the ignition key to ‘on’ position. Solder a 60cm two-core wire to the positive and negative terminals inside the switch console. The advantage of taking supply from the switch console is that the ignition key controls the power supply to the main unit without having a separate on-off switch.
An actual-size, single-side PCB layout of the microcontroller based speedometer-cum-odometer is shown in Fig. 7 (View as PDF), and its component layout in Fig. 8 (View as PDF).
Download PCB and component layout PDFs (Fig. 7, 8) : click here
After all the components are soldered on the PCB, program the microcontroller with Init_EEPROM.hex file and place the microcontroller in a 20-pin IC base and switch on the circuit.
In the first line of the LCD, ‘INIT_EEPROM’ appears. After five seconds, ‘00000.0’ is displayed in the second line. This process erases any previous data and sets the initial readings in the EEPROM to zero. Now switch off the supply and program the microcontroller with ‘speedo.hex’ main file. After programming, place the microcontroller back in the circuit and switch on the supply. The LCD will show ‘Kms: 00000.0’ in the first line and ‘Speed- Kms/ Hr: 00.0’ in the second line. Now, the unit is ready to mount on your bike.
Connect the two wires coming from the reed switch and the power supply wires to the main unit. Mount the unit at the centre of the bike’s handle bar on top of the ‘U’ clamps that secure the handle bar to the chassis. You can use cable ties to accomplish this. Mounting arrangement of the unit is shown in Fig. 6.
Now start the bike, take a test ride and if connections are correct, the speed and the distance will be displayed on the LCD. A protective cover like polythene can be used for the main unit on rainy days.
Download source code: click here