Summary of Electronic Distance Meter using pic microcontroller
This article describes a battery-operated bicycle distance meter using a Nitron 68HC908QY4 microcontroller and a 16x1 LCD. The device measures distance by detecting wheel rotations via a reed switch and a rare earth magnet, displaying results in meters.Parts used in Bicycle Distance Meter:
- Nitron 68HC908QY4 16-pin MCU
- 16x1 line LCD module
- Rare earth magnet
- Reed switch sensor
- 0.1uF decoupling capacitor
- 16-pin SIP socket for LCD connector
- +5.1V zener diode
- Battery (9V or 1.5V x 3 AA)
- Small phone jack connectors
| Figure 1: Prototype of Distance Meter. |
This project demonstrates the use of 16x1 line LCD module to interface with Nitron 16-pin MCU, 68HC908QY4. The original idea came from one evening I went out with my son to the park near my home in Korat. The park has a nice walking way for people to exercise. I was wondering how long the distance is? I thought it would be nice if we know distance for one round.

Hardware Schematic
The MCU uses internal oscillator, internal reset, so we need only to supply the +VDD and VSS. I put the decoupling cap 0.1uF to VDD and VSS. Interface signals for LCD are D4-D7, RS and E. It was 4-bit interfacing, no BUSY checking. The LCD connector is 16-pin SIP socket. D0-D3 is not used, so we must tie to GND. Also R/W# was tied to GND. Since we can not check BUSY bit, so the delay routine must be used to wait LCD ready for command and data writing.

For more detail: Electronic Distance Meter
Quick Solutions to Questions related to Bicycle Distance Meter:
-
How does the device measure distance?
It uses a reed switch as a sensor and a rare earth magnet tied to the wheel; detection occurs when the magnet is close to the switch. -
Can I use a 9V battery for power?
Yes, you can use a +9V battery or three 1.5V AA batteries to power the circuit. -
What happens if the supply voltage drops to +3V?
The circuit can still run properly even when the supply drops to +3V. -
Does the LCD interface require BUSY checking?
No, the project uses 4-bit interfacing without BUSY checking, requiring delay routines instead. -
Which pins are unused on the LCD connector?
D0-D3 are not used and must be tied to GND, while R/W# is also tied to GND. -
What type of oscillator does the MCU use?
The MCU uses an internal oscillator and internal reset, needing only VDD and VSS connections. -
Why should care be taken if using ADC?
Care is needed because the VREF is the same as VDD when using the analog input feature.
Related projects
Determine capacitance by measuring the charging time using PIC16F688
When TEST botton is pressed, RA3 pin is set to "1". R2 and R3 are divide the voltage to 1/2 Vra3 which...
Meters & Test InstrumentsFrequency Meter Using Microcontroller
This tutorial simply states how to calculate frequency of a pulse source using a microcontroller. Story https://youtu.be/NAoj-HLRIro This tutorial simply states how...
Meters & Test Instruments · PIC16F84ADigital thermometer with PIC16F84 circuit
This electronic project is a very simple thermometer that is based on the PIC16F84A microcontroller, designed by Microchip. Why to use a...
Meters & Test InstrumentsProjects on Speed Checker To Detect Rash Driving On Highways
While driving on highways, drivers should not exceed the maximum speed limit permitted for their vehicle. However, accidents keep on occurring due...
Meters & Test InstrumentsDigital Ammeter circuit using pic microcontroller
In this project we have a tendency to design a circuit to build an electronic voltmeter while not making use of any...
Meters & Test InstrumentsTampered Energy Meter Monitoring Conveyed to Control Room by GSM with User Programmable Number Features
The main concept of this project is to reduce the power theft by using an integrated energy meter such that whenever an...