Author Topic: Adding a horn on a delay: where to begin?  (Read 7963 times)

0 Members and 1 Guest are viewing this topic.

Offline vmalletTopic starter

  • Regular Contributor
  • *
  • Posts: 87
  • Country: us
Re: Adding a horn on a delay: where to begin?
« Reply #25 on: April 20, 2019, 12:48:28 am »
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 :)
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Adding a horn on a delay: where to begin?
« Reply #26 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.

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.
 

Offline vmalletTopic starter

  • Regular Contributor
  • *
  • Posts: 87
  • Country: us
Re: Adding a horn on a delay: where to begin?
« Reply #27 on: April 20, 2019, 05:44:33 am »
Add a 300mW 4.7V Zener diode across RH2, anode to ground, to provide some input protection for the MCU.

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.

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.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Adding a horn on a delay: where to begin?
« Reply #28 on: April 20, 2019, 08:46:29 am »
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.
 

Offline vmalletTopic starter

  • Regular Contributor
  • *
  • Posts: 87
  • Country: us
Re: Adding a horn on a delay: where to begin?
« Reply #29 on: April 21, 2019, 02:27:58 am »
Very help explanation of how we get to choose 4.7v for the zener, thanks!

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 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?
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4705
  • Country: au
  • Question Everything... Except This Statement
Re: Adding a horn on a delay: where to begin?
« Reply #30 on: April 21, 2019, 03:05:19 am »
I should mention most auto stores should have timer modules with a pot to set the delay.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Adding a horn on a delay: where to begin?
« Reply #31 on: April 21, 2019, 03:32:07 am »
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?
Yes, but the order of magnitude higher impedance makes it more sensitive to noise pickup and its also more sensitive to Zener leakage.  Muntzing it to save one resistor isn't (IMHO) worth it.

I would suggest also adding a small capacitor across the Zener to filter out RFI.  10nF should do nicely.   Otherwise there is a (small) risk of the horn triggering if an active mobile phone is near the control box.

@Rerouter: That's probably the right way to go if you are in the custom auto business, but the O.P. isn't going to learn much electronics from simply using an off-the-shelf module.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4004
  • Country: nl
Re: Adding a horn on a delay: where to begin?
« Reply #32 on: April 22, 2019, 04:26:14 pm »
Whether you use an LM555, a 4017 or a microcontroller, when you want to build a reliable circuit the power supply section is very likely the most difficult to get right.

For example, automotive power supplies should be able to handle "load dump" situations, where the voltage can have short peaks of 80V.
 

Offline vmalletTopic starter

  • Regular Contributor
  • *
  • Posts: 87
  • Country: us
Re: Adding a horn on a delay: where to begin?
« Reply #33 on: April 22, 2019, 09:38:20 pm »
Yes, but the order of magnitude higher impedance makes it more sensitive to noise pickup and its also more sensitive to Zener leakage.  Muntzing it to save one resistor isn't (IMHO) worth it.

Thanks. I was more wondering about the additional voltage drop over the new resistor; but I've since then understood that given that the input pins have super high impedance, there will be effectively no current flow into the pin and so pretty much no voltage drop over the extra resistor. Makes sense.

Quote
I would suggest also adding a small capacitor across the Zener to filter out RFI.  10nF should do nicely.   Otherwise there is a (small) risk of the horn triggering if an active mobile phone is near the control box.

Noted. Would you have a short explanation of how that can happen? Or where to read about this type of interferences for a newbie? :)

I should mention most auto stores should have timer modules with a pot to set the delay.

Someone else mentioned this early in the thread but like Ian said, it's really all about learning. And I've sure learned plenty!

Whether you use an LM555, a 4017 or a microcontroller, when you want to build a reliable circuit the power supply section is very likely the most difficult to get right.

For example, automotive power supplies should be able to handle "load dump" situations, where the voltage can have short peaks of 80V.

Have you taken a look at the latest schematic a few posts up? Could you comment on the current design of the power supply?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf