Automotive ( {$STAMP BS2} {$PBASIC 2.5} )
TrickyOne
Posts: 3
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.
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
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
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.
·
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!
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
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!