Shop OBEX P1 Docs P2 Docs Learn Events
Tachometer, '08 Yaris, bar-graph display — Parallax Forums

Tachometer, '08 Yaris, bar-graph display

yarisboyyarisboy Posts: 245
edited 2009-05-26 23:59 in Robotics
45ACP019.jpg
45ACP018.jpg
HPIM1368.jpg
This is the stitch wired prototype that is installed in my new car. Key on, engine off the leds strobe back and forth like Kit. At 6000 RPM the lights start strobing rapidly as a speed warning. I've set a goal of having the two layer lay-out off to Express in two weeks.

See also[noparse]:http:[/noparse]//www.parallax.com/tabid/774/Default.aspx

Post Edited (yarisboy) : 5/27/2009 12:34:42 AM GMT

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-28 13:03
    yarisboy...please provide more information about what this project is and does. A schematic, if available. Source code, if available, and active links so members don't have to copy/paste all those links. You could also attach pictures. Without that information this looks like a general post and will be moved to the appropriate forum within a day or so.

    [noparse][[/noparse]Current Links Activated by Moderator]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support


    Post Edited (Chris Savage (Parallax)) : 7/29/2008 2:33:33 PM GMT
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2008-07-29 06:53
    yarisboy,

    Nice project. I worked as a army mechanic many years ago and find your project interesting. As a matter of fact I once made a handheld Tach that pick up the signal pulse from a a built in antenna and displayed it on a analog meter. smilewinkgrin.gif


    I'll add a few active links for your pictures and you can do the rest.



    Yaris tachometer schematic(sheet1)

    s351.photobucket.com/albums/q443/scloyd_01/?action=view&current=HPIM1367.jpg

    Yaris Tach on super carrier board

    s351.photobucket.com/albums/q443/scloyd_01/?action=view&current=HPIM1372.jpg



    s351.photobucket.com/albums/q443/scloyd_01/?action=view&current=HPIM1366.jpg


    Yaris tach display bar graph - Installed in a vech

    s351.photobucket.com/albums/q443/scloyd_01/?action=view&current=HPIM1369.jpg

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob

    Post Edited (Bob Lawrence (VE1RLL)) : 7/29/2008 7:00:13 AM GMT
  • yarisboyyarisboy Posts: 245
    edited 2008-07-30 00:15
    I used pulsin 0 and pulsin 1 and added them for a total count proportional to the period. I found a printout of my code listing but I'll have to type it in again because I had a hard drive failure. (I know it should have been backed up). Scaling to prevent overflow was a big deal.
  • yarisboyyarisboy Posts: 245
    edited 2008-07-30 01:43
    ' {$PBASIC 2.5}
    ' {$STAMP BS2}
    '*************************PROGRAM ABSTRACT**********************************************
    '*TACHOMETER PROGRAM FOR 2008 TOYOTA YARIS. *
    '*VERSON 2.0 BY STAN CLOYD 5/13/2009. *
    '*THIS UPDATE EXPANDS TACHOMETER INDICATION RANGE TO 6,800 PLUS RPM AND RAISES RPM *
    '*FLASH WARNING (4 hZ FLASH RATE) TO 6,000 RPM. THE YARIS ECU REPORTEDLY STARTS *
    '*LIMITING RPM AT 6,400 RPM AND CAN KEEP CALCULATING ECU OUTPUT VALUES UP TO 7,000 RPM.*
    '*PARALLAX BS2 PIN #15 IS USED TO READ TACH SIGNAL FROM THE OBD2 SERVICE CONNECTOR. *
    '*INPUT SIGNAL IS ATTENUATED FROM A 0-12 VOLT SQUARE WAVE TO A 0-5 VOLT SQUARE WAVE BY *
    '*A 100 K CURRENT LIMITING RESISTER AND A 5.01 VOLT ZENER DIODE. OUTPUT PINS #s 0-14 *
    '*ARE IMPEDANCE MATCHED TO THE LED LOADS BY LM342-N OP-AMP QUAD PACKS IN A UNITY GAIN *
    '*CONFIGURATION. *
    '*PULL DOWN RESISTERS WITH A VALUE OF 47 K ARE USED TO KEEP THE PROCESSOR OUTPUTS *
    '*FROM FLOATING HIGH WHEN THE LOGIC HAS THEM OFF. COMPARISON OF RPM TO A COMMERCIAL *
    '*DIGITAL TACHOMETER SHOWED A 1 % DIFFERANCE AT 650 RPM AND A 1/2 % DIFFERANCE AT *
    '*3,200 RPM. CALIBRATION INTEGERS USED ARE FOR A 4 CYLINDER 4-CYCLE ENGINE ONLY. *
    '*EEPROM DATA BELOW STORES THE RPM LIMIT VALUES THAT TURN ON AND OFF EACH DISPLAY LED. *
    '***************************************************************************************
    DATA Word 540, Word 950, Word 1400, Word 1850, Word 2300 'EPROM DATA *
    DATA Word 2750, Word 3200, Word 3650, Word 4100, Word 4550 'EPROM DATA *
    DATA Word 5000, Word 5450, Word 5900, Word 6350, Word 6800 'EPROM DATA *
    '***************************************************************************************
    '************************DECLARATIONS & INITIALIZATIONS*********************************
    SAMPLE_L VAR Word '*INPUT SQUARE WAVE TIME-LOW COUNT *
    SAMPLE_H VAR Word '*INPUT SQUARE WAVE TIME-HIGH COUNT *
    PERIOD VAR Word '*TOTAL SQUARE WAVE PERIOD COUNT (INVERSE OF FREQUENCY) *
    RPM VAR Word '*REVOLUTIONS PER MINUTE (CRANKSHAFT RPM) *
    RPM_L VAR Word '*RPM CELL LIMITS READ FROM EEPROM TABLE *
    INDEX VAR Byte '*OUTPUT PIN INDEX # *
    CAL1 VAR Byte '*SCALING CONSTANT TO KEEP CAL2 BELOW INTEGER OVERFLOW LIMIT*
    CAL2 VAR Word '* *
    CAL1=230 '*FOUR CYLINDER ENGINE-SPECIFIC CALIBRATION VALUE *
    CAL2=63050 '*FOUR CYLINDER ENGINE-SPECIFIC CALIBRATION VALUE *
    START: '* *
    PERIOD = 0 '*RESET/CLEAR LAST SCAN-LOOP VALUES *
    SAMPLE_L= 0 '* *
    SAMPLE_H= 0 '* *
    RPM = 0 '* *
    '* *
    PULSIN 15, 0, SAMPLE_L '*SAMPLE PIN #15 LOW COUNT AT ZERO VOLTS *
    PULSIN 15, 1, SAMPLE_H '*SAMPLE PIN #15 HIGH COUNT AT 5 VOLTS *
    PERIOD = SAMPLE_L+SAMPLE_H '*CALCULATE TOTAL PERIOD COUNT *
    PERIOD = PERIOD/CAL1 '*SCALING FACTOR TO PREVENT POSITIVE INTEGER OVERFLOW *
    RPM = CAL2/PERIOD '*CALULATE RPM *
    '* *
    IF RPM>6000 THEN '*FLASH LEDS ON AND OFF AT 4 HZ WHEN RPM EXCEEDS 6000 RPM *
    '*(SHIFT WARNING). *
    FOR INDEX=0 TO 14 '************************************************************
    LOW INDEX
    NEXT
    PAUSE 25
    ENDIF
    FOR INDEX=0 TO 28 STEP 2 '*TURN ON CORRECT LEDS FOR ANALOG DISPLAY *
    READ INDEX, RPM_L.LOWBYTE '*INDICATION(ENGINE-RUNNING CONDITION ONLY). *
    READ (INDEX+1), RPM_L.HIGHBYTE
    IF RPM>RPM_L THEN
    HIGH (INDEX/2)
    ELSEIF RPM<RPM_L THEN
    LOW (INDEX/2)
    ENDIF
    NEXT
    DO WHILE PERIOD=0 '*REVERSING STROBE FLASH SEQUENCE WHEN *
    FOR INDEX=0 TO 14 '*IGNITION KEY IS ON BUT ENGINE IS NOT *
    HIGH INDEX '*RUNNING (HARDWARE DIAGNOSTIC). *
    PAUSE 20
    LOW INDEX
    PAUSE 20
    NEXT
    FOR INDEX=14 TO 0
    HIGH INDEX
    PAUSE 20
    LOW INDEX
    PAUSE 20
    NEXT
    LOOP
    GOTO START


    And there you have it. The fresh version without the bug.

    Post Edited (yarisboy) : 5/27/2009 12:12:36 AM GMT
  • yarisboyyarisboy Posts: 245
    edited 2009-05-15 01:46
    Version 2 above.

    Post Edited (yarisboy) : 5/27/2009 12:36:06 AM GMT
  • ChetChet Posts: 150
    edited 2009-05-26 13:05
    Which pin on the OBDII connector is the Tach pin on your system?

    Chet
  • yarisboyyarisboy Posts: 245
    edited 2009-05-26 23:59
    OBD2003.jpg
    On my 2008 Yaris it is the tan wire on the forward far left end of the OBD2 connector block as viewed from inside the dash. I hooked a red wire to it to go to the block on my tachometer board. Toyota changed the wire color mid year so photos available on YarisWorld.com differ depending on production date code. The standard pin-out is also available from SAE specs. When you hook a standard mechanics tachometer to the right pin and rev the engine in neutral you will see the RPM value rise. If you hook to the VSS wire by mistake, the tach read-out value only rises when you accelerate the car down the road. If you want an electronic speedometer then the two calibration values in the code would need to be edited. You would also want to switch, in that case, to an 4-digit 7-segment LED display (that I'm working on).

    Post Edited (yarisboy) : 5/27/2009 12:37:12 AM GMT
Sign In or Register to comment.