Go Down

Topic: Filtering External Noise (Read 1 time) previous topic - next topic

tjtj13

Hello! I have a question concerning filtering noise produced by the system surrounding my Arduino and circuit. So for a project for my class, I've (sort of) designed a project that will be able to take the digital tachometer signal produced by my car, have the Arduino process it, and have it displayed on an LCD screen. I was actually able to install it, but I'm running into a few hiccups. 

So far I've been able to run the signal through a voltage divider to a digital pin on the board. I wrote a shell of a code to display the values and I took it out to test it. The RPM displayed at idle is accurate, however when I rev the engine or drive it, the error in the displayed value gets worse as the RPM gets higher. I suspect that this is due to external noise because I had a few ferrite core clamps lying around and when I strapped them to the power wire, the error was smaller. So my question is this - does anyone know of any way I can use hardware to filter this external noise? To stay within the project guidelines, I need to use components like capacitors and transistors and such. I think the direction I need to head in is designing a high pass filter, but I'm not sure if that's right. 

TL,DR: I have a project for class that's encountering external noise, and I need to figure out what hardware/circuitry to use to fix it. I think I need a high pass filter but I'm not sure. 

Thanks so much in advance!!!

aarg

Show us a schematic of the existing wiring. Also images of the wiring if you can.
  ... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

johnerrington

Can you supply a drawing of the
Quote
digital tachometer signal produced by my car
Are you working from the CAN-BUS or some other tachometer signal?
How does the signal change as the revs change?
I'm trying to help. If I find your question interesting I'll give you karma. If you find my input useful please give me karma (I need it)

tjtj13

Show us a schematic of the existing wiring. Also images of the wiring if you can.
Here's a schematic of what I did. Sorry I don't have a proper schematic software, so credit to Arduino for the bulk of the picture! (sourced from https://www.arduino.cc/en/Tutorial/LibraryExamples/HelloWorld ) I don't have the car at the moment but I will soon, so if you need pictures of the actual wiring I can get them for you. Thanks for your help! 


tjtj13

Can you supply a drawing of the Are you working from the CAN-BUS or some other tachometer signal?
How does the signal change as the revs change?
I'm working with a signal straight from the Ignition Control Module attached to the engine. One of the wires in the wiring harness carries the signal for a tachometer. Normally, the signal would be used to drive a stepper motor to move the needle on the gauge in the dashboard cluster, but I don't have a tachometer gauge. The signal carries a higher voltage as the RPM increases to drive the needle further around the gauge. Thanks for your help!

johnerrington

Its unlikely that a signal from a digital device to another would use an analog voltage.  From your description I'd guess its a frequency, or PWM.
How you process it would depend on the actual signal. However you could try this as an experiment

https://www.instructables.com/Analog-Output-Convert-PWM-to-Voltage/

can you get an oscilloscope to look at the signal?
I'm trying to help. If I find your question interesting I'll give you karma. If you find my input useful please give me karma (I need it)

Grumpy_Mike

Ferrite clamps can just be considered as inductors because that is what they are. So if you want to replace them then you could use an inductor in seriese with your power cable. In addition you can use a capacitor to ground on the Arduino side of the inductor. Use a big capacitor like a 1000uF and in parallel with it put a 0.1uF ceramic capacitor. To increase the filtering repeat this circuit in series with the last.

I would even include those clamps and explain they are inductors and as such normal components. They are not exotic stuff like transorbs.

MarkT

Ferrite sleeves at higher frequencies (VHF) are often fairly lossy inductors, which is even better
as interference is largely absorbed rather than reflected back at its source.
[ I DO NOT respond to personal messages, I WILL delete them unread, use the forum please ]

tjtj13

Its unlikely that a signal from a digital device to another would use an analog voltage.  From your description I'd guess its a frequency, or PWM.
How you process it would depend on the actual signal. However you could try this as an experiment

https://www.instructables.com/Analog-Output-Convert-PWM-to-Voltage/

can you get an oscilloscope to look at the signal?
I think you might actually be right, I think it is a PWM signal. In my code, I use the pinMode and INPUT_PULLUP functions, so it must be a digital signal. Unfortunately, I don't have access to an oscilloscope :( but now knowing that it is indeed a digital signal, how does that change things? I assume I'll still be able to create some sort of filter to better isolate the desired signal, correct? Or would it be better to convert it to an analog signal using an RC circuit as shown in the link you provided, and then apply some filter?

tjtj13

Ferrite clamps can just be considered as inductors because that is what they are. So if you want to replace them then you could use an inductor in seriese with your power cable. In addition you can use a capacitor to ground on the Arduino side of the inductor. Use a big capacitor like a 1000uF and in parallel with it put a 0.1uF ceramic capacitor. To increase the filtering repeat this circuit in series with the last.

I would even include those clamps and explain they are inductors and as such normal components. They are not exotic stuff like transorbs.
Very interesting, I didn't know that! To create the filter the filter you describe, I would run the power from the car, through the LC circuit, and then to the Arduino? If so, I'm using the USB port to power the board, so how difficult would it be to accomplish this?

tjtj13

Ferrite sleeves at higher frequencies (VHF) are often fairly lossy inductors, which is even better
as interference is largely absorbed rather than reflected back at its source.
Interesting, given this I think I'll probably keep them in even after I apply the filter. However, I think I might take them off and see what the difference is and add it to my analysis in my report. Thanks!

Grumpy_Mike

Quote
describe, I would run the power from the car, through the LC circuit, and then to the Arduino?
Yes.

Quote
If so, I'm using the USB port to power the board, so how difficult would it be to accomplish this?
What is regulating the USB power down to 5V? You would put the filtering before that regulator.

johnerrington

We are REALLY in the dark about this. Do you have a reference for the ignition control module - or even at worst just a make/model/age for the car - that might give us a guide as to the nature of the signal?

Quote
So far I've been able to run the signal through a voltage divider to a digital pin on the board. I wrote a shell of a code to display the values and I took it out to test it. The RPM displayed at idle is accurate, however when I rev the engine or drive it, the error in the displayed value gets worse as the RPM gets higher.
What are your voltage divider values?
Can you show your code?

Quote
The RPM displayed at idle is accurate
howw do you know? Did you calibrate it at idle - if so the value would naturally be "correct".

Also - youre powering your arduino from the cars "12V" supply which is VERY noisy, and also can go as high as 14 - 15V (still within spec) but it means you do have some headroom to add an RC filter. Say a 10 ohm resistor and 1000uF cap.

Simple experiment - if the ig uses a single crankshaft sensor you COULD have a signal of 600rpm = 10HZ at idle.  So why not write (or crib) a sketch to time the interval between rising (or falling) edges?
I'm trying to help. If I find your question interesting I'll give you karma. If you find my input useful please give me karma (I need it)

Grumpy_Mike

#13
Nov 11, 2020, 09:33 am Last Edit: Nov 11, 2020, 09:35 am by Grumpy_Mike
Looking at your circuit from reply#3 you have wired up the voltage divider wrong.
The wire from signal goes to a resistor which is shorted out by the track of the bread board. The second resistor goes nowhere, so what you have is the signal being connected directly into pin 9 of your Arduino.

TomGeorge

Hi,
Can I suggest you draw your circuit with pen(cil) and paper and post a picture of it?
You can then spread out and layout your components better.

You can also label your components, their value  and any pin names.

Have you built your project on protoboard like in the Fritzy image?
Can you please post a picture of your project so we can see your component layout?

Thanks.. Tom... :)



Everything runs on smoke, let the smoke out, it stops running....

Go Up