03-20-2021, 12:35 PM
03-20-2021, 03:00 PM
thank you!
Looking forward to seeing the steering wheel portion more close up The whole system looks great, do you have it in the car yet?
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
I had a partial setup in the truck for testing but the current incarnation is still on the bench.
I am still looking for my notes on resistance measurements so you can compare with your vehicle but they should be the same. A steering control only version of my code is included below. The analog constants are tuned for a 3.3v pro micro and my specific resistor choices.
My stock stereo had a 10 pin (I think) connector with just 3 pins populated for steering control. The left pin is signal 1, the center is ground, and the right is signal 2. I used two resistors between the pro-micro analog inputs and 3.3v regulated Vcc to create a divider network when the two signals are connected. Pro-micro 3.3v ----( 97 ohm )---- A2/pin 20 ------ signal 1 Pro-micro ground ------------------------------------- signal ground Pro-micro 3.3v ----( 1.19 ohm )---- A1/pin 19 ---- signal 2 Those are the actual resistor measurements, the color code markings read 100 and 1.2 ohms. That's all I have for now. I'll keep looking for my notes and put more details in a project thread when I find them.
03-22-2021, 12:57 PM
wow, this is great!
I'm going to try and get some time this week to get this working on a breadboard on my desk. Thank you for this. Question: I hope I purchased the same board as you, is this what you have? https://www.amazon.com/gp/product/B00AFY...00?ie=UTF8&psc=1
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
I actually used the 3.3v version of one like this: https://www.amazon.com/ARCELI-Atmega32U4...ref=sr_1_6
The official Arduino Micro you ordered uses the same ATmega32U4 and should work fine with my steering control code. The main difference is that it appears to be a 5v µc running at 16MHz vs the 3.3v µc at 8MHz I used. The keypresses are sent over the USB cable to the Pi so it should not matter for that use. I went with 3.3V because I am also connecting some IO pins directly to the Pi GPIO and that needs to be at the lower voltage. The switch to 5v should not effect anything, just connect to the 5v pin on the micro instead of the 3.3v in my diagram. The analog inputs on that board will convert 0v-5v inputs to values 0-1023. If you get unexpected results you can uncomment the serial debugging lines and use the serial monitor in arduino IDE to see what the analog readings are when you press a button. You could debug this from a laptop in the car by temporarily substituting regular characters for the KEY_F7 and KEY_F8 and opening a text editor to see the key presses sent from the micro. Alternatively you could measure the resistances between the ground and the two signal pins when no buttons are pressed and when each one is pressed and simulate them on the bread board. That's what I did with one push button for the signal that seemed to change the same no matter what button was pressed and a jumper wire to select the specific resistance on the other line for the particular button to be simulated. Here is my messy test circuit using various resistors from my parts bin in parallel and series to approximate my measurements from the truck: The button switches signal-1 between two resistances indicating key pressed/un-pressed and the orange wire was moved to select the resistors for a specific key on signal-2. Unfortunately I still have not located the piece of paper I did my resistance and analog reading calculations on.
03-23-2021, 03:27 PM
If you still have the factory radio available, follow the directions I posted in post #17.
Read those voltages and then unplug and check the resistances, and we'll be able to calculate what you need.
03-24-2021, 04:09 PM
Yes still have the old stereo, but not ready to do this project quite yet. It's actually quite a bit of work to get the stereo out, have to disassemble some of the center console and some of the dash to get to it.
But I remembered the other day that removing the actual switch in the steering wheel isn't that difficult to do. I did it a few years back when I replaced the LEDs to a different color. I could remove that again, and measure the resistors right from the board. Just need to get more time to do this stuff.
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
03-24-2021, 11:58 PM
That's too bad. My Tacoma is so easy to take apart. The heater controls pop out with clips, then unplug with 2 plugs, then 4 10mm bolts and the radio pops right out.
That reminds me, the wife is upset that the last time I took it apart, I forgot to plug in the radio antenna. Gee, darn, no radio reception. I never listen to the radio anyway, but she does. You could probably do the voltage checks from the button side of the harness as well as the resistance checks. There should be an plug to that side of the steering wheel that has your three wires on it going to the clockspring. I'd unplug it from the board to make sure you get the right resistance values. Testing resistance in circuit can give some weird results. But yeah, too many projects. I had to spend 5 hours out in the garage yesterday, as I noticed that some of the 6" thick Styrofoam insulation 4'x8' panels on the ceiling were starting to fall down. It was somebody's bright idea to put them up with 7" long nails, so not much grip. I guess all the temperature changes lately have caused some nails to pop out. Occasionally a nail will fall out of the ceiling. So far none have hit a car. But it's a 14' ceiling, and I don't have a tall enough ladder. But I do have scaffolding. That's a pain to set up, take down, and move around though. I know that Hate is a strong word, but I HATE that ceiling.
03-25-2021, 02:48 AM
(This post was last modified: 03-25-2021, 03:08 AM by Chrisfromwa.)
oh man I wish mine was easier to get to like that!
But I think the getting measurements from the buttons will work. If I remember right, only a couple screws hold the airbag in and maybe same for the switch. I remember it not being that big a deal. You wouldn't happen to have like a schematic on how you actually connect the wires to the Audrino do you? I've never used one of these before, so not sure how these wires connect. Is it basically this Ground/negative side from the buttons to a GND pin on the arduino Positive side from the vol/scan buttons to A1 Positive side from the mode button to A2 and do I have the right pins selected in this pinout I found? then USB to PI. and totally hear you about garages. Been trying to finish putting sheetrock up in mine for the past 3 months. I hate sheetrock.
Do you have a passion for cars?
Then create a page for it at Car Audio Central A great place to document and share your OpenAuto Pro projects.
Yep, those are the right pins. You can use any of the analog pins by changing the definition at the top of the code. I would assume the resistances are standardized across Toyotas so hopefully the code works as is. If not try swapping the two signals but I think you have it right. The 'mode' line changes no matter what button is pressed and only has two values and the other line changes for any combination of buttons but mode. My code only handles one button at a time but could probably be extended to multi-button presses.
USB will supply power and receive key presses so you shouldn't need anything else but the resistors I previously mentioned between the analog inputs and 5v on the micro and a line from the third pin on harness to ground on micro as you mentioned. The resistors were chosen to maximize the analog voltages over the full sensing range. I put an ASCII 'schematic' under the code in my post above. I'll try to check in daily and see how you are getting on. (03-24-2021, 11:58 PM)jhornbr225 Wrote: That reminds me, the wife is upset that the last time I took it apart, I forgot to plug in the radio antenna. Gee, darn, no radio reception. I never listen to the radio anyway, but she does. LOL, My wife had to put up with a big hole in our Tacoma where the head unit, clock, airbag, and hazard switches were for over a month while I tinker with this replacement. We both avoid the radio except an indie station that barely comes in but I put the stock unit back in at her request, mostly for aesthetics and airbag. P.S. The stock head unit voltage should not matter. The controls are an unpowered resistor network and should work with any reasonably low voltage |
|