Hi folks, I'm brand new to the forum and not exactly an electrical wizard (to say the least). However, I am working on a custom automotive project and could use a bit of advice. I have searched the forum and picked up a bit of info but still need a bit of help due to my neophyte status. Here's my project.
I am creating some "steering wheel" controls for a stereo out of some unused buttons on the wiper and indicator stalks in the car. There are 5 buttons on these stalks and 4 of them simply pass through +ve power when depressed (momentary buttons). However, one button acts oppositely in that +ve is constantly supplied and when the button is pressed it interrupts the circuit. I need to convert these digital signals (on/off) into discernible (differing voltages) analog outputs through a single wire. The steering wheel control "module" that this output wire would connect to interprets the differing voltages and sends the appropriate signal to the stereo.
Tech support at the manufacturer suggested I build a "resistor ladder" to differentiate the signals voltages. I get the concept but I have a few challenges with a basic resistor ladder including:
the input voltage is likely to vary between 14.4v and 11v which makes the output of the resistor ladder inconsistent (I could add a voltage regulator for each digital input line - more soldering, parts, blah, blah blah)
The 5th button that constantly passes +ve through is a problem in the resistor ladder as the module neither likes constant +ve being sent to it nor can differentiate a 0v signal (I could use a relay to make this button work like the others - same as above though, more "stuff")
So, in my research I can across the Arduino and wondered if
A) the Arduino Uno could be used as a resistor ladder (I believe so)
B) it could be used to deal with my 5th button problem with the appropriate logic
C) serve as a general voltage regulator so when the voltage in the car varies the output is consistent
D) eliminate all the soldering and mess required with building your own resistor ladder
Its my understanding that the max output for each pin is 5V. Id like it higher but since I only have 5 buttons I suppose I could go with 1,2,3,4 and 5v for each output. I don't anticipate pushing multiple buttons at the same time and needing a different output for simultaneous button presses (although I would like it if pressing buttons simultaneously gave me NO output at all to prevent possible issues).
Is this feasible with the Uno? Would a novice like me have much difficulty with this project? Many thanks for any and all comments!
A) Yes, but not exactly. analogWrite() can simulate a variable voltage output. A digital pot is a closer approximation, very easy to control from Arduino.
B)Yes, but why not use that special button as the main feed in to the top of the resistor ladder?
C) It may be easier to just measure both voltages (supply and resistor network) and do the math.
What are you controlling with this resistor ladder idea? Is it a device you control and can reprogram? Why can't it connect directly to the buttons itself? If a button controller is necessary, can it talk to the unspecified-thingy by serial?
Hi and thanks for the reply. With regard to your answer A), since I'm not familiar with the programming aspect of the Arduino as yet, I'm assuming you mean it can be done. To be more specific about what I'm trying to accomplish with this, when any button is pushed the internal button conne3ctions will pass through the 12v power (exclude that 5th button for now). So, I would need the Arduino to sense the power coming through and generate an output equal to whatever value I program it for (1v to 5v) for as long as the button is held down for.
Now, I may have read that the Arduino can only accept a max of 5v in (the car would send between 14.4v and 11v). So, if this is the case I could add a resistor to the +ve feed to cut the voltage down to 5v or less to accommodate the Arduino. Is that more specific, does the Arduino only accept a max of 5v on the input terminals and is the answer still a yes (can it be a resistor ladder as described)?
On B), I can't use that 5th "special" button as you've suggested. As I mentioned in the original post, doing so would provide a constant +ve signal through the resistor ladder (if I built a basic one myself). The interface module that accepts these signals and converts them to a signal the stereo understands can't deal with a constant signal coming in (its expecting it to mean something). Also, if I push that button the signal is now 0v (circuit interrupted) and this module can't deal with a 0v signal which normally means "don't do anything". This is why I thought perhaps the Arduino could be programmed (for this button's input only) to output a signal when it sees 0v instead of a +ve signal as the other buttons would work.
As per C), I'm not sure what you mean here other than relating to building my own resistor ladder perhaps? (sorry if I'm being dim witted). As per the above, the goal of the resistor ladder in my application (whether hand built or mimicked by the Arduino) is to output a +ve signal of differing voltages based on which button was pushed. The problem with doing it via a traditional resistor ladder is dealing with this 5th button's "backwards" operation and the fact that the voltages output through the ladder will vary quite significantly (and make it so the module accepting them could have trouble differentiating them) based on the car's actual voltage output (Idle =12v, acceleration = 14.4v, weaker battery = 11 or 10v, etc.).
I'd put voltage dividers on all button wires, so that the Arduino can safely read the signals. Then output the button states to an R2R ladder, inverting the special button signal in code. Finally amplify the ladder output voltage, into the range expected by the device.