This is my first post on the forum, I just started looking into Arduino and I was hoping someone could give me some guidance on the project I'm attempting.
I need to read resistance on an input pin this much I have figured out. I've got a series of buttons I want to monitor to trigger events on the other side (Output) Here are the resistance ranges
1). Open Circuit nothing happens
2). no resistance triggers a cancel
3). 610.5 - 624.5 Ohm outputs to a signal of 2700 Ohms
4). 1838 - 1877 Ohm outputs a signal of 820 ohms
5). 202.5 - 208 Ohm send a signal to turn on a LED and pulse a signal like a flip flop switch does. (on/Off)
So I'm sure this is not 100% clear so let me just ask this
1). I know I can do the detection on the input but can I do an output generating a resistance range
2). Is it possible to use the analog input to control an analog output action like the switch, I know I can do the LED or Light.
I'm converting a steering wheel from a newer model car to an older car. I want to adapt the cruise control buttons on the steering wheel. But the older car has the ON/OFF on the console and the Cancel/Resume/Accel etc on the column. I know can mode the buttons on the newer steering wheel with the different resistor values but I'm not sure how to adapter the on off from the new steering wheel that uses resistance when the old one seems to just be a momentary switch where you push on it sets to on, tape in the other way it goes off and resets to off when the car is shut off. I don't think that uses resistance probably a voltage sense Pos or to gnd.
but can I do an output generating a resistance range
No.
Is it possible to use the analog input to control an analog output action like the switch,
A switch is not an analogue output. The Arduino Uno has no analogue outputs.
1). Open Circuit nothing happens
2). no resistance triggers a cancel
What is the difference between these two?
You have to put a pull up resistor between 5V and the analogue input Use a 1K. Then apply your resistance to the analogue input as well. See the numbers you get out and use an if statement to select what function you want to do depending on the input value range.
The analog inputs measure a voltage so you need to arrange your resistances to generate voltages in the range 0 - 5 volts. A voltage of 0 will give a value of 0 and 5 volts will give 1023.
Then your code could be something like
voltsVal = analogRead(A0);
if (voltsVal > 1000) {
// do something
}
else if (voltsVal > 873) {
// do something else
}
etc
etc
However, if you have a series of buttons would it not be easier to treat them as digital inputs?
I'm not sure like I said this is my first project, I really don't work with electronic design. All I know is that each switch on the steering wheel has a resistance value. When the module it's connected to sees a certain resistance it triggers and event. The switches are all on the same two wires.
It wasn't the answer he wanted, so he's looking for more.
I've done a little work with this kind of cruise-control switch. I've never hooked an Arduino to it but it should not be difficult.
Yes, you can generate a resistance as an output - you just need a digital potentiometer. Now the car system is probably using 12v and getting this interfaced to the 5v Arduino will require some real thinking and imagination but it's not impossible.
I would not choose the digital potentiometer as my first option. The car's cruise control is going to read that input exactly the same way that the Arduino does - it will have a voltage divider and it will be measuring the voltage. It may be better to use an Arduino's PWM output with an appropriate transistor to bring the voltage level up and a resistor+capacitor smoothing circuit to turn the square-wave PWM back into a voltage.
Any wire that leaves the Arduino box needs to have protection inside the box. Imagine any wire (including power) is accidentally shorted to +12V or ground. What will that do to your circuit. Also remember that spikes over 16V are very possible, so all components in the protection network should be rated to 25V or better.