Shop OBEX P1 Docs P2 Docs Learn Events
Automotive ( {$STAMP BS2} {$PBASIC 2.5} ) — Parallax Forums

Automotive ( {$STAMP BS2} {$PBASIC 2.5} )

TrickyOneTrickyOne Posts: 3
edited 2009-02-25 22:45 in BASIC Stamp
Hi

I have A ( {$STAMP BS2} {$PBASIC 2.5} ). What I want to know is? I want to hook the stamp to my car's trun light's. So when the Right turn light is on, A LED will stay on for the time the right trun light is on. When the right trun is off the led is off. I know that I will have to drop the volts from 12V to 5V. I just want to get the pulse's right form the tailer plug, from the back of car. How do I program the stamp to know what the pulse's are (0 and 1's) comming into the stamp are.

Comments

  • rixterrixter Posts: 95
    edited 2009-02-25 03:21
    TrickyOne,

    You are dealing with a couple of different things here. I am assuming what you are trying to do is to have an LED light illuminate and stay that way as long as a turn signal on the vehicle is blinking... one per side. And you are trying to understand how to capture that pulse of current to the Stamp that the flasher unit in the vehicle is generating. It seems that going back to the source (the turn signal switch), is a more practical way of attacking this project rather than figuring out what you would need to do to capture the pulsing current. If if you are conveniently tapping into a trailer connector for this project, how would you differentiate between the flashing frequency and a person turning the turn signal on and off manually? Naturally someone wouldn't manually turn a turn signal on and off and on repeatedly (ok maybe your bratty little brother), but you'd still have to handle all cases of the changing of one status to the other and the difference between that and the change in electrical current due to the action of the flasher. This would require some type of "pattern recognition" logic in your program. But if you get up to the turn signal switch itself and activate a contact switch to your Stamp based on the position of the turn signal switch, you've bypassed the flasher challenge.

    rixter
  • BriceHBriceH Posts: 10
    edited 2009-02-25 06:29
    You could use a 555 timer with a delay longer than your blinker duration, so the output would allways stay on as long as the blinker is on.
    Use a 7404 to invert the signal from the tail light to the 555 timer since its looking for a ground signal... This is all assuming that you have converted the 12 volt tail light signal to 5 volts.
    When the output of the timer remains at logic 0, you would tell the led to turn off until the 555 timer is triggered again with the tail light blinker.
    You can use the PIN directive or the·Pollin command to check for a logic change on the pin that connects the BS to the 555 timer.
    Hope this helps... Brice.

    ·
  • MrBi11MrBi11 Posts: 117
    edited 2009-02-25 06:52
    You'll need to go back to the switch, otherwise you won't be able to detect the difference between brake & turn signal
    You'll still have issues with it flashing, most cars have the 'flasher' before the turn signal switch, you'll just need to pick-up the wiring to the front lights

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Smile ... It increases your face value!
  • LilDiLilDi Posts: 229
    edited 2009-02-25 17:04
    I want to do something like this too. I am thinking about running fiber optic cable from the back tail lights up to the dashboard. This will accomplish three things. It will tell me when a tail light is out. It will tell me how bright the tail light is to distinguish between brake light and turn signal, and it is completely mechanical in nature so no worries about electronic failure, and I don't need to access and solder/tap onto existing automobile wiring. OH! Thats four things. What do you think?
  • hover1hover1 Posts: 1,929
    edited 2009-02-25 19:16
    LilDi said...
    I want to do something like this too. I am thinking about running fiber optic cable from the back tail lights up to the dashboard. This will accomplish three things. It will tell me when a tail light is out. It will tell me how bright the tail light is to distinguish between brake light and turn signal, and it is completely mechanical in nature so no worries about electronic failure, and I don't need to access and solder/tap onto existing automobile wiring. OH! Thats four things. What do you think?
    Fiber optics were used from the tailights to dash in the 1968-1973 Corvettes. Looked cool at night.
  • GeekgirlGeekgirl Posts: 50
    edited 2009-02-25 22:19
    My old Eldorados had fiber optics to give you a dashboard view of your lights, was kinda neat.

    The 555 idea is a workable one, but has some complications.

    ·Another scheme·that would work is to use a·photo diode or transistor·at each light·driving an op-amp·circuit that integrates a sufficient charge onto a capacitor during on the "on" time of the blink·so that it·would stay above a preset·flip·level of a comparator circuit for·slightly greater than·the duration of the "off" time between blinks. If you charge the cap thru a series diode and resistor and then discharge the cap thru a much larger resistor, you can charge it quicker than it will discharge.

    You could additionally have your circuit look for light from both sides, and then blank the output as it would know it was the brake lights on.

    If you just want to be able to hook it all up with wire using a trailer plug or something, you could use an opto isolator on the 12v in from the plug and then use a 5v regulator on the cars 12v supply power to run your comaparators and other circuitry.

    Either way, the comparator functions are the same, and you could do all the·comparator functions with one LM339 quad comparator.

    You'd effectively have 2 compare functions for each side (L and R). Let the opto isolator (or photo transistor)·drive a comparator to charge the cap, and the second comparator to "read" the cap.



    Darlene

    Post Edited (Geekgirl) : 2/25/2009 10:37:55 PM GMT
  • MrBi11MrBi11 Posts: 117
    edited 2009-02-25 22:45
    LilDi said...
    I want to do something like this too. I am thinking about running fiber optic cable from the back tail lights up to the dashboard. This will accomplish three things. It will tell me when a tail light is out. It will tell me how bright the tail light is to distinguish between brake light and turn signal, and it is completely mechanical in nature so no worries about electronic failure, and I don't need to access and solder/tap onto existing automobile wiring. OH! Thats four things. What do you think?

    The Brake light and the turn signal use the same element so they are the same brightness. [noparse][[/noparse]unless you got the euro style yellow turn signals]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Smile ... It increases your face value!
Sign In or Register to comment.