online marketing
Engineering Electronic Projects | Project for Final Year

Become a Fan



Twitter


Follow us
on Google+


Submit your site to the Hotvsnot.com web directory! Find sites like this in the Electronics Directory

Downloads

Referers

Last Referers
world-ed.jw.lt
mobileozozsoft.info
mobileykytsoft.info
mobileozozsoft.info
mobileozozsoft.info

Top Referers
4553x www.google.co.in
2421x www.google.com
800x www.facebook.com
653x www.everyonewe...
603x ymlp.com

Top 100 Referers
click here

Shoutbox

You must login to post a message.

21-09-2011 15:12
Please share our facebook fan page. www.facebook.com/e
lxproject

02-08-2011 15:13
spam bye bye..

29-07-2011 01:55
Janice, please write in our forum...

janice
28-07-2011 02:49
can anyone share ur ideas of creating a project that would benefit health & community...tnx

20-05-2011 05:09
Got serious problem during update...fixed now

Login

Username

Password





Forgotten your password?
Request a new one here.

Subscribe

Enter your email address:

Delivered by FeedBurner

Users Online

· Guests Online: 10

· Members Online: 0

· Total Members: 1,711
· Newest Member: abdo alsawi

Last Seen Users

abdo alsawi 2 days
mats1986 2 weeks
tejaswivarma1 9 weeks
rita199911 weeks
proj11 weeks
Hemantrockz14 weeks
denis16 weeks
Santosh17 weeks
BlackMASK17 weeks
markanthony10220 weeks

RSS feeds

Stats

elxproject.com

Electronic Distance Meter

  Subscribe this Delicious Google Live Reddit Yahoo Favourites

Measure distance while riding bicycle. Direct display in meter unit. Battery operated with Nitron 68HC908QY4, 16-pin MCU.


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. It seemed to me that it's quite long, but I didn't know exactly. My son ridden bicycle while I was walking along him. I look at the bicycle wheel, and thought may be we can measure distance with the help of wheel rolling. The week before I brought a magnet from BaanMor, it was the rare earth magnet. I thought why don't have the reed switch as the sensor and use the magnet tied to a wheel. Detection of rolling is then made by proximity effect, when the magnet close to the reed switch. This close/open reed switch contact can use to make on-off signal. I chose MCU from Motorola, a 16-pin 68HC908QY4 for counting the pulse signal produced by reed switch.

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. The sensor inputs are PTA2 for reed switch contact and PTA0 for 0/+5V analog input. I used small phone jack for both sensors. The analog input is optional. I haven't got the idea what sensor should be used. The power supply is battery with simple +5.1V zener diode. You can use +9V battery or 1.5Vx3 AA battery. The circuit can run properly when the supply down to +3V. Care should be taken if you will use ADC, since the VREF is the same as VDD!

Figure 2: Complete hardware schematic of distance meter v1.0.


Sample Prototype Board

We have seen the schematic is quite simple, so we can build the board with universal pcb. Figure 3 shows the sample of placement of Nitron chip and LCD connector. I used small phone jack on the left hand to connect sensor. After the jack was soldered, I could not put the plug, it was too close to pcb, so I cut it, but unfortunatly the pcb was broken. It looked not nice, but the program running was fine.

Figure 3: 16-pin Nitron chip 68HC908QY4.


Reed Switch Sensor

Figure 4 shows a sample sensor and cable making. Later we need shrinkage tube to protect the sensor. The position when sensor when fix to the bicycle wheel also important. We need the magnetic flux perpendicular to the contact.

Figure 4: Reed switch sensor and cable.



Software

The firmware for distance meter was written in c with ICC08 compiler. Let's look at the the main code and you may need to modify for your bicycle.

 




#include <io908QY4.H>

#define one_revolution 157 // 2PIr, radius is 25cm
#define p 1 // scale of ADC reading

 

My son bicycle has 50cm diameter front wheel. Above constant, one_revolution then was computed for one revolution. This value will use for calculating distance in meter.


void print_distant()
{
if(++timer1>10)
{
timer1 = 0;
PTA ^= 2; // toggle PA1
// count++; // test auto increment
length = count*one_revolution; // one revolution = 157cm
print_dec(0x80,length/100); // 100cm = 1m
LCDWD(' ');
LCDWD('m');
print_dec(0xc0,read_adc_scale());
}
}

 

 

The computed value is cm unit with one revolution equal 157cm. print_dec( ) function prints the distance is meter unit by dividing length with 100. I have added the analog display reading from ADC0 with function read_adc_scale( ) also. You may add your own sensor. I just tested with photocell using simple voltage divider with 4.7k tied to +V.

void main()
{
// OCSTRIM = 0x81; // trim internal oscillator
delay(1000); // powerup delay for LCD
n = k=0;
count = 0;
average = 0;

TMODH = 0x01;
TMODL = 0xf4;
TSC = 0x06; // run timer
DDRA = ~0x1; // PA0 is ADC input
DDRB = 0xff; // port B is output port
PTB = 0; // clear port B
PTAPUE = ~0x81; // osc2 pin is PTA4 I/O
ADCLK = 0x40; // ADC clock= fbus/4
i_LCD();
print_lcds(title);
delay(60000);
now = old = PTA&4;
LCDWI(1); // clear lcd
//asm(" cli"); //enable irq interrupt

for(;;)
{
while(!(TSC&0x80))
;
TSC &= ~0x80; // clear TOF
// PTA ^= 2; // task running ~60Hz so the loop running is 120Hz or 1/120Hz
task_led();
print_distant();
detect_pulse_input();
COPCTL = 0; // clear COP
}
}

Main code is simple forever loop with tick generation by timer0. The internal oscillator and timer0 control byte were set to provide approx. 1/120Hz tick. Main codes are pulse detection and print the accumulated distance. Each loop running the COPCTL must be cleared, otherwise it will reset MCU!

Download

Comments

#1 | PrarProw on September 07 2012 15:43:37
It borrows some elements from its computer counterpart? web game Game designers from konami. Every girl hopes to turn into a mother eventually so when a prerequisite to the, they like playing babysitter games.

Post Comment

Please Login to Post a Comment.

Ratings

Rating is available to Members only.

Please login to vote.

No Ratings have been Posted.

Popular Projects

· Weather Station (51571)
· Electronic code lock with user define... (34102)
· The GreenBee Project (33349)
· Thermometer using Nokia 3310 LCD (24963)
· TDA7000 for NBFM (22399)
· The World's Simplest Open Source DIY ... (22112)
· REMOTE[RS232] Using Easy-Server V0.9 (16238)
· DIY PIC16F883 Development Board (15304)
· Ethernet Weather Station (14597)
· Smart Laptop Docking Station with Ant... (13858)
· AVR microcontroller Web Server (13631)
· Electronic Distance Meter (13411)
· Realtime clock with LED display and 8... (12993)
· Traffic Light System (12905)
· Vehicle Tracking System using GPS and... (12873)
· 500W low cost 12V to 220V inverter (12534)
· RFID Based Security System (AT89S52 +... (12359)

Add a Comment

Facebook