MOSFET vs BJT for Pi Relay Circuit
Posted: Fri Feb 21, 2020 11:14 pm
Ok... so Friday night and as usual no game or early weekend partying for me. It's the only time with access to both hobby equipment and internet at the same time so here we go.
This follows up on some interesting discussion in other threads on driving relays, EMF, and RFI. It quickly took on a life of it's own out here in the real world with some animated back-and-forth with a couple of my ham radio pals. For some odd reason there is huge resistance to abandoning the classic junction transistor circuits so popular back in the late 60's, early 70's. Magazines were flooded with them.
It's been a couple years since last working on this stuff so first order was to get up to speed reproducing Brandon's excellent scope captures using NPN transistor. No problem getting those same horrifically noisy traces using the setup shown below in first photo. Turns out they don't really have to be that nasty (even with bipolar) but we'll get to that.
Next pic has a few examples of the relays and transistors used out of the many dozens I tried. A collection of cheap and common 5v chinese relays and to220/to92 bipolar/MOSFET transistors.
Last is a random diagram downloaded from google showing the basic test fixture. Chose to wiggle GPIO14 (pin 8) because of convenient proximity to 5v and ground. The pot allows me to adjust drive current which, not surprisingly, turns out to be very important for the BJTs.
I'll put scope snapshots in separate posts to illustrate subjects clearer.
This follows up on some interesting discussion in other threads on driving relays, EMF, and RFI. It quickly took on a life of it's own out here in the real world with some animated back-and-forth with a couple of my ham radio pals. For some odd reason there is huge resistance to abandoning the classic junction transistor circuits so popular back in the late 60's, early 70's. Magazines were flooded with them.
It's been a couple years since last working on this stuff so first order was to get up to speed reproducing Brandon's excellent scope captures using NPN transistor. No problem getting those same horrifically noisy traces using the setup shown below in first photo. Turns out they don't really have to be that nasty (even with bipolar) but we'll get to that.
Next pic has a few examples of the relays and transistors used out of the many dozens I tried. A collection of cheap and common 5v chinese relays and to220/to92 bipolar/MOSFET transistors.
Last is a random diagram downloaded from google showing the basic test fixture. Chose to wiggle GPIO14 (pin 8) because of convenient proximity to 5v and ground. The pot allows me to adjust drive current which, not surprisingly, turns out to be very important for the BJTs.
I'll put scope snapshots in separate posts to illustrate subjects clearer.