Need expert opinion on my circuit design (to filter 12V power)

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
Hello everyone,

The situation

My motorcycle is missing a tachometer (never had one), so I build one using an Arduino Nano. It reads the rpm from the diagnostics port and this part is already working. You can read the story on https://forum.arduino.cc/index.php?topic=236092.msg4513509#msg4513509 .

The problem

The tachometer only works when the motorcycle is idling or when the rpm is low. When revving the connection is lost. I need a circuit that filters the 12V power supply from the motorcycle.

My solution so far

I designed the following circuit:

circuit2.jpg

The part on the right is already working (at least for low rpm). The K-line connects to the diagnostics port.
The part on the left (of the green line) is what I added to improve the situation.
It includes a TVS diode to get rid of voltage spikes above 16V. (continuous voltage could be 14.5 V during operation)
The RC filter has a low R to prevent a large voltage drop.
The RC filter has a low-pass cutoff frequency of 16 Hz. (which seems to work, but I was just guessing here)
This filter seems to work (also for higher rpm), at least when the motorcycle is standing still in my garage.

My question

Although it seems to work, I was just guessing what to build. I also tried a linear regulator, which did not work. Also the circuit is still on a breadboard and not ready for a field test. I would like to hear your expert opinions before I start soldering.

Is this a decent solution? Are there things that could be improved?

A consideration: Currently, the circuit uses only 24 mA @12 V, but later I would like to add a buck converter before the regulator so that I can add a bright display and maybe a GPS module. I am thinking 0,5 A @ 12 V.
 

Attachments

dl324

Joined Mar 30, 2015
11,508
I'd put a larger cap on the regulator output. If the problem persists, put a larger cap on the input. If that doesn't work, add a choke where you have the 10 ohm resistor.

In any case, remove the resistor.
 

crutschow

Joined Mar 14, 2008
25,409
How do you know that electrical noise on the power is the problem?

Where are you connecting the GND terminal?

Do you have an oscilloscope?
 

AlbertHall

Joined Jun 4, 2014
10,393
I would go with the choke instead of the resistor.
If the 1mF is 1000uF and not 1uF then that should be OK.
A bigger electrolytic on the 7805 output would be good but keep the 0.33uF as well. They are better at high frequencies than 'lytics.
[EDIT] The 10nF on the K input seems rather high but I can't really be sure because it all depends on the output impedance of the diagnostic port. Too high a value here would filter out the higher frequencies.
 
Last edited:

dendad

Joined Feb 20, 2016
3,602
I usually add a 10Uf Tantalum cap on the input and output of the regulators.
I take it you do actually have the gnd connection on the regulator connected. It is missing from your circuit.
I would add a 100uF cap on the reg input as well.
 
Last edited:

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
How do you know that electrical noise on the power is the problem?

Where are you connecting the GND terminal?

Do you have an oscilloscope?
I expect the noise to be the problem because the connection works without any problems when the motorcycle is turned off or idling. Also automotive noise is known to be a harsh environment for electronics.

I get power and ground from the diagnostic plug, because it has a switched 12 V and I need to connect to the diagnostics line anyway.

I do have an oscilloscope, a Rigol DS1054Z. I was worried about transient spikes ruining my scope, but I guess it is not an issue. I read this in the manual:

Maximum input voltage of the analog channel CAT I 300 Vrms, CAT II 100 Vrms, transient overvoltage 1000 Vpk With RP2200 10:1 probe: CAT II 300 Vrms.
Do you think I need to take extra precautions?
 

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
I would go with the choke instead of the resistor.
If the 1mF is 1000uF and not 1uF then that should be OK.
A bigger electrolytic on the 7805 output would be good but keep the 0.33uF as well. They are better at high frequencies than 'lytics.
[EDIT] The 10nF on the K input seems rather high but I can't really be sure because it all depends on the output impedance of the diagnostic port. Too high a value here would filter out the higher frequencies.
I can add a extra capacitor next to the 0.33uF, is 10uF electrolytic okay? Or is bigger better, like 1mF? I am starting to think that electronics isn't really an exact science? :) How do you calculate these values or are you using a gut feeling because of experience?

The circuit design I found that is used by other, actually has a 100nF on the K-line. It did not work for me and did not look good on the scope. 10nF looked fine and worked well.
 

AlbertHall

Joined Jun 4, 2014
10,393
I would choose 100uF and yes, it is gut feel based on experience. We don't have the information to know exactly what is causing the problem so an answer cannot be definitive.
 

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
I usually add a 10Uf Tantalum cap on the input and output of the regulators.
I take it you do actually have the gnd connection on the regulator connected. It is missing from your circuit.
I would add a 100uF cap on the reg input as well.
What is the use of these tantalum capacitors? I know that ceramic caps work better at higher frequencies and electrolytics have a larger capacity. What is the added value placing 100uF parallel to 1000uF?
 

dl324

Joined Mar 30, 2015
11,508
I am starting to think that electronics isn't really an exact science?
The science is fairly exact. The calculations are too complicated for most, so we have guidelines. If you know you're experiencing interference on the power supply, you do what I said.

If you have a scope, you can use more finesse. If the problem is high frequency noise, electrolytic caps won't help as much as a choke. But adding better high frequency decoupling with ceramic capacitors may also help.
 

Ohmlandia

Joined Mar 2, 2020
32
Beware of adding large electrolytics on the output terminal of 78/79 family regulators. They can backfeed through the regulator and supply loads on the regulator input terminal, during power switch off. These currents can destroy the regulator! Use a 1N400X diode to bypass the regulator (in the reverse direction) to protect it.
 

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
Welcome to the world of electronics.
You are learning well, grasshopper.
When electrical noise is involved, nothing is exact (it's barely approximate). :)
So my usual "think first, then act" approach might not be the best fit for electronics. It's more like: make it work in practice and then find out if it work in theory as well. :)
 

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
Updated circuit:
circuit3.jpg

The choke was suggested by several of you. I have some of these lying around (with the rest of the buck converter still attached). The inductance probably quite low, maybe 22 uH, maybe 47uH.
buck.png
From what I have read, bigger is better, because it lowers the cut-off frequency. Also I don't think have to worry about oscillations because there is enough resistive load. Am i right?

Should I buy one of these or do I need another model altogether?
inductors.png
 

Thread Starter

JunkieNL

Joined Mar 19, 2020
29
Beware of adding large electrolytics on the output terminal of 78/79 family regulators. They can backfeed through the regulator and supply loads on the regulator input terminal, during power switch off. These currents can destroy the regulator! Use a 1N400X diode to bypass the regulator (in the reverse direction) to protect it.
Interesting. I will have to look into that. Do you maybe have a link to information about this? This seems like hard to google. I found nothing on this in the datasheet. I remember from another regulator that a very large capacitor was needed on the output, but that might have been an LDO.
 
Last edited:

dl324

Joined Mar 30, 2015
11,508
The inductance probably quite low, maybe 22 uH, maybe 47uH.
Try the biggest you have. If it works, you can try substituting lower values. 47uH isn't much.

To prevent capacitor discharge through the regulator, add a diode from the output to the input:
1584737821283.png
 

dendad

Joined Feb 20, 2016
3,602
A selection of different caps, both sizes and types, helps with bypassing. Different ones bypass different frequencies.
Usually, I have 100nF ceramics and 10uF Tants. or ceramics close to the regulator. In fact, double sided PCB with them one on each side.
A reverse diode across the reg is not a bad idea, as @Ohmlandia mentioned if you have large o/p caps. Some types of regs do not need the diodes.
If you have the buck converters, why not use them?
Most off my boards now use these, or similar.
https://www.tracopower.com/products/browse-by-category/show/dc-dc-converters/non-isolated-step-down-regulators/tsrn-1/1/

tsrn1.jpg
They are pin compatible with the 78xx regs.
A number of companies make them now. One type is good to 72Vin, and that is very helpful for reliability.

Here is an example. U2 is one off those regs as above. C1 and C3 are 100nF ceramics. TS1 is a 36V Tranzorb across the input supply.
REG_btm.png


And from the top, C2 and C4 are 10uF ceramics while TS2 is a 5.1V Tranzorb across the reg o/p.
REG_top.png

One thing I have found is you can not have too much bypassing. Some off my boards are still in operation in industrial control and building management and running after 30 years.
The only problem we have had is the electrolytic caps drying out. Replacing them in failed boards brings them back to life.
But now one can get large ceramic caps, so for a lot of uses, electros can be dispensed with.
 

Reloadron

Joined Jan 15, 2015
5,646
It includes a TVS diode to get rid of voltage spikes above 16V. (continuous voltage could be 14.5 V during operation)
How clean is your 12 VDC? I see you mentioned the above so I have to ask, would this be an automotive application? I would likely as close to the 7805 input side place a 0.33 uF cap to ground and I would use 0.1 uF bypass caps on both the Arduino Nano and the L9637D. Should this be an automotive application I would consider a regulator designed more for automotive applications than the LM7805.

Ron
 
Top