Go Down

Topic: Resistor ladder "emulation" ? (Read 639 times) previous topic - next topic

elcouz

Aug 01, 2020, 05:35 am Last Edit: Aug 03, 2020, 05:18 am by elcouz Reason: update schematic for clarity
Hi,

I have a steering wheel control that I need to control with an Arduino. Coding is not an issue but I am wondering what is the best way to "inject" keypress into the Instrument Cluster ADC 5V signal.

Any ways to keep the steering buttons working at the same time (must not affect line resistance) ?

Digipot? DAC ?

Thanks!
Laurent

Also, I've attached the image as a file so you can download the better sized image.



PaulRB

#1
Aug 01, 2020, 10:44 am Last Edit: Aug 01, 2020, 10:53 am by PaulRB
Not really sure what you are talking about here or what you are trying to achieve. Is this a real car, an RC model car, a PC racing simulator set-up? What task do you want an Arduino to perform? Mimicking key presses from those 5 switches near the top-right of your diagram? What voltages are in those wires?

My best guess without further clarification would be to use opto-isolators. Duplicate the 5 resistor values (strange values, by the way, very precise down to 1 ohm) and mimic the switches with 5 opto-isolators driven by 5 Arduino pins.

Paul__B

My best guess without further clarification would be to use opto-isolators.
Won't work.  :smiley-roll-sweat:  Opto-isolators have non-zero "on" resistance.  Even 74HC4051 would not work except perhaps with carefully compensated values (its "on" resistance is already close to 68 Ω, so perhaps that would be quite easy!).

The resistor values are copied from the (SMD) resistor marking- 68 Ω, 120 Ω, 1k8, 300 Ω, 510 Ω.  I suspect the "182" is an error.  :smiley-roll:

MarkT

A set of reed relays or signal relays could be used of course, but to do anything smarter requires reverse
engineering how the existing unit senses the resistances - with constant current? with a resistor divider?
what voltages relative to ground does it use/assume?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

elcouz

Not really sure what you are talking about here or what you are trying to achieve. Is this a real car, an RC model car, a PC racing simulator set-up? What task do you want an Arduino to perform? Mimicking key presses from those 5 switches near the top-right of your diagram? What voltages are in those wires?

My best guess without further clarification would be to use opto-isolators. Duplicate the 5 resistor values (strange values, by the way, very precise down to 1 ohm) and mimic the switches with 5 opto-isolators driven by 5 Arduino pins.
I'm sorry if the diagrams are confusing it's the way Ford design them. The small numbers are pins numbers at the connector on the wire.

I made a quick drawing to simplify my question.





The resistor values are copied from the (SMD) resistor marking- 68 Ω, 120 Ω, 1k8, 300 Ω, 510 Ω.  I suspect the "182" is an error.  :smiley-roll:

This is in fact real resistor values . It's not SMD codes. Take a look at the diagnostic page of the steering wheel controls. Ford list the resistive value of each keypress. Since it's a ladder you need to add every resistor that the switch connect. The line is always 68 ohms no matter what. Ex: Right key = 68+121+182+301+511 ohms = 1183 Ohms. This fit with the following table.




A set of reed relays or signal relays could be used of course, but to do anything smarter requires reverse
engineering how the existing unit senses the resistances - with constant current? with a resistor divider?
what voltages relative to ground does it use/assume?
It sense voltage variation to be read by an ADC pull up at 5V DC.

Is there any other way beside mechanical ? I need to control some menus. The only unknown variable is the pull-up resistor ohm value at the ADC. But I suspect it's more than 1k Ohm resistor otherwise that would be hard on those 1/8w resistors on the steering buttons.

6v6gt

#5
Aug 01, 2020, 04:29 pm Last Edit: Aug 01, 2020, 04:43 pm by 6v6gt
Can you measure the current flowing when switch 5 is closed ? You should then be able to calculate the unknown resistor in the divider.

Edit:
Or probably easier, measure the voltage drop between the points marked ADC and GND when switch 1 is closed.

elcouz

#6
Aug 03, 2020, 04:47 am Last Edit: Aug 03, 2020, 04:48 am by elcouz
Can you measure the current flowing when switch 5 is closed ? You should then be able to calculate the unknown resistor in the divider.

Edit:
Or probably easier, measure the voltage drop between the points marked ADC and GND when switch 1 is closed.
Thanks I will have a look when I'm ready to implement (tear off the steering column covers to access to connector)



Could using transistors also works or it's better to keep it isolated from the circuit with mechanical reed relay?

Would a DAC also work ? Since it's the opposite of the ADC ?


I have experience with analog capture , just not the opposite.

Thanks ! :)

TomGeorge

Hi,
I take it that you will only have your emulation circuit connected and the real world circuit disconnected?

As you are working with car computer and unknown currents, can I suggest KISS.
Use small relays as the switches.
That way YOUR control system is isolated from a VERY EXPENSIVE control system.

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

elcouz

Hi,
I take it that you will only have your emulation circuit connected and the real world circuit disconnected?

As you are working with car computer and unknown currents, can I suggest KISS.
Use small relays as the switches.
That way YOUR control system is isolated from a VERY EXPENSIVE control system.

Tom.... :)
The circuit controlled by the Arduino will be in parallel otherwise I will loose the buttons from working on the steering.

I know my question is odd but the end result of this project is a "macro" that turn off traction control by emulating key press. Yes. it is deep in menus and take long time to reach the options in the car system menu. Why did they remove the physical Traction Control OFF switch ... I guess money saving.

I must retain the keys on the steering wheels to do other things like see Trip , odometer and fuel economy.

Reed relays will work for sure, I was just wondering what are the other possibilities. Just brainstorming!

I just feels using mechanical relays is even more a hack than it already is!


What about this schematic ? What do you think guys?





TomGeorge

Hi,
No the two systems will interact.
When your arduino output is HIGH on say D0, that will pull the 68R HIGH, when it is LOW it will gnd the 68R.

The Arduino outputs are HIGH/5V or LOW/gnd.
You are assuming the LOW is open circuit like the switches.
OFF is not float it is a digital level, in this case gnd.

Tom... :)
Like I said KISS.
Everything runs on smoke, let the smoke out, it stops running....

elcouz

Hi,
No the two systems will interact.
When your arduino output is HIGH on say D0, that will pull the 68R HIGH, when it is LOW it will gnd the 68R.

The Arduino outputs are HIGH/5V or LOW/gnd.
You are assuming the LOW is open circuit like the switches.
OFF is not float it is a digital level, in this case gnd.

Tom... :)
Like I said KISS.
Wait... all GPIO can be tri-stated  ... Low (Sink) High (Source, we will not use in this case) and Float/Hi-Z (Third State)

digitalWrite( D0, LOW ); Tell output low (connect resistor to ground when on output mode)
pinMode(D0, OUTPUT );  // Sink, we are connected to the resistor [Key press]
pinMode(D0, INPUT ); // Tri-State / Hi-Z / High Impedance AKA Floating (pin disconnected) [Key Released]


I'll keep in mind KISS. :)

Laurent

WattsThat

So how are you going to match the Arduino supply voltage to the mcu supply voltage?

FWIW, if you persist with this folly and you're using an Uno/nano or similar, don't use D0 or D1. Already in use.
Vacuum tube guy in a solid state world

elcouz

So how are you going to match the Arduino supply voltage to the mcu supply voltage?
As long as the car ADC line stays pull-up at 5V, I don't see what's the problem. Maybe put a diode on the output of the arduino resistor ladder so it protects from any getting any backfed voltage.

Arduino is sharing the same ground as the car.

FWIW, if you persist with this folly and you're using an Uno/nano or similar, don't use D0 or D1. Already in use.
Nothing foolish, I was just trying to see if any other alternative than slow bouncing emf generating clicky relays.

The outputs numbering was just for sake of simplicity.

Paul__B

Maybe put a diode on the output of the Arduino resistor ladder so it protects from any getting any backfed voltage.
You clearly do not comprehend how this resistor ladder works!  :smiley-roll:

Nothing foolish, I was just trying to see if any other alternative than slow bouncing emf generating clicky relays.
I did explain in #2.  Never mind.  :smiley-lol:

Relay bounce is irrelevant here.  :smiley-eek:

In fact, you absolutely need the relays to isolate your Arduino ground from the vehicle ground.

bigev

I have a steering wheel control that I need to control with an Arduino. Coding is not an issue but I am wondering what is the best way to "inject" keypress into the Instrument Cluster ADC 5V signal.

Any ways to keep the steering buttons working at the same time (must not affect line resistance) ?

Digipot? DAC ?

Hi, I have just finished testing a similar concept to what you are after in my car.

SWC (resistance ladder) -> Arduino -> Digipot -> Car Stereo

Whilst your output may not be the same as mine it sounds like the theory on capturing the analogue buttons is. What you do with that data once captured could be anything, output via OBD module for example.

I do not have a complete write up yet but here is my code, fully functioning in the car (also a Ford), with some reference links to follow for more detail until I've fully documented it.

https://github.com/bigevtaylor/arduino-swc

The key thing for me was reading the buttons and capturing different 'events'. Click, Release, Double-click, Longpress. Once I sorted that part out the rest all fell into place.

AceButton was key here for me.

Go Up