Injection of Arduino inside car radio using I2C - Page 1
Forum section: electronics / projects

author: latonita
author_rank: Newbie
timestamp: June 23, 2015, 04:53:03 pm
content: Hi, i'm a beginner and this is my first project, except for LED-blinking with and without arduino :)I'm a programmer, with some basic knowledge of electroengineering back in uni 15 years ago.What I would like to do:- plug in bluetooth receiver into car radio, use it instead of CD (which apparently died and i removed it from inside of head unit)- car radio head unit based on SAA7709 chip, everything is I2C interconnected insideWhat I have done:- put BT receiver (H166) inside. Got horrible noise if i power it from car (adapter, +5 from inside of radio)- put Arduino Pro Mini inside, hooked up to existing radio I2C network straight to SDA/SDC line.- no extra components added - only wires- wrote simple logic - i ask sound process which mode it is in every second, if it is CD then i just change input to AUX. if check fails for any reason - it will just check again next time (in 1 s)What problems I have:P1. Ground-loop noise and BT RF interferenceP2. Two or three mini Arduinos died if stay on for more than an hourP3. BT is always on and drawing current and also became unresponsive after some timeP4. Looks like existing +5V is not enough for Arduino + BT Module. sometimes radio reboots :)P5. Sometimes Arduino got stuck, need to reset itP6. Quite often Arduino hangs whole I2C bus and then only full hard reset works (taking radio off the dashboard and disconnecting power terminals)My investigations/what i've done after first triesP1. First I put DC-DC isolated converter PEAK P6AU-0505ELF, got it for $1. It almost removed noise. Then I put inside all three lines (Left,Right,Sound ground) polarized capacitors. + to Bluetooth, - to radio. No noise at all.P2. [???] Have no idea, but i think i want to put 1k Rs on every pin i see an useP3.  I tried to control N-mosfet with Arduino to switch on BT module. DC_DC always connected to +5v, i switched ground on and off. Worked great.P4. [???] I found 9V which has enough current. Put LM7805, however i didn't like idea of swithchin ground on/off. Put P-MOSFET to turn 9V on and off before LM7805. Haven't tried it yet.P5. [???] I wanted to only powerup everything when radio is on. Found STANDBY pin on TDA amplifier which is +10V when radio is on.However, i read that i CAN'T have arduino OFF being connected to I2C bus. it will hang bus.I suppose i need it running all the time, but to prevent glitches and reboot Arduino to send reset signal when I power on my radio. I'm hope simple RC circuit + BC337 can pull down arduino's reset pin to ground for a while.P6. [???] Have no idea what is it. At first I turned off internal arduino pull-up for SCL/SDA pins and it actually behaved strangely. tried to measure voltage between GND and i2c pins - one pin looked like floating, another looked pulled down.When i connect arduino with i2c pullups off to radio's i2c bus it hangs whole bus.So i switched internal pullups back on and thought that maybe 2k Rs will help not to fry arduino. maybe 1k will be enough to.Schematics notes================My schematics are here:https://easyeda.com/editor#id=GAgarl1VP7Also the same picture is attached.Note #1. Transistors are what I found at home and selected models seem to work :)picture #1R9 to limit current from TDA STDBY and R10 to limit current from Arduino.picture #2this whole thing is strange to me :) i don't know i2c speed (its either 100 or 400), and i don't know existing i2c bus capacitance. have no tools to measure it.picture #3R4 limits current from arduinoD1 not sure why :) do i need it?D2 i suppose shall work as flyback diode because i think DC-DC converter has some inductance inside.Questions:==========P1. Not sure which polarized caps i put - something that i got from old motherboard. 4.3V, 1uF i think.Which caps shall be there? :) I haven't noticed any sound quality drops so far.P2. I'm not sure why arduinos died - power looks to be very stable. i suppose it is current which kills via i2c line.will Rs of 1k help me? Arduino pins i suppose are 40mA capable. it is 5v. Omhs law gives me 125Om, with 1k it shall be 5mA. Will work i think. or won't?P4. That shall work i think.Question - is there a real need to control VCC with P-mosfet? or I can control GND with N-mosfet . Will everything be okay with 7805 hanging on with high potential? ha-ha, its just that i have only one P-mosfet around :) and about dozen of N-mosfets from dead motherboard. :)P5. Will this work at all? Simulation in circuit lab shows 40ms on the ground. Will this be enough?BTW, I actually think i dont need pullup, it is on arduino board already. shown on picture just to have an idea whats happening.P6. Any comments/thoughts here?Any general thoughs? maybe some items are redundant.

author: fabialbo
author_rank: Newbie
timestamp: July 28, 2018, 07:11:20 am
content: Hey latonita,Great project, I want to do the same with a SAA7708 which works almost identically.Did you finish your project successfully?cheersFabian

author: latonita
author_rank: Newbie
timestamp: July 31, 2018, 05:25:27 am
content: Hello FabianSuccess is questionable)Yes it was working.No, I gave up this way)Two major issues came up:1) new master on i2c bus lead to bus lock up, since originally head unit was not intended to have two masters. To avoid this I had to carefully sniff bus and find bursts of data. Find typical bursts and timings, so my transmission is always done is 'quiet' time.2) front panel of head unit was doing all dsp configuration every time you select new mode. Including noise suppression filters an do on. When I was switching to AUX manually I had clicks from engine working.Finally, I tried another way - reverse engineered my Jeep's can bus and was telling radio over Can bus that I have special entertainment system installed and then head unit was enabling AUX input with all proper settings and noise filters. And in this version it works great.