555 Timer in a car - cleaning up the 12v supply - Page 1
Forum section: electronics / beginners

author: Daz
author_rank: Contributor
timestamp: August 14, 2015, 06:12:00 pm
content: Hi all,I've built a simple 555 timer circuit to give intermittent windscreen wiper functionality in an old car. The circuit works fine on a bench PSU at 14v, and works fine from the car battery with nothing else switched on, but as soon as the fuel pump comes on in the ignition position (or if I start the engine) the timer circuit fires the wiper relay at random intervals. The fuel pump and alternator are making the power line to my circuit really noisy. Can anyone suggest the best options for cleaning up the car supply?I found two 680uF 25V caps that I put in parallel to make a 1360uF and put this across the +ve and Earth of my 555 timer circuit. This cut out the random firing of the relay completely, but the delay times are still faster than they were on the bench PSU.I was thinking of these options:- A much larger capacitor across the supply of my 555 circuit. I've seen suggestions online of 2200uF or 4700uF.- A regulator like the LM7812 or LM2940 (my circuit is only drawing 150mA max)- A DC-DC converter, or buy a regulated 12v car lighter socket adapter and rip the circuit out of it.Thanks for your help,Darren.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 14, 2015, 06:45:53 pm
content: Add a few ohms in series with the supply. Without this your capacitors are making an RC lowpass filter with the fraction of an ohm impedance in the wiring. Not very low pass.I am assuming you are using your circuit to drive a relay which controls the wipers. If this is the case the firing and holding current for the (presumeably 12V) relay will drive what the minimum acceptable voltage to your circuit. I suspect that 20 or 30 ohms will be fine. It would have to be a 1 watt or more resistor with the stated values.Fully regulating the supply is more robust, but more complicated.

author: Daz
author_rank: Contributor
timestamp: August 14, 2015, 07:30:31 pm
content: Thanks CatalinaWOW. Can I just check what you are suggesting? Are you saying keep the large capacitance (1360uF) in parallel with the supply, and then add a few ohms in series with the supply input to the timer circuit? Or in series with the 1360uF capacitance that is across the supply rails to the timer circuit?Also, you mentioned a few ohms, but did you mean 20 or 30 ohms that you mentioned later on?Yes, the 555 chip is firing a 12v relay (with flyback diode across it). I think the relay works down to around 9 or 9.5 volts.That 1360uF capacitance across the timer circuit supply was just an experiment to see if it would smooth the supply.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 15, 2015, 04:02:01 am
content: Don't forget to put a diode into your circuit before the capacitor because without it, the purpose is defeated. When you turn the key and the 12v supply jumps around a little bit, it goes to zero and resets your wipers. The capacitor stops the 12v jumping, but if it has to run the 555 AND the rest of the car when the key is turned, it has a big job. The diode means that the cap only needs to run the 555 when the supply goes to 0, rather than the rest of the car.You can also reduce the voltage with resistors, a voltage divider, this may make the timing closer to the bench because the supply is closer to the bench. For a car, you have plenty of electricity and the 555 doesn't take much. leave the positive for the relay (if any) on the outside of the circuit, on regular 14v supply. This will mean the 555 circuit has constant and small power consumption easy to supply from the voltage divider.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 15, 2015, 04:09:12 am
content: like this

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 15, 2015, 06:03:42 pm
content: What I was suggesting was 20-30 ohms in series with the line to the 12V source, keeping the capacitance as shown.The suggestion by ElectricChicken is good. Effectively if puts a VERY large resistance in series for the direction of current flow that you don't care about. The other current direction gets the effective impedance of the diode, typical a couple of ohms. While Chicken's suggestion is likely to solve your problem, you will get even better results (reducing the effect of up spikes in the supply) by putting a second capacitor across the 555 supply in the last circuit drawn by the ElectricChicken. The RC filtering your 555 power is now the top resistor of the voltage divider, which can be pretty large.You have said you are a noob, but none of us knows how little you know. If you are unfamiliar with RC filters, time constants and the lot it would be worth a few minutes reading about them. In very rough terms the product of the resistance and capacitance (Resistance in ohms, capacitance in Farads) gives a time constant in seconds. Pulses or spikes with times much longer than the time constant tend to get through relatively unchanged in a low pass configuration like this, while those much shorter than the time constant get greatly reduced in size. The bigger pulses and spikes I have seen on automotive circuits tend to range in length from modest fractions of a second down to the microsecond range.

author: Daz
author_rank: Contributor
timestamp: August 16, 2015, 05:52:32 pm
content: CatalinaWOW, Electric Chicken, thanks for your time and suggestions. I've been reading up on RC low pass filters and I'll be trying out these ideas on the car tomorrow. I found a formula giving a cut off frequency Fc=1/2xPixRC, so if I use one of my 680uF caps and a 30 ohms resistor, this should give a cutoff of 8Hz (right?). That should help with a lot of the noise I guess.Do you think the RC low pass filter of 8Hz will do the trick without the need for a much larger capacitor across the supply?I'll try all this out and report back. I could always try capturing the noise on a scope and see what I'm up against.Thanks, Darren.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 17, 2015, 05:40:19 pm
content: It should help a lot, but the diode Electric Chicken suggested will give the largest single improvement. An eight Hz low pass filter is a good choice. Pulse widths shorter than about 10 milliseconds will be attenuated, with attenuation improving by a factor of ten for every factor of ten reduction in pulse width. That frequency is also well below the most common source of repetitive noise (engine idle related frequencies). Even if a bad spark plug is only firing every fourth revolution of the engine the rep rate at idle will be well above 8 Hz.There is no way of knowing without trying. All car electrical systems are noisy, but yours may be very different (better or worse) than the average due to any number of factors including layout and fabrication of the wiring harnesses, history of exposure to corrosive environments, wear of components, the particular branch of the system you tapped for power, and what other things are going on in your car.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 17, 2015, 08:23:15 pm
content: I drew it a little better and added stuff. The most important thing I forgot was a diode across the relayadding a regulator, zener or 78 series would probably do a bit more than you can do by calculating filters.* c1 is big value and 25v or more* c2 is a small or maybe a medium and small in parallel ? 16v or more* r1 is optional ? can't recall what it does.* r2 unloads the regulator(s) by dissipating heat that the regulator would have to get rid of. on the regulator side, it's two or three volts more than the regulator output for 7805 7806 7809 regulators, it's not needed for 7812, just use a wire instead. For the zener, it lets enough current through to power the 555 and a bit more, but not more than the maximum power dissipation of the zener at the given 555 supply voltage, just a quarter or a half is ok.* d2 gives the relay lots of unregulated voltage because relay doesn't care.* d3 stops the relay spikes getting very far.* c5 is for nothing in particular16v or more* d1 stops c1 trying to run the car when you switch off the ignition. It allows c1 to continue running the circuit until c1 gets bored and wants to go and lay down or something.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 17, 2015, 08:29:37 pm
content: It is not worth buying at all, but if you scrap equipment to salvage bits and pieces then you can use "snap on ferrite cores" on the wiring running into the car. just search for "snap on ferrite cores" and you'll recognize what you've seen a lot, if you don't know. I do wonder if the same effect can be had by threading wires through some nuts ?? I don't expect either of them will do much, but it wouldn't hurt if you have them and don't know what else to do with them (I never do)

author: Daz
author_rank: Contributor
timestamp: August 17, 2015, 11:52:51 pm
content: Thanks ElectricChicken and Catalina for the continued support. Chicken, those diagrams were very helpful, thanks, and I might be tempted to look into using a 78xx regulator. But for now, here's an update on how it went today.I'm limited by what components I have lying around, but I managed to try the following: I connected my +12v supply into a diode (1N4148), and then into an RC low pass filter using R=30 ohms and C=680uF (giving the 8Hz cutoff that we talked about earlier). Unfortunately my relay coil is still connected directly to the 555 timer IC on the filtered side of the power supply because I couldn't find a transistor. But the good news is that the circuit with diode and RC filter behaves the same on the bench as it does in the car with the engine on! That is major progress! So:- The timer circuit on a bench PSU without the diode & RC filter gives a relay pulse every 5.5 seconds.- If I add the diode and RC filter on the bench, the time drops down to around 4.6 seconds. I think this is because when the relay kicks in momentarily, the voltage to the timer circuit drops by a volt (voltage divided between the 30 ohm resistor in the RC circuit and the 300 ohm relay coil). This voltage drop must be upsetting the timing.- The good news is, if I test the timer circuit in the car with the diode and RC filter, the pulse time stays the same as it is on the bench (4.6 seconds), meaning that the diode and RC filter have seriously reduced the noise on the power line!I think if I switch on the relay coil using a transistor, connecting the coil to the 'dirty' side of the power line as ElectricChicken suggested, then I should get my 5.5 second pulse.My 555 timer is being used as a sink (relay coil connected between +12v and pin 3 of the 555 timer). So I guess I need to use a PNP transistor. Can you guys help me choose a sturdy PNP transistor for switching on a relay coil in an automotive environment? This coil is only 300 ohms (so say 50mA), but I might need to use a 70 ohm coil in the future (say 200mA). What transistor could switch 200mA in a car and survive all the horrible spikes and surges that we get in cars?Thanks,Darren.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 18, 2015, 06:04:45 am
content: Quote from: Daz on August 17, 2015, 11:52:51 pmYou're welcome.QuoteExcellent. If it is working the way you want, stop.Quoteas acurrentsink yes. well if it works off the 555 now, just use that as it is. You might possibly limit the current through the relay by adding a resistor in series with it's coil, to keep the current the same as it is on the bench and in the car, so it's like the bench when it's on the higher voltage. That way the 555 won't work so hard sucking up big currents.Which transistor ? whatever you can find in scrapped equipment. Just google the numbers on the transistors you find, or just look for something of a reasonable size physically and try it.Do you have a relay that you can switch from the present relay ? connect the large one across the outside 14v and use the small one in the circuit to switch it on and off.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 18, 2015, 06:06:49 am
content: either front of the circuit will work with either back of the circuit.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 18, 2015, 08:57:00 pm
content: Virtually any transistor will work. If the circuit is operating as intended there is little or no power dissipated in the transistor.Things you will want to look for if you try selecting a particular transistor.1. NPN. While you can set the circuit up to work with a PNP, the circuits are drawn for an NPN transistor. For a variety of reasons NPNs are the better choice.2. Low VceSAT. This will assure that little power is dissipated in the transistor.3. VceMAX. Should be significantly above your supply voltage - 20V or more. Almost all transistors will meet this requirement.4. Low enough leakage (current through the transistor in the off state). Needs to be below the holding current of your relay. Again almost all transistors will meet this requirement.5. Gain (beta) high enough to assure saturation in the on state. The bar is low here too. Beta should be greater than the ratio of the relay pull in current to the current you want to pull out of the 555. That ratio will be a small number (in the 5 to 20 range). The vast majority of transistors have betas larger than this, though I have found a substantial number of "bargain bin" transistors that are marginal or would fail this.6. IceMAX large enough to drive the relay. This requirement is the one which will cause more problems with random pulls of transistors from equipment than any other. Transistors found in the rf front end of a radio may or may not be able to carry the current, especially if your relay requires 100 or more milliamps.You may also want to add a resistor in series with the transistor base to limit current in this path. This will reduce the stress on both the 555 and the transistor. Use ohms law to select the resistor for the current you want. Remember to check step 5 of transistor selection if you go that route.

author: Daz
author_rank: Contributor
timestamp: August 19, 2015, 11:56:25 pm
content: SUCCESS!!!!Hey guys, just to update you: The combination of the filter circuit to clean up the power and moving the relay off of the 'clean' power side and putting it on the 'dirty' (pre-filter) power line, and driving the relay with a transistor from the 555 timer, has worked a treat! Many thanks CatalinaWOW and TheElectricChicken for your help. I've learned loads from this, and I've now got a perfectly stable, working intermittent-wiper timer circuit in a car with a really noisy +12v rail! :-) I'm totally over the moon!Can somebody tell me how to add multiple photos to a single post with text between the photos? Then I can show you the final circuit and also some oscilloscope traces showing the noise before and after the filter circuit, and how the timing has improved by moving the relay off of the clean power line. Thanks.

author: MarkF
author_rank: Super Contributor
timestamp: August 20, 2015, 12:18:07 am
content: ElectricChicken,In the top circuit of your reply #9, the R2 and C2 form the most common low pass filter. I don't know what the frequency response is for the parallel R1 and C1 configuration.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 20, 2015, 12:27:36 am
content: Quote from: MarkF on August 20, 2015, 12:18:07 amThe frequency response can be found by thinking of the R1-C1 pair as the lower impedance of a voltage divider. The upper impedance is the combination of the diode impedance and the source impedance of the supply. Not a potent filter until frequencies where the impedance of C1 is small with respect to the source + diode impedance.By the way, congratulations Daz on your success. As my university prof on circuits said "A working circuit is a thing of beauty."

author: SaabFAN
author_rank: Frequent Contributor
timestamp: August 20, 2015, 01:23:44 am
content: Quote from: Daz on August 19, 2015, 11:56:25 pmFunny quote from a Linear Technology Datasheet (I think it was the LTC1871 DC-DC Controller): Cars are the "Supply from Hell!"Make sure to put a TVS-Diode in there to snuff out any Load-Dump Spike. These can reach more than 60V and last several microseconds. Since I already literally blew up an RPM-Meter circuit, I now always put a 1.5KW TVS-Diode in any circuit that comes near an Alternator.

author: ez24
author_rank: Super Contributor
timestamp: August 20, 2015, 01:56:46 am
content: QuoteIs this possible? I think not. Bummer

author: Vgkid
author_rank: Super Contributor
timestamp: August 20, 2015, 02:17:47 am
content: ^^^You can do it if you use an external photo hosting site.

author: tautech
author_rank: Super Contributor
timestamp: August 20, 2015, 02:20:58 am
content: I would change the 1N4148 on the supply to a more capable diode, a jelly bean 1N400* or similar.Quote from: ez24 on August 20, 2015, 01:56:46 amOf course it's possible, up to the forum upload limit.Compress images to save space on Daves server and to make for faster loading for readers.Use the Insert Image button, insert image URL between the brackets then add text to the next line and so on.Find a pic heavy thread/post, then pretend to reply byQuoteing the post and study the syntax.

author: ez24
author_rank: Super Contributor
timestamp: August 20, 2015, 06:18:01 am
content: QuoteGood idea - thanks

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 20, 2015, 06:54:53 am
content: Quote from: Daz on August 19, 2015, 11:56:25 pmYou're welcome.QuoteAdd all images as attachments. Read the new message. Then right click modify on the massage and open modify in another tab/window. On the original tab/window where you read the message, click on all attachments to make them full size (use image editor to make them not too big before you upload) right click on each large image and copy the image location. Add that to your message modification message in the places you want the images, Surrounding it with image tags.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 20, 2015, 07:09:45 am
content: Quote from: MarkF on August 20, 2015, 12:18:07 amDon't think of it as a low pass circuit if it is confusing, take my other list of explanations as to what each item does. It's funnier too, but still perfectly correct.I'm not really making things based on frequency response, not even calculating. C2 is a small cap, put there really because people like small caps next to chips to decouple, but that's a long story. It's just a little cap, not worth worrying what it does to the rest of the circuit. It is mean to make the 555 happy.r2 belongs to ZD1. If the supply is 12volts and the zener is 5v then the 7 volts needs something to drop across, and r2 is it. It supplies just enough current for the 555 and a little extra to let the zener regulate properly, maybe 1/4 of the zener's rated current is ok I guess. anything from it's rated current to zero is ok, but 1/4 gives least problems when the circuit is rattlin'r2 belongs to 7805 and 7809, they unload the regulator so it doesn't work so hard. You can replace it with a link of wire, if the 7805 can handle all the power dissipation. Otherwise it just gives the 7805 about 7 volts to play with. A 7809 would be given 11 volts to play with. 7812 is given a wire link and the full car voltage.R1 is optional, leave it out. Maybe it's just to discharge C1 over time ? it's just not needed.c1 is just a battery for the whole circuit. It stores power because ignition switches are dirty, as you rotate the key, there is a lot of noise in the 12v line. c1 probably keeps power running to the circuit for a few seconds after the ignition is off. It depends what cap you find in your junk box. Just a large one with 25v or more written on it's side.

author: Daz
author_rank: Contributor
timestamp: August 20, 2015, 09:58:37 pm
content: Hey all, while the results are a success I'm a bit confused as to why, because the 555 is still connected to the noisy supply through the transistor driving the relay. See attached diagram. I'm using a PNP transistor to drive the relay because the circuit was designed to output low (555 timer output is being used as a sink).As I understand it, when the 555 outputs low, current flows from the noisy supply, into the collector, through the base, through the 555 timer IC and down to earth. So even though I've filtered the supply for the timer circuit, the noisy supply is still going into the 555 pin 3 (output sink) via the PNP transistor.But the circuit seems to work OK, so the noisy supply that was causing random firing of the 555 timer before doesn't seem to affect it when going into output pin 3 as a sink. Any explanations?CatalinaWOW, you mentioned that "For a variety of reasons NPNs are the better choice".Would it be better engineering to use an NPN, and would the NPN completely isolate the noisy supply from the 555 IC? (i.e. with an NPN, is the Collector-Emitter noisy voltage completely isolated from the Base, with no noise transferred through to the circuit driving the base). Thanks.

author: Daz
author_rank: Contributor
timestamp: August 20, 2015, 10:18:09 pm
content: BTW, thanks SAABfan for the TVS diode suggestion. I've been reading up on those and I'll be interested to learn more about them once I'm happy with this 555 circuit.TheElectricChicken and tautech, thanks for info on attaching images between text. Got it! :-)

author: tautech
author_rank: Super Contributor
timestamp: August 21, 2015, 01:08:27 am
content: Quote from: Daz on August 20, 2015, 09:58:37 pmWhen the BJT base is pulled low any noise on pin 3 is shunted to circuit GND.IC suppy noise was the issue and that has been solved for your purpose.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: August 21, 2015, 01:32:59 am
content: Noise through the path you describe doesn't matter much to the 555. It is the collector of a transistor inside the 555. The 555 toggles the base of that transistor high and low as the rest of the internal and external circuit operates. When high the only way for the noise to couple to the rest of the 555 is a tiny capacitance inside the transistor and some parasitic connections that also typically don't operate. When low pin 3 is effectively shorted to ground so the noise doesn't matter.ElectricChicken's description of operation is valid, though you might find his description of R2 confusing since he is describing it's operation in the two different forms of the circuit. His description of R1 as drawn is also relatively correct, though there is a low pass effect (minor) going on.The preference for NPN in general boils down to being easier to make, which makes them usually cheaper for any comparable set of performance parameters. Those differences can easily be overwhelmed by the contents of your junk box or the sale at the local electronics outlet.

author: Daz
author_rank: Contributor
timestamp: August 25, 2015, 11:45:32 am
content: Hi all,Just to wind up this thread, so everyone knows what I've been talking about, here are some oscilloscope traces of the noisy supply in the car and how the RC filter cleaned things up (it's also practice for me using a scope).All traces with scope settings 2 volts/div and 20 mS/divThis first pic below shows the car supply with engine OFF but ignition ON and fuel pump ON. The car is from the 1970's and used to have a mechanical fuel pump but this has been upgraded to a modern electronic fuel pump, and I think this fuel pump is responsible for the 25 Hz noise on the supply:Sometimes this 25Hz fuel pump noise includes some nasty spikes (photo below). I think it was these spikes making the 555 trigger the relay randomly before I put the RC filter in:The trace below shows the output of the filter circuit (1N4148 on the input and then RC Filter, with R=30 ohms and C=680uF). Again, engine was OFF and ignition and fuel pump were ON. There was no load on the output of the filter when I captured this trace so maybe this trace doesn't prove much?Now turning the engine ON you can see how the noise on the car supply changes:And here's the output of the RC filter with Engine ON. Again, when I captured this trace there was no load on the output of the filter, so this might not mean much:

author: Daz
author_rank: Contributor
timestamp: August 25, 2015, 11:47:33 am
content: And here are a couple of traces showing how the relay coil affects the supply to the 555 timer circuit. I've gone down to 1 volt/div for these traces to show the voltage drop a bit more accurately, and timebase is now 1 second to show the relay being triggered for the intermittent wiper approx. every 5 seconds.The first trace shows the effect of having the relay on the filtered (555) supply. You can see how the supply voltage to the 555 circuit drops when the relay is activated for half a second or so. I guess as more current is drawn by the load on the RC filter more voltage is dropped across the series resistor of the RC filter, and the less voltage the 555 circuit gets as its supply. Note that this placement of the relay causes the 555 timer to pulse the relay every 4.6 seconds (quicker than I wanted):...And for comparison, here's the same circuit out of the car and connected to a clean bench power supply (timing pulse increases to 4.8 seconds with cleaner supply):The trace below is when the relay has been moved off of the clean 555 supply and on to the noisy car supply. The supply to the 555 is affected a lot less, and subsequently the timing of the 555 circuit is much more accurate (around 5.4 seconds):...and for comparison, here's the same circuit out of the car and connected to a clean bench power supply (timing pulse increases to 5.5 seconds with cleaner supply):So in summary: Success! An RC filter to clean the supply to the 555 timer circuit and the addition of a PNP transistor to switch the relay coil on, with the relay coil now connected to the noisy supply so that it doesn't affect the supply to the 555. I've since found some better components to use, so now the diodes are 1N4007, the capacitor in the RC filter is 1000uF 25v, the PNP transistor is a 2N5401 (good for 150v Vce, so definitely should be able to cope with any big spikes on the noisy side of the filter), and the resistor on the base of the 2N5401 to switch it on is 8.2Kohm.Thanks for all your help,Daz.

author: Daz
author_rank: Contributor
timestamp: August 25, 2015, 11:56:56 am
content: Yep, got it ElectricChicken, thanks. It would be great if it was possible to insert all of the images before posting, but I guess you don't know what image number the server will give to each image until it has been attached.

author: Daz
author_rank: Contributor
timestamp: August 25, 2015, 01:00:59 pm
content: Thanks Chicken, I guess that helps save space on Dave's server. Can you do one for image 7b that I uploaded? Then they'll all be the same, and I'll put them in my post.What did you use to correct the trapezoid distortion? I'm using Irfanview but I don't think it can do perspective correction.

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 25, 2015, 02:02:07 pm
content: Quote from: Daz on August 25, 2015, 01:00:59 pmGIMP, it's free and the best I know of. Gimp and blender on linux are the best for drawing that I know of. Irfanview is very cool, but I only know of it for viewing. I'll do that last one. It will be good for the many people who have poor or limited internet connections.

author: Daz
author_rank: Contributor
timestamp: August 25, 2015, 10:48:40 pm
content: All done, thanks ElectricChicken. I re-uploaded the adjusted images and then realised I could have just linked to yours...ah well, it is the beginner's forum after all :-)

author: TheElectricChicken
author_rank: Frequent Contributor
timestamp: August 25, 2015, 11:20:05 pm
content: Actually that allowed me to just remove my messages with the resized images. Even before I did that, I DID notice that the page loaded super-fast. I think that will help a good few people who may like to do the same thing. It is a very common problem in cars that gear acts strange because of electrical noise, and this is a lovely guide you've made.I would like to know if attachments can still be used after the message they are attached to has been removed long ago, maybe some reader knows about this ?Anyhow, enjoy the next 6 months without a drop of rain now that you've prepared so well.

author: tautech
author_rank: Super Contributor
timestamp: August 26, 2015, 08:55:03 am
content: Quote from: TheElectricChicken on August 25, 2015, 11:20:05 pmGood thread Daz, good outcome.