| Electronics > Beginners |
| Adding a horn on a delay: where to begin? |
| << < (4/7) > >> |
| vmallet:
--- Quote from: Zero999 on April 02, 2019, 08:52:34 am ---When the zener conducts, the resistor will limit the current to a safe level. --- End quote --- Ok cool. Now, would putting R1 in series with the zener (either before or after) instead of upstream of the whole thing make sense if its only purpose was to limit the over-voltage current? In the case of over-voltage, how do you size R1 (in terms of power ratings)? Would I have P = (Vsource - Vzener(15V)) ^ 2 / 22R ? Can we expect that over-voltage will always be spiky in nature and not a sustained high voltage and use that as part of the sizing? With R1 being where it is, it also limits current going into the regulator. When the load starts drawing more current, the voltage drop over R1 is going to increase; wouldn't that be a problem where eventually R1 will drop enough voltage that the input to the regulator will be too low? --- Quote ---They're decoupling capacitors. The symbol for C1 is polarised and C2 non-polarised. It's fine to used non-polarised for both. Be careful with MLCCs, they often have a much lower capacitance, when the voltage is near the rated value. This circuit will still work with lower capacitance values. Indeed, you'll probably find it works with no capacitors, but it just won't work very well and you may have problems with the power supply voltage dropping, causing the microcontroller to crash and reboot randomly. --- End quote --- Ah I see. My 10uF is a 10V cap so clearly too small from a voltage point of view; the .1uF is 50V; and now I see why the .1uF is bigger physically than the 10uF when I would have expected the difference to be the other way. I have a 15uF 50V electrolytic at hand, would that be a good replacement for the 10uF? (I don't think I have understood how to size coupling capacitors yet, I'll get there..) --- Quote ---I notice you appear to be using the LM7805, which is fine, but bear in mind it's rated to 1A and often doesn't current limit until 2.2A, so if there's a short circuit, R1 will get hot. Using a higher wattage resistor >0.5W or lower current regulator, such as the LM78L05, which will limit the current to <220mA, will prevent this. I meant to write LM78L05 on the schematic: LM7805L was a typo. --- End quote --- Ah-ha! I see, yes I couldn't find the LM7805L and "5V voltage regulator" sounded like a right description when I found the LM7805. If I needed more current (for example to drive LED strips to bling the car out -- just kidding) then LM7805 would work but I'd have to be careful with R1 (re: power and voltage drop question from above); otherwise I should get a LM78L05 and be in a safer zone. Last question around the power supply: I was thinking of using a mini arduino 5V board that I had around (see pic). Overkill but it's all in the name of learning :) This thing has its own 5V voltage regulator (supposedly a microchip mic5205) and can be fed via its regulator, or past the regulator if the source is already regulated. In my case, should I bypass its regulator, or be double-safe and feed the output of the power supply to its regulator? (arduino mini schematic: https://www.geeetech.com/Documents/Arduino%20Pro%20Mini%20Schematic.pdf) (mic5205 regulator datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/20005785A.pdf) |
| vmallet:
--- Quote from: Ian.M on March 28, 2019, 11:18:48 am ---However, sticking with the idea of building the delay from discretes, here's a two transistor discrete Schmitt power-on delay circuit. --- End quote --- I'm trying to wrap my head around this one but it is very nebulous at the moment. I tried to put it together on a breadboard and I realized I don't understand where to even inject the source voltage. Ground is easy, but where does my + go? Is it where C1/D1/D2/L1 all join? But if so, this is also where "out" is coming from. So when power comes up, why would the load (connected directly between power and ground) care about the rest of the circuit? As a side note I tried loading the circuit in LTSpice and running it (after bridging the switch it doesn't know about with a wire) but I can't say I saw anything meaningful on the little graph window that shows up. I'm going to have to do a few LTSpice tutorials, so many things to learn! |
| Ian.M:
I drew it up as a straight power-on delay. The rail at the top is Acc (14V accessory power) from the ignition switch. The switch symbol is actually redefined as a behavioural resistor* (Ctrl-RightClick on a component to get to the dialog that lets you override what SPICE sees it as and modify hidden parmeters if permitted for that component type). I changed the prefix to R and the value to R=sw(I(L1)>30mA) and that (with the .func sw on the schematic) makes the switch act as relay contacts, ON if the current through L1 is over 30 mA. However if you don't have the swSPST.asy symbol, LTspice looses all that when it opens the schematic, and one of the *MAJOR* problems with LTspice is keeping track of what symbols and models are standard and what are custom or 3rd party. Probably the easiest fix would be to paste this: --- Code: ---Version 4 SymbolType CELL LINE Normal -15 0 -33 0 LINE Normal 1 -15 -15 0 LINE Normal 15 0 0 0 LINE Normal 31 0 15 0 CIRCLE Normal 3 -13 -1 -17 CIRCLE Normal 2 2 -2 -2 PIN -32 0 NONE 8 PINATTR PinName 1 PINATTR SpiceOrder 1 PIN 32 0 NONE 8 PINATTR PinName 2 PINATTR SpiceOrder 2 --- End code --- into a text editor and save it as swSPST.asy in the same folder as you downloaded the .asc file to then reopen the unmodified .asc file. Alternatively simply delete the switch and load as its sufficient to plot the current through the relay coil. When you run the sim the plot window comes up empty unless you have a saved .plt file. With the plot window open, and no specific schematic drawing tools active, click a node (connection) to plot a voltage and click a component to plot the current through it. For components with more than two leads, you must click the lead to plot individual lead currents (where you see a 'clamp ammeter' cursor if you hover). Finally, to plot a voltage difference drag from the node you want to plot to the node you want as reference. I would suggest plotting the nodes vc and drv (or instead of drv, plot I(L1) ). The sim runs five times with increasing {rt} so you will see five curves for the capacitor and five increasing delays for drv or I(L1), all on the same plot. If you find that confusing comment out the .step param rt command. To use it for real, connect it in parallel to the existing horn so it gets power when you press the horn button. As the horn is a nasty inductive load, it will need a beefy diode in parallel, cathode positive to prevent the back-EMF spike killing the delay circuit when you let go of the horn button. You'll probably want to power the new horn off a spare fuse in the fusebox, off the switched accessory supply, via the delay circuit's relay contacts, so you don't overload the horn button. * see: http://ltwiki.org/?title=Undocumented_LTspice |
| vmallet:
Ah-ha! Thanks, it makes so much more sense now :) --- Quote from: Ian.M on April 02, 2019, 10:22:01 pm ---I would suggest plotting the nodes vc and drv (or instead of drv, plot I(L1) ). The sim runs five times with increasing {rt} so you will see five curves for the capacitor and five increasing delays for drv or I(L1), all on the same plot. If you find that confusing comment out the .step param rt command. --- End quote --- Yep, LTSpice is a lot happier with the additional file and I see the different startup delays now, nice. I was super confused because I didn't understand L1 was representing the relay's coil and wasn't actually part of the circuit. It's all coming together :) Thanks for all the basic info about LTSpice. --- Quote ---You'll probably want to power the new horn off a spare fuse in the fusebox, off the switched accessory supply, via the delay circuit's relay contacts, so you don't overload the horn button. --- End quote --- I was thinking of pulling power straight from the battery to the air compressor, like: BAT+ -- fuse -- RELAY -- horn compressor -- BAT- The delay circuit would be powered by the existing horn circuit like you mentioned, so that would be controlled by the existing on/off rules. Is going straight to the battery a bad idea? I guess I'm wondering if I would easily find an accessory circuit that would have enough current for the compressor (I'm assuming it's going to pull quite a few amps on 12V). Regarding D1, why is it there? Is it to protect against back-EMF from the relay's coil? If I were to drive say an LED instead of a relay, would I need the diode? Is there harm in having it there regardless? Thanks again! |
| Ian.M:
There shouldn't be any problem adding a 10A load to the fusebox, but you could go straight to the battery terminal with a fuse within 6" of the terminal itself. i wouldn't want to add a 20A load at the fuse box, unless I was very sure there was enough spare capacity ie because there was an option model of my vehicle year that had such a load that my vehicle didn't have fitted, An anti-parallel diode like D1 is standard practice when driving an inductive load. it lets the load current recirculate when the transistor switches off and decay to zero naturally, rather than generating a large back-EMF spike that is likely to kill the transistor. Its not needed when driving plain LEDs, though its still a good idea to use a diode if there's a significant risk the load will be hooked up using very long wires as the loop inductance may be significant. |
| Navigation |
| Message Index |
| Next page |
| Previous page |