Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 8th March 2007, 11:42 PM   #1
Default Speedometer

I have built a speedometer and gear indicator for my Suzuki motorcycle using a pic 16F876. That's is a simple circuit using 20 mhz clock. The speedometer signal come from VSS (vehicle speed signal) and goes direct to the pic pin and the signal from GPI (gear position indicator), which is a voltage, goes to another pin through a voltage divider. It's working but not very well because when I start the engine the readings are not steady. Does anyone could help me with this issue?

Thanks
Kiko is offline  
Old 9th March 2007, 12:26 AM   #2
Default

What is the power source to the chip?

Does it work sometimes but not all the time? Or is it not not doing what you want (unstable all the time)?

If it is not doing what you want, I would upload the schematic and code.

I did a tag flip project on unlawfulintentions.com (could not find the link).

The noise from the alternator and cell phones (Nextel) in the tail of the bike made the microcontroller do weird stuff some times.

A capacitor will fix that.

If you list more details someone here will help you.
mramos1 is offline  
Old 9th March 2007, 02:11 AM   #3
Default

Try inserting a few seconds delay at the beginning of the PIC code assuming the PIC is powered at moment of engine start.

Is the display erratic or just the actual speed values?
donniedj is offline  
Old 9th March 2007, 03:42 AM   #4
Default

It's working well on the bench but it's unstable installed in the bike and it's getting worse when the engine start. I've tried to add a higher value capacitor before and after of the LM 7805 but did not fix it.
Kiko is offline  
Old 9th March 2007, 03:48 AM   #5
Default

Try inserting a few seconds delay at the beginning of the PIC code assuming the PIC is powered at moment of engine start.

I'll try to do that tomorrow...

Is the display erratic or just the actual speed values?

The readings on display are unstable even with no speed the readings going crazy almost all the time (it's not accurated).
Kiko is offline  
Old 9th March 2007, 07:29 AM   #6
Default

Is the VSS going to a normal input rather than a schmitt trigger input?

Mike.
Pommie is offline  
Old 9th March 2007, 12:23 PM   #7
Default

Quote:
Originally Posted by Pommie
Is the VSS going to a normal input rather than a schmitt trigger input?

Mike.
Yes it's going direct to an input pin of the PIC.
Kiko is offline  
Old 9th March 2007, 12:38 PM   #8
Default

Quote:
Originally Posted by Pommie
Is the VSS going to a normal input rather than a schmitt trigger input?

Mike.
What schmitt trigger circuit (IC) is the best for that application?
Kiko is offline  
Old 9th March 2007, 12:48 PM   #9
Default

Quote:
Originally Posted by donniedj
Try inserting a few seconds delay at the beginning of the PIC code assuming the PIC is powered at moment of engine start.

Is the display erratic or just the actual speed values?
By the way, I have put a 2 sec. delay just before a program loop and didn't make any difference.

I'm using a Proton+ Basic Compiler.
Kiko is offline  
Old 9th March 2007, 01:35 PM   #10
Default

Is the pic working OK, but the readings are wacked out?

Can you blink an LED and see if the pic is stable. That way you which direction to trouble shoot in.
mramos1 is offline  
Old 9th March 2007, 05:37 PM   #11
Default

Quote:
Originally Posted by mramos1
Is the pic working OK, but the readings are wacked out?

Can you blink an LED and see if the pic is stable. That way you which direction to trouble shoot in.
Like I sad it works properly on the bench, I think the problem is in the bike itself because some times when I turn just the ignition on the reading is zero and when the engine start the readings going crazy and when the bike is running the reading is either crazy.
Kiko is offline  
Old 9th March 2007, 05:39 PM   #12
Default

I will post the routine I've made to read the speed later on.

Thank you very much for the help
Kiko is offline  
Old 9th March 2007, 06:56 PM   #13
Default

DEVICE 16F876A
DECLARE XTAL 20
DECLARE LCD_TYPE 0
DECLARE LCD_DTPIN PORTB.4
DECLARE LCD_ENPIN PORTB.2
DECLARE LCD_RSPIN PORTB.3
DECLARE LCD_INTERFACE 4
DECLARE LCD_LINES 2
DIM KMH AS word
DIM KMHT AS WORD
Delayms 2000
CLS
Start:
KMHT=COUNTER PORTA.5, 250
KMH=((0.002*3600)*(KMHT*4))/1000
ALL_DIGITAL=TRUE
PRINT AT 1, 1, " "
PRINT AT 1, 1, DEC KMH
PRINT AT 1, 5, "KM/H"
GOTO Start


Anyone can help? I think there is something wrong with this code because I have ran it on the computer and the problem I mentioned before still happening, the reading is not reliable (goes high and low).
Kiko is offline  
Old 10th March 2007, 12:53 AM   #14
Default

Quote:
Originally Posted by Kiko
What schmitt trigger circuit (IC) is the best for that application?
What I meant was that some of the input pins on the pic are schmitt triggers. RA4, RB0 (int only) and all of port C are schmitt trigger inputs. Try changing your circuit so it uses one of these inputs.

Mike.
Pommie is offline  
Old 10th March 2007, 01:14 AM   #15
Angry

Quote:
Originally Posted by Pommie
What I meant was that some of the input pins on the pic are schmitt triggers. RA4, RB0 (int only) and all of port C are schmitt trigger inputs. Try changing your circuit so it uses one of these inputs.

Mike.
I was using RA5...
Kiko is offline  
Reply

Tags
speedometer

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
digital speedometer using AT90S2313 fever Micro Controllers 57 29th January 2008 07:45 PM
Speedometer Project Help ADAM117 Electronic Projects Design/Ideas/Reviews 2 8th December 2006 06:00 PM
Pulse divider for a Speedometer spestis Electronic Projects Design/Ideas/Reviews 3 25th July 2006 03:17 AM
Tachometer and Speedometer replies Kiko Micro Controllers 0 26th April 2004 01:57 AM
Electronic Speedometer using stepper motor roryp General Electronics Chat 6 10th April 2003 01:06 PM



All times are GMT. The time now is 09:35 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker