Pages: [1]   Go Down
Author Topic: Scoop Lights Based on Throttle Position  (Read 1221 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm new to the forum and to the Arduino so go easy on me. smiley

A friend and I are currently working on a project for his car that I'm almost certain the Arduino can handle. I just need some guidance on how to get there.

Basically, he has two hood scoops and we are looking to install two different color LED strips in each scoop - one amber and one red. The basic premise is to tie the intensity of the respective lights to his throttle position sensor (basically a 5V PWM source). What we are looking to have happen is the following:

1. Foot off the throttle: The amber strip is roughly full bright and the red strip is completely off.

2. As the pedal is pressed, the amber light begins to fade while the red light begins to slowly turn on.

3. Ideally, with the pedal pressed approximately halfway, the amber and red should both be about "half on" creating something of a red-orange glow.

4. With the pedal to the floor the amber light should be completely gone and the red light should be full on.

5. Naturally, I want varying light intensity through the full range of travel of the gas pedal.

I'm comfortable with the analogRead() function of the Arduino but where I'm coming across creative troubles in my code is the best way for the Arduino to monitor a single analog input while simultaneously controlling two independently varying outputs.

Any ideas or advice would be very much appreciated.

Thanks!
« Last Edit: July 29, 2012, 04:01:33 am by GCSTroop » Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2508
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are several types of LED strips but controlling 2x strips of lights should be no problem for the arduino.
Do you have a link to the LED strips so we can determine the type of control needed?
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

We haven't decided on the exact strips yet. They will be 12 volts, though. All I want to do is have a nice 5V PWM output swing from each respective output in relation to the analog input the Arduino is sensing. We haven't completely decided how we're going to drive the strips yet but it'll more than likely be an op amp with a negative feedback loop (protection diodes installed) that'll "boost" the signal from the Arduino outputs into the 12V region.

For a general idea, the strips will look something like this:

http://www.adafruit.com/products/285

We'll more than likely be driving the circuit with something like this - if I can find the right op amp. But, keep in mind that this circuit is something I just hastily sketched up. I modeled the variable sensor input as a 5V source connected to a 10k potentiometer.

https://www.circuitlab.com/circuit/ge954d/scoop-light-example-circuit/

If I can't find the right op amp, I'll probably throw a solid transistor at the op amp output and use the op amp to control the transistor flow.
Logged

Offline Offline
Edison Member
*
Karma: 65
Posts: 2498
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Constantly analogRead and base (map) the analogWrite on the result.

The Big Picture, regarding that op-amp circuit, is its integrating - taking pulses in and resulting a sort of ramp or triangle out.  20 mA from an op-amp output is questionable.
Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Edison Member
*
Karma: 33
Posts: 1307
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A transistor or MOSFET would could provide more power/amperage than a typical op-amp.

Sorry,I'm going to sound like your mother...  smiley-razz   IMO - It's just a bad idea to encourage you & your friend to "floor it" all the time to get the full-effect.    You might consider finding a way to detect the RPM, and run the LEDs from engine speed rather than throttle position.   You would still have to rev it up to get an effect, but reving at light loads or low gears is not as hard on the car  (and not as quite as dangerous) as flooring-it all the time.   

A string of LED's showing throttle position as a bar-graph or dot-graph would probably be OK, but personally I don't like the idea of dim LEDs at less-than-maximum throttle position, because anything less than full-throttle is no fun!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Constantly analogRead and base (map) the analogWrite on the result.

The Big Picture, regarding that op-amp circuit, is its integrating - taking pulses in and resulting a sort of ramp or triangle out.  20 mA from an op-amp output is questionable.

Good catch on the op-amp circuit. I'm not sure when I put that capacitor in there???

I understand the concepts of analogRead but the map function has me a little confused. Any clarification on that?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A transistor or MOSFET would could provide more power/amperage than a typical op-amp.

Sorry,I'm going to sound like your mother...  smiley-razz   IMO - It's just a bad idea to encourage you & your friend to "floor it" all the time to get the full-effect.    You might consider finding a way to detect the RPM, and run the LEDs from engine speed rather than throttle position.   You would still have to rev it up to get an effect, but reving at light loads or low gears is not as hard on the car  (and not as quite as dangerous) as flooring-it all the time.   

A string of LED's showing throttle position as a bar-graph or dot-graph would probably be OK, but personally I don't like the idea of dim LEDs at less-than-maximum throttle position, because anything less than full-throttle is no fun!

Like I said, we haven't decided on the external circuitry but I need something that will boost the Arduino output into the 12V range (when the output is at 5V) and I also need to keep it at the full range of travel. As for whether or not I'll find an op amp that can drive that much power... I'm not worried as I can always just use the output from the op amp to drive a transistor.

As for "flooring it..." it's not my car (I wish it was). My friend's foot stays on the floor most of the time anyway. smiley-grin Since they're scoop lights on the hood of the car, he won't be able to see probably 95% of the lighting anyway. We're just looking for a cool effect for people to see him coming in their rearview mirror as his foot continues to drive towards the floor. More than anything, we're hoping it'll have a psychological effect on people so when they look in the rearview mirror they see the light intensity changing with what appears to be his acceleration. That'll give them a hint as to how fast he's accelerating relative to their position on the road. Not sure if it'll work precisely that way but the only way to find out is to test it.

I appreciate the concern, though. smiley
Logged

Gosport, UK
Offline Offline
Faraday Member
**
Karma: 21
Posts: 3113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
More than anything, we're hoping it'll have a psychological effect on people so when they look in the rearview mirror
Well, I know what I think when I see stuff like that in the mirror.
Logged

Newcastle, NSW, Australia
Offline Offline
Newbie
*
Karma: 0
Posts: 33
Just a mechanic
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
More than anything, we're hoping it'll have a psychological effect on people so when they look in the rearview mirror
Well, I know what I think when I see stuff like that in the mirror.
LOL!
It certainly would have a 'psychological effect on people' but I don't think it's the one you're looking for.
(And generally, anything that needs a glowing light in the hood scoop that changes with rpm to 'give them a hint as to how fast he's accelerating' is going to spend most of its time in the rear view mirror!!)
« Last Edit: July 30, 2012, 03:49:38 am by nitrolx » Logged

Norfolk UK
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2508
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not worried as I can always just use the output from the op amp to drive a transistor.
Why mess around with an op amp, just drive the transistor directly http://www.ladyada.net/products/rgbledstrip/ or http://www.instructables.com/id/Use-Arduino-with-TIP120-transistor-to-control-moto/

To prolong your lead footed friends life how about inverting the logic so it starts off bright a zero MPH and gets dimmer the faster they go smiley-lol
Logged

There is no such thing as a stupid question but there are a lot of inquisitive idiots.

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
More than anything, we're hoping it'll have a psychological effect on people so when they look in the rearview mirror
Well, I know what I think when I see stuff like that in the mirror.
LOL!
It certainly would have a 'psychological effect on people' but I don't think it's the one you're looking for.
(And generally, anything that needs a glowing light in the hood scoop that changes with rpm to 'give them a hint as to how fast he's accelerating' is going to spend most of its time in the rear view mirror!!)

smiley

I think the wording "psychological effect" gave far too much of a dramatic image in mind. We just want it to have the same kind of subtle effect as a turn signal - probably even less than that. We don't want anything blinding and the lighting will mostly be subdued (more of an ambient glow than any sort of glare).

It'll be tasteful. We don't do any projects that are gimmicky or tacky. And if we put it in and it does end up appearing that way then it'll be pulled right back out. I'm just trying to get a better idea as to how to set it up on the Arduino. I did a little research on the map() function but the explanations don't make a lot of sense to me. Could someone explain it a little better in laymen's terms for me? I know it's a noob question but I'm not afraid to admit that I simply don't know how something works.
Logged

Pages: [1]   Go Up
Jump to: