Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3436

HATs and other add-ons • Relay Induced Noise

$
0
0
Hi,

I am working on a little project to control some relays using an RPI. I am using PiRelay V2 (https://thepihut.com/products/pirelay-r ... spberry-pi) for the relays. The load I am handling is 9.2V 0.1A, it's a security door latch.

I have a TTP223 (https://www.amazon.co.uk/JZK-TTP223-Sel ... ial&sr=1-2) sensor for the switch.

I am using python to control the monitor the switch and control the relay. I also have a webserver running for secondary control for testing.

When I run the service without the sensor wired in, everything works as expected. Having the button wired in and I seem to get heavy bounce only when the relay is turned off. Checking things out further, if the wire for the sensor is connected to the PI and not the sesnor, I get heavy bounce when the relay turns off. The result of this bounce is after the relay is turned off, it turns right back on.

I have tested this without a load on the relay and I do not get any bounce, it all works as expected.

Inline on load side of the relay I do have a 10A10 inline as a flyback diode but I see this as saving the power supply and not having interaction with the RPI GIO.

In my python I am setting the callback on the sensor going high:

Code:

    GPIO.add_event_detect(        pin, GPIO.RISING, callback=button_callback, bouncetime=5)
I have tried a variety of values on the bouncetime but haven't found a value which would stop it resetting back high.

Could this be an inductive load on the wire button? Is there a way to prevent this from happening? Do I need to shield my GPIO wires for the switch?

I went with using a hat instead of an eternal relay as I assumed that it would safely connect to the relay board for me and I wouldn't have to worry about noise on the line caused by the relay trigger.

Any advice on how to prevent this false triggering back to my "on" state would be appreciated.

Statistics: Posted by michda — Sun Aug 25, 2024 8:20 pm — Replies 0 — Views 9



Viewing all articles
Browse latest Browse all 3436

Trending Articles