I'm debugging a circuit on a home project and hoping for some advice.
I have a relay set up like so:
The behavior I'm seeing:
- When I toggle the Raspberry Pi GPIO to
HIGH
, The relay will begin to thrash (turn on and off very quickly). - If I take the GPIO line and connect it directly to a 3.3V source from the RPi, the relay turns on cleanly. Disconnecting it from the source turns it off cleanly.
- Changing the RPi GPIO pin, (or changing the entire RPi module) still exhibits the thrashing, so I don't believe its a bad GPIO pin.
- I swapped the relay out for a g5le-1-asi dc3 (It is still set up to be driven by a 5V supply), thinking I was on the operating threshold. However the relay will still thrash when the 2N7000 is driven by a GPIO out.
From the datasheet, I understand the 2N7000 should have no problem being driven by the 3.3V RPi output. But Plugging it directly to a 3.3V source vs the 3.3V GPIO seems to suggest its an issue with the RPi's ability to deliver enough current through the GPIO output. Could this be correct?
What would be the recomended way to drive this relay?
Edit
This is the full schematic.
RTN
is connected to the RPi GND
and the RTN
on the flyback transformer.
- The RPi is powerd off of the
J3
connection - I have also powered the RPi off of an independent power supply
- The GPIO and RPi ground pins are connected to
J4
Edit 2
Everything is laid out on a PCB board with this design:
CER 150PF 440VAC Y5T RADIAL
. The tranformer is homemade, I used Magnet Wire and Triple insulated wire for the windings. However, I did not dip the transformer in varnish... It's tightly held togeather with 3M polyester film tape \$\endgroup\$