Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

LCD Tachometer/Speedometer

Status
Not open for further replies.

Kiko

New Member
I would like to build a tachometer and speedometer with PIC, maybe 16F84A, and a lcd display (2X16 - first line to SPEED and second to RPM) to install on my bike. Does anyone have a schematic as well as the PIC program?

By the way, the rpm signal come from the engine ignition coil and have to be able to read up to 14000 RPM and the speed signal come from a magnetic switch on the front wheel.

Thanks,

Fabio
Rio de Janeiro
Brazil
 
Do a google search with keywords PIC and HD44780 LCD. Should return quite some hits...

Nigels tutorials also contain an lcd tutorial...

14000RPM is only about 233 R/sec. Counting it should be no problem for a pic. It leaves more then 4000 instructions between every pulse (assuming 4Mhz pic speed). Wich should be plenty to update the lcd every once in a while between pulses
 
Done that. The tach goes to an external interrupt pin. I put a 10k resistor in series, a 5v zener from the pin-to-ground to avoid engaging the protection diodes, and a 50k in parallel with the zener to avoid triggering on noise if the wire is unhooked.

I used a graphics LCD with a large graphical font and a bar display myself.

Put the TMR interrupt and tach interrupts at a higher priority than whatever writes the LCD. That could mean high vs low priority interrupts, or using unprioritize interrupts for those and put the LCD writing in the main body. The rpm value will need protection so it doesn't get rewritten while it's being sent to an LCD, generally you'd disable the timer interrupt, quickly copy the value, and reenable it. If prioritized interupts are used, the TMR interrupt will need to disable the tach input's interrupt too.
 
Like i wrote in the previous post, if 14000RPM is the maximum it has to measure then it leaves 4000+ instructions between every pulse (at 4mhz). Should be enough to write a whole story to a LCD, so why even bother using interrupts? (The guy wrote 2*16 LCD, so i assume he means a normal text lcd)

Just update the lcd right after a pulse was received and you can be sure the next one didn't come in before it's done...
You probabely want to update the lcd only a few times a second, update it too fast and you wont be able to read it properly...
 
What language are you using for all of this? Can i see some code of yours, cos im trying to do the same with a pic16f877 and an lcd screen.
Thanks alot.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top