Detect Signal


Closed Thread
Results 1 to 15 of 15

Thread: Detect Signal

  1. #1

    Default Detect Signal

    I am currently working on a project to add a second odometer to my vehicle. At this present time I believe it to be a series of pulses, however I do not know the number outputted per mile. Is it possible have the pic determine (perhaps count) these pulses initially so that I may use this number for my project? I don't believe there is a clock signal involved, and do not know the period. Any help provided is greatly appreciated. (And no this isnt a highschool or college project, I just want a second odometer for my car)

    Thanks

    SR

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by angrysmileyface View Post
    I am currently working on a project to add a second odometer to my vehicle. At this present time I believe it to be a series of pulses, however I do not know the number outputted per mile. Is it possible have the pic determine (perhaps count) these pulses initially so that I may use this number for my project? I don't believe there is a clock signal involved, and do not know the period. Any help provided is greatly appreciated. (And no this isnt a highschool or college project, I just want a second odometer for my car)

    Thanks

    SR
    I assume you're talking about the digital odometers and not the old cable driven types.
    On most of the dash panels I've seen, on the back, like right under the connector (a few times on the front), there's usually some writing saying something to the effect of "1320 PULSES PER MILE" ('88 Chevy Sprint). I don't remember the numbers for my other cars.

    As far as calibrating (if needed), 2 methods come to mind.

    -Drive 60mph, press a button, PIC counts for X amount of time or one minute, which would be perfect at 60mph since you'll also have travelled a mile, now you also have pulses per mile.

    -Drive X mph, press a button when you pass a mile marker, press the button again when you press the next mile marker. Now you know how many pulses per mile (give or take). Maybe do ten miles so the 'give or take' will average out a bit.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Yes it's a digital signal, not cable driven. I am thinking its just tie an input pin to the signal, and do the number of pulses that show up. I need to work on some code and then we'll see if that works.

  4. #4
    Join Date
    Oct 2005
    Location
    Loveland CO USA
    Posts
    83


    Did you find this post helpful? Yes | No

    Default miles per count

    My car gives one count per turn of the drive shaft. (output of the transition)
    Multiply by the turn ratio of the rear end multiply by the tire circumference.
    You just need to count how many pulses per km or mile. Build a counter with a PIC and drive for 1 mile. Every kind of car is different. You need to do the experiment.
    Simple project.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ronsimpson View Post
    My car gives one count per turn of the drive shaft. (output of the transition)
    Multiply by the turn ratio of the rear end multiply by the tire circumference.
    You just need to count how many pulses per km or mile. Build a counter with a PIC and drive for 1 mile. Every kind of car is different. You need to do the experiment.
    Simple project.
    Relatively simple project. I have to wonder how 'ugly' that signal will be coming off the sensor, travelling up the wire to the PIC, etc. Might have to square it off a bit with a 7404 or something along those lines so the PIC doesn't get false triggers.

  6. #6
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Another way

    Hi,

    Most probably you would be getting a variable frequency signal. If you have access to a frequency meter (most multimeters have) then measure the frequency while driving at a fixed speed. You get an idea of the number of pulses/per second available a certain speed. Do it for other speeds as well to find if the relationship is correct. Only take care while driving and taking the reading.
    Regards

    Sougata

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Unfortunately I do not have a frequency meter. best I have is a cheapo Radio Snack multimeter with AC/DC, Diode test and Amperage. So I am rather stuck trying to ascertain what the signal looks like by what I have on hand. Now if I had the gear I had back in college, it would be a diff story.

    Basically I think I will count the pulses that show up, unless someone has a better idea (This is a 93 honda civic btw)

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by angrysmileyface View Post
    Unfortunately I do not have a frequency meter.
    You are building one. Be sure to look at the COUNT command in the manual. I use something similar to monitor fan and blower speeds.

    A hall effect sensor is often used. If the wiring is good the signal will be "OK". The first few blade speed monitors I built used sensors from autos.
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Apr 2006
    Location
    New Hampshire USA
    Posts
    298


    Did you find this post helpful? Yes | No

    Smile Pulses Per Mile 4000 PPM ???

    1992-1995 Honda Civic Cruise Information

    Constant 12V+ White Ignition Switch Harness or Use Hot Side of Brake
    Switched 12V+ Black/Yellow Ignition Switch Harness
    Ground Use Chassis Near Cruise Control Module
    Hot Side of Brake n/a Brake Switch
    Cold Side of Brake Green/White Brake Switch
    Tach Blue Distributor
    VSS Lead Yellow/Blue Driver's Side Dash, above Fuse Panel, Gray Connector
    Pulses Per Mile 4000 PPM

    http://www.hondafactor.com/v2/showpo...55&postcount=5

    “Your mileage may vary”
    -Adam-
    Ohm it's not just a good idea... it's the LAW !

  10. #10
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic_User View Post
    VSS Lead Yellow/Blue Driver's Side Dash, above Fuse Panel, Gray Connector
    Pulses Per Mile 4000 PPM

    http://www.hondafactor.com/v2/showpo...55&postcount=5
    There ya go. Use the VSS signal to trigger an interrupt, keep track of the pulses in a word variable...Bam...done...except for the building, and the programming, putting it in a box, testing it on the car, etc.etc.

  11. #11
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Both Vss and Tach can be find easy under the dash for this car as well. Usually on the top of the fuse box. There's a lot of connector, just use the same wire color.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  12. #12


    Did you find this post helpful? Yes | No

    Default

    Ok got a little code here. Not quite sure if its what I want for this purpose, so excuse me if there are some errors. Basically I want it to count the pulses coming off the VSS and Im trying to use the VSS as a the interupt to start the process when it starts registering milage. I do not know if I configured the interupt process correctly as well as its not shown here, but I would like to be able to save the milage to some portion of the eeprom memory when the car is shut off. I intend to use a 16F877A for this project. Insight or help is greatly appreciated. Thanks.

    Define LOADER_USED 1 'required if bootloader used to
    'program PIC
    DEFINE LCD_DREG PORTC 'Define PIC port used for LCD Data
    'lines
    DEFINE LCD_DBIT 4 'Define first pin of portb
    'connected to LCD DB4
    DEFINE LCD_RSREG PORTC 'Define PIC port used for RS line of
    'LCD
    DEFINE LCD_RSBIT 3 'Define PortC pin used for RS
    ' connection
    DEFINE LCD_EREG PORTC 'Define PIC port used for E line of LCD
    DEFINE LCD_EBIT 0 'Define PortC pin used for E
    'connection
    DEFINE LCD_BITS 4 'Define the 4 bit communication
    'mode to LCD
    DEFINE LCD_LINES 2 'Define using a 2 line LCD
    DEFINE LCD_COMMANDUS 2000 'Define delay between sending LCD
    ' commands
    DEFINE LCD_DATAUS 50 'Define delay time between data sent.
    OPTION_REG = %00111111 'Not sure if this is needed.
    plscntr var WORD
    milage var word


    plscntr = 0 'Reset pulse counter
    ON INTERRUPT goto miles_start
    INTCON = $90
    Start:

    lcdout $fe, 1 ' Clear LCD
    lcdout $fe, 2 ' Position cursor at home
    LCDOUT #milage ' Initially display Milage
    Pause 1000 ' Pause for 1 second to see it
    If PortA.1 = 1 Then milage = 0 'Reset the milage indicator if reset button pressed
    Goto Start ' Loop back and do it all again


    miles_start:
    if PortA.5 = 1 then plscntr= plscntr +1 'add the pulses

    if plscntr = 4000 then
    plscntr = 0
    milage = milage+1
    lcdout $fe, 1 ' Clear LCD
    lcdout $fe, 2 ' Position cursor at home
    LCDOUT #milage ' Display Milage
    EndIF
    goto miles_start
    end

  13. #13
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Which pin do you plan on using to trip the interrupt?

    Assuming the pulse goes high (maybe PortB.0?), let the ON INTERRUPT kick you into the interrupt subroutine and stay there until the pin goes low so you don't kick the counter more than once.
    Check and reset the pulse counter (if counter > 4000 then = 0 etc.etc.) and increment the mileage counter, and do the displaying and button checking in your main loop. No sense doing that in your interrupt subroutine.
    First off though, don't worry about counting mileage...put the whole thing together and whip up a 555 timer or something (maybe even a pushbutton, the switch bounce will give you more than one pulse if the button is old enough!) to simulate the VSS pulse and get the display and everything working without having to go out to the car every 2 minutes to test it out. Just get the thing counting up as you need it (heck you can get both an odometer and speedometer and average speedometer and gas mileage and oil change intervals and all sorts of crap into this), then worry about all the neat stuff for later since you've already got basics down.

  14. #14
    Join Date
    Jan 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    I was trying the same thing as you, but I was wanting to have a Point of Sale printer record my daily millage. and use a Real time clock to Give it a daily time stamp!
    But my problem was to writing the milliage to the eprom and keeping the pulse count while moving.

  15. #15


    Did you find this post helpful? Yes | No

    Default

    I dont intend to store to the eprom until the car stops and is shut off, but that is later once i get it all built and tested

Similar Threads

  1. Replies: 24
    Last Post: - 1st December 2009, 08:01
  2. Detect fast movement using photodiode
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 22nd November 2008, 14:07
  3. Decoding an incoming infrared signal: need advice
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th May 2008, 16:28
  4. PIC16F684 + LCD to use the 256bytes of EEPROM - HELP
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th March 2008, 14:19
  5. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts