# On/Off switch controlled by electrical noise on a DC circuit

Thread Starter

#### MrSoftware

Joined Oct 29, 2013
2,143
What's the best way to detect noise on a DC circuit and convert it to a binary value (on/off)? The goal is to turn a circuit on when noise on a DC supply is detected, and off when the noise goes away. The use case is to be able to turn a device on only when an engine is running by detecting noise on the 12V battery line. The delay between noise/no-noise and on/off can be relatively long (many seconds). There are many ways to detect a running engine, but for this particular case being able to detect it from the DC power line is ideal. The device cannot have any input wires other than V+ and V-, and vibrations cannot be used because the motor may be transported often while not running.

An IC to quantify the noise would be ideal (~0 noise, >0 noise). My second thought is using an OpAmp to compare the output of a simple RC integrator connected to the V+ line, and the raw V+ line. The output from the OpAmp can be averaged to get the on/off signal. But maybe the RC integrator input would need amplification since the noise duration is so short (see screen shots below).. Or I could use a frequency counter as anything above 0 would indicate the motor is running. Any other suggestions or opinions on these methods would be appreciated!

Here are some snapshots of what the noise on the DC V+ line looks like at idle. Basically very short ~5Vpp spikes (+3V, -2V relative the DC). The spike durations are below 100ns in duration, so pretty short. There does appear to be some much lower level ripple on it, maybe I need to tease that out with the scope a bit more to see if it's significant enough to use..

#### peterdeco

Joined Oct 8, 2019
484
How about detecting the increased battery voltage while getting charged by a running engine?

Thread Starter

#### MrSoftware

Joined Oct 29, 2013
2,143
How about detecting the increased battery voltage while getting charged by a running engine?
I thought about that, but in short the battery voltage won't always be an accurate reflection on whether the motor is running or not. To oversimplify, the system may have a lot of lighting attached that could pull the voltage down below the resting voltage for a fully charged battery when the engine is idling, and when the engine is turned off the voltage may take some time to come down if there's no load at all.

#### Reloadron

Joined Jan 15, 2015
7,256
Without having tried it you may want to think about AC coupling the alternator voltage (Battery Voltage) through a diode so you eliminate the negative peaks. You may need some amplification and drive a re triggerable One Shot acting as a missing pulse detector. Yes, run your signal through a comparator. I did similar for detecting a rod bottom (Bang) with an accelerometer.

If a gasoline fueled engine a few turns around a plug wire should give you a signal to work from, clean it up and again a missing pulse detector.

Ron

#### MisterBill2

Joined Jan 23, 2018
16,465
There are products around that use exactly that method to switch on accessory power in a car. The trick is to use an AC coupled input to an amplifier with a gain of about 20, and then AC couple that signal to a rectifier, and use the rectifier output to trigger another amplifier connected as a comparator, which can then drive a switch transistor to either control power directly or to operate a relay. The package that I saw that did this was less than a square inch.and did not use many parts.

#### Reloadron

Joined Jan 15, 2015
7,256
Yes, I left out the AC coupling part. AC couple the signal blocking the DC level. Measure the AC which will be noise. I guess if we wanted to really be cool about it we could just grab one of the three AC phases on the alternator prior to rectification. Depends on how much noise there is to work with I guess.

Ron

#### MisterBill2

Joined Jan 23, 2018
16,465
Getting an AC connection to an automotive alternator is quite a lot of work. Been there and done that: (remove the alternator, open the alternator case, attach the new wire and anchor adequately for automotive environment, assemble alternator, re-install alternator and reset belt tension.)
Smpling the alternator ripple and fuel pump noise is MUCH simpler and works well. That is how the accessory power switch modules do it. An LM324, 2 diodes, a power transistor, 2 capacitors and a dozen resistors.

#### eetech00

Joined Jun 8, 2013
3,629
Does the automobile have a tach connection?
You could use that to connect to a FTV converter and detect motor RPM.

Thread Starter

#### MrSoftware

Joined Oct 29, 2013
2,143
Thanks this is sounding promising. This switch box can not have any inputs other than the V+ and V- . Does anyone happen to remember a name for this circuit? I'll try to make my own based on your description if necessary, but if there's already an off-the-shelf module then that might be cheaper and easier.

#### Reloadron

Joined Jan 15, 2015
7,256
There is no generic name I am aware of. If you have a scope using AC coupling take a look at your signal. You should get an idea of the peak to peak amplitude of the noise level. Lacking a scope using a good quality RMS responding RMS indicating DMM set to measure AC try and measure the AC noise level on your DC line. It would be nice to have a baseline of the noise level. Once that is known then you can think about amplification because if the noise is below 0.7 volt peak It will need to be made bigger (amplified) to make much of any use of it. I never looked at the AC noise level on my alternator systems.

Ron

#### MisterBill2

Joined Jan 23, 2018
16,465
The unit I saw most recently had a lighter plug and the enclosure had three lighter sockets across the front. It looked like it might have come from the automotive accessory section of a Walmart store. I would look for it there, or in a bigger auto parts store.
One note of caution: DO NOT spill Coke or other beverages on the one you get, it does bad stuff to the circuit board.

#### KeepItSimpleStupid

Joined Mar 4, 2014
5,088
Radio-Shack sold one. The lighter socket variety.

#### AnalogKid

Joined Aug 1, 2013
10,775
High-pass or band-pass filter > gain stage and envelope detector > threshold comparator > output driver

ak

#### MisterBill2

Joined Jan 23, 2018
16,465
A shorter summary of my description. Thanks, AK. AND, is a " Maslow antagonist " possibly a MASLOWSKI antagonist??? He was one of my professors at LIT back in 1970

#### AnalogKid

Joined Aug 1, 2013
10,775
AND, is a " Maslow antagonist " possibly a MASLOWSKI antagonist??? He was one of my professors at LIT back in 1970
When I first joined this forum, I spent a few months lurking to get a feel for the place and the unwritten rules of the road, I was surprised at the number of responses that distorted the question to fit either a 555 or a PIC, sometimes spending more words insulting the questioner than answering the question. I don't like that. Hence, a small protest.

"I suppose it is tempting, if the only tool you have is a hammer, to treat everything as if it were a nail."

- Abraham Maslow, Professor of Psychology at Brandeis University; "The Psychology of Science: A Reconnaissance", 1966

https://en.wikipedia.org/wiki/Abraham_Maslow

ak

Last edited:
Thread Starter

#### MrSoftware

Joined Oct 29, 2013
2,143
Thanks guys, my scope does have AC coupling so I'll go get some more readings to get a better idea for the AC component that we have to work with.

#### t_glover

Joined Mar 16, 2021
47
I recently installed a pair of Oxford heated hand grips on my motorcycle. The controller has only V+ and V- and 2 connections for the grips. The controlled will shut off after 5 minutes if there is no noise on the supply line to save the battery. So it certainly can be done.