SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By matt99eo
#179679
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?
User avatar
By Ross Robotics
#179699
How is everything connected?
How long are the wires?

With the info you provided, maybe some large (+100uF) decoupling caps might do the trick.
By matt99eo
#179715
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?
By rrpilot
#179717
matt99eo wrote: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:
Screenshot_021315_042745_PM.jpg
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/(2*pi*(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.
You do not have the required permissions to view the files attached to this post.
By matt99eo
#180179
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).
By Mee_n_Mac
#180181
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 !