Electronics > Beginners

Adding a horn on a delay: where to begin?

<< < (6/7) > >>

vmallet:
I updated the design a bit to get rid of the pre-made arduino board and use an MCU directly (ATTiny85v) and replaced the switching transistor to a mosfet to try it out. I then spent some time trying to lay out the circuit on a protoboard and I realized it's harder than it looks!

Here's the updated schematic:


and here's the assembled version, ready to be mounted somewhere in the car...


Thanks everyone for the help. There are still some unanswered questions earlier in this thread and if someone found time to answer them it would be very helpful :)

Ian.M:
Add a 300mW 4.7V Zener diode across RH2, anode to ground, to provide some input protection for the MCU.

Get a ratchet crimping tool to do insulated spade connectors for the relay terminals, as soldering heavier wires to them typically FUBARs the relay because the plastic base usually isn't very heat resistant, so the contacts go out of alignment.   You've probably got away with soldering the coil wires, but I'd still scrape off the solder and re-do them with crimp terminals: Auto relays go bad more often than one would like, so you might as well plan for future replacement.

vmallet:

--- Quote from: Ian.M on April 20, 2019, 01:59:49 am ---Add a 300mW 4.7V Zener diode across RH2, anode to ground, to provide some input protection for the MCU.

--- End quote ---

Ah nice, yes I was wondering how a spiky voltage would work from this line but wasn't sure how to protect it. I have a 5.1v zener, maybe I can use that until I find a 4.7v (attiny85 datasheet says "maximum voltage on any pin is Vcc+0.5v" i.e. 5.5v in my case; 4.7v would be safer overall). Now I have to figure out how to retrofit it on the board!


--- Quote ---Get a ratchet crimping tool to do insulated spade connectors for the relay terminals, as soldering heavier wires to them typically FUBARs the relay because the plastic base usually isn't very heat resistant, so the contacts go out of alignment.   You've probably got away with soldering the coil wires, but I'd still scrape off the solder and re-do them with crimp terminals: Auto relays go bad more often than one would like, so you might as well plan for future replacement.

--- End quote ---

Yep all the lines to/from relay / compressor / battery were going to be crimped, it's hacked up on the bench just to test it out. Thanks for the extra explanation.

Ian.M:
5.1V will be OK if its close tolerance (+/-5%).   However if its +/-10%, it wont be very effective if its at the upper end of its range: 5.6V.  Also that assumes the 5V rail is 5.000V  If its actually 3% low, that's 4.85V, so you *MUST* clamp at under 5.35V, which is cutting it close for even a 5% Zener.  Therefore its preferable to  clamp at 4.7V in a 5V system.   You can't go much lower or you wont guarantee to be over the logic '1' threshold voltage.   

Adding a 1K resistor between the potential divider + Zener and te I/O pin would also help - if the Zener clamping voltage is slightly too high during a big spike, it limits the current into the MCU's internal clamping diode (to Vcc).

I don't see much problem fitting it in - you are wasting a lot of space accross the board from the board to the 4 way terminal block.

vmallet:
Very help explanation of how we get to choose 4.7v for the zener, thanks!


--- Quote from: Ian.M on April 20, 2019, 08:46:29 am ---Adding a 1K resistor between the potential divider + Zener and te I/O pin would also help - if the Zener clamping voltage is slightly too high during a big spike, it limits the current into the MCU's internal clamping diode (to Vcc).

--- End quote ---

I see. As an alternative, could I limit the current by increasing the values of RH1/RH2 while keeping the ratio I was going for (and skipping the 1k)? Like 33K & 51K, or something in between? Is there a drawback in doing this?

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