im looking for a little advice i normally just follow guides when making circuits so i dont have much understanding on how transistors work.
my idea is to create a true variable voltage which is dependent on what pin is triggered on the arduino,
this will be to control my car radio which responds based on the voltage applied to AD1 or AD2 on the radio.
The exact voltage does not matter as it is set on the radio unlike most radios that require predefined value for certain functions.
im fairly confident my resistor chain is correct?
what im totally unsure of is if the transistor will be saturated and just act as a switch no matter what digital pin goes low
would i need a final resistor on the base to avoid it acting as a switch?
or is my whole idea completely idiotic and wrong
Your test.jpg file seems to be corrupt.
thanks for letting me know its fixed now, i used the wrong extension
That circuit will not do anything useful.
Perhaps you should explain more clearly what you are trying to achieve? I am guessing that you are trying to create a variable resistance from ground to a pin on the radio which is at +5 V. Is that right? Or would a variable current sink do the same job?
the radio outputs 5v to a control stalk, the stalk outputs different resistance values to the radio inputs AD1 and AD2 for each button pressed. when pressing a button on the stalk the radio reads the voltage and stores it to a selected function.
my aim is to emulate the stalk with my arduino, i had the sketch up and running to convert the protocol my car uses to pwm but the radio doesnt seem to like pwm, i believe thats because it needs to see a true voltage.
Post has been corrected i made big mistake..
the radio has 5 wires 5v GND IR AD1 AD2, AD1 and AD2 are what sense the resistance to ground
Maybe you have to smooth the PWM.
Use PWM pin 5 or 6 (~1Khz).
A 1k resistor and a 10uF cap to ground has a settling time of ~50msec and a ripple of ~100mV according to LTspice.
If the stalk had IR (remote), you could turn the Arduino into an IR remote.
Uh... So what is the circuit that you're replacing?
I don't think you need a transistor for this at all, unless I'm missing something.
The radio is possibly reading the analogue voltage returned when the switch shorts out a section of R divider.
Do you know what the voltages are for the switches?
If he just needs a voltage to control something that uses it's ADC to get multiple buttons on one wire, he doesn't need a transistor at all, just a bunch of resistors... (assuming you're willing to use a bunch of pins for it, like you're proposing doing now). Hell, you could open up the old controller and use the same resistor values they did...
I do think that with an appropriate RC filter, you could probably generate the voltages with PWM.
I did try pwm at first but the radio picked up numerous voltages for 1 press, i didnt make a filter because i assumed the capacitor would also cause issues with delay while it charged up? (as you may have guessed im learning as i go).
i have now changed to a much easier way to achieve my outcome...for me anyway.
I captured the output from the remote control that is for the radio and modified my sketch to send the IR codes, it is now working as i planned apart from the IR led in my center console.
i wasnt actually replacing the stalk just emulating a resistive stalk like the Autoleads cables do.
The radio i have uses a resistive stalk where as my stalk works through the IBus (same as the kbus on the OBD port) so my intention was for the arduino to receive the ibus messages and convert them to resistive outputs for the radio.