Electronics > Beginners

Forcing Accessory-Mode in Vehicle after stopping the engine

<< < (3/4) > >>

Mechatrommer:

--- Quote from: Sebastian S. on January 19, 2019, 09:50:10 am ---
--- Quote from: Mechatrommer on January 18, 2019, 11:41:54 pm ---yes. but your schematics lacks limiting resistor and clamp diodes to clamp 12V input to 5V input. if you have extra unused mcu pins, i suggest breaking them out so later if you want to add inputs you only need to solder to pcb traces. and i suggest add low side bjt switch to relay coil instead of directly supply from mcu pin to protect it from overcurrent stress. ymmv.

--- End quote ---
I will have to look further into that, but can you explain what you mean by clamping 12V input to 5V input? I understand it as bridging both sides with a resistor and a diode. What're the benefits of doing so?

--- End quote ---
you cannot simply feed 5V mcu with 12V level input, it will burn, let alone nasty spikes generated by the igniter. refer to the attachment... i've provided 3 ways for passive 12V to 5V level shifting. there is active way using transistors but i dont recommend it for complexity reason unless you are building super robust multi K$ device. also shown is how you control 12V relay from an mcu using low side npn bjt, fwiw ymmv.

Sebastian S.:
I see, that makes sense. So you're not talking about the VDD input but about the Input pins where the 12V battery is currently connected to, correct?

Implementing one of your solutions would drop that voltage to levels the chip yould take. Now my question is, according to the datasheet this is already implemented with each I/O pin by default, at least that's how I understood it.

mvs:

--- Quote from: Sebastian S. on January 19, 2019, 11:06:17 am ---Now my question is, according to the datasheet this is already implemented with each I/O pin by default, at least that's how I understood it.

--- End quote ---
PIC has clamping diodes on each GPIO pin to power rails, but nothing to limit current flown through. So you will need at least a resistor connected in series. I would go for 10K - 47K here.

Do not forget also to put sufficient static load on power rails, clamped current needs to be consumed some way. Power indication LED is usually quite good solution for this.

Mechatrommer:

--- Quote from: Sebastian S. on January 19, 2019, 11:06:17 am ---I see, that makes sense. So you're not talking about the VDD input but about the Input pins where the 12V battery is currently connected to, correct?

--- End quote ---
yes, and yes you are correct about internal clamp diode, you may not installed external diode, but you'll need limiting resistor, 10Kohm is advisable.

viperidae:
If I were you I'd do a proof of concept first.
The last thing you want is to spend a whole bunch of time designing and building something to find out you can do it.

It's possible the ECU will detect the ACC line still active after turning it off and throw a fault code, switching on the check engine light.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod