+ Reply to Thread
Page 1 of 9
1 2 3 4 5 ... Last
Results 1 to 15 of 132

Thread: Speedometer

  1. #1
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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


  2. #2
    mramos1 Excellent mramos1 Excellent mramos1 Excellent mramos1 Excellent
    Join Date
    Sep 2005
    Location
    Boynton Beach, Florida USA
    Posts
    2,254

    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.

  3. #3
    Banned donniedj Bad donniedj Bad
    Join Date
    Jan 2004
    Location
    So Cal
    Posts
    337

    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?

  4. #4
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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.

  5. #5
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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).

  6. #6
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,696

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

    Mike.

  7. #7
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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.

  8. #8
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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?

  9. #9
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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.

  10. #10
    mramos1 Excellent mramos1 Excellent mramos1 Excellent mramos1 Excellent
    Join Date
    Sep 2005
    Location
    Boynton Beach, Florida USA
    Posts
    2,254

    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.

  11. #11
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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.

  12. #12
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

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

    Thank you very much for the help

  13. #13
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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).

  14. #14
    Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent Pommie Excellent
    Join Date
    Mar 2005
    Location
    Brisbane Australia
    Posts
    6,696

    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.

  15. #15
    Kiko Newbie
    Join Date
    Apr 2004
    Location
    Brazil
    Posts
    79

    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...

+ Reply to Thread
Page 1 of 9
1 2 3 4 5 ... Last

Similar Threads

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

Tags for this Thread