Beagle bone GPIO noise when flicking a fan on and off

Hi,

I am working with a beaglebone black and am using adafruit’s GPIO library for controlling and using the GPIO pins. The board is powered via a wall wart 5V switching power supply.

I am feeding a 3.3V TTL pulse into the one of the pins and looking for rising edges to detect a ‘pulse’ This works very well until I start turning other things on in my house that are on the same circuit. Fans, vacuums all trigger a pulse event.

How can I elimiate this ? Optocouplers? Better power supply?

How is everything connected?

How long are the wires?

With the info you provided, maybe some large (+100uF) decoupling caps might do the trick.

On top of what codlink is suggesting, I would try adding 1nF cap on the GPIO line to ground. I’m assuming you aren’t doing anything “high-speed” here.

The signal comes in thru a voltage divider to keep it at 3.3V max. The inputs are wired directly to the GPIO. The meter is powered from the BBB 5V rail and everything is tied to the BBB Ground.

With the 1 nF cap on the GPIO to ground line where is the frequency cut out? This is essentially a low pass filter right?

matt99eo:
With the 1 nF cap on the GPIO to ground line where is the frequency cut out? This is essentially a low pass filter right?

Exactly, essentially filtering out the EMI that is likely the cause for your unintentional tripping.

Is your circuit wired up something like:

I was originally assuming that you had the input directly connected but in this case you can easily calculate the cutoff frequency using:

fc = 1/(2pi(R1||R2)*C1)

which in the case of my parameters calculates to around 31.8 kHz.

What values are you using for your voltage divider? Using large values can make you more susceptible to EMI issues without further consideration.

Well I have tried this among other things and still am getting false positives when switching my fan.

Is the issue that I am using GPIO.wait_for_edge(pin, GPIO.FALLING) ? On my oscope I can see when I flick my fan on and off very fast garbage pulses coming thru the input pin overlayed on top of the pulse I am triggering off of. I imagine these falling edges is what is giving me grief (well I know they are lol).

What device is making the pulses you wish to count ? How is it’s “ground” tied to the BB’s “ground” ? How are both tied to the house neutral ?? Without just the signal line connected to the voltage divider, do you get false edges when switching on/off household appliances ? What happens when the signal line is connected at the divider/BB end but left disconnected at the pulse making end ?

Since you have to reduce the voltage, an opto-coupler might kill 2 birds w/1 device.

Not that I advocate the killing of innocent avian lifeforms.

Well, not unless they’re the ones that make all manner of noise in the early AM. Or mess up my car. Or are a Canada goose. Then I say nuke 'em from orbit !