0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

I've been wrestling with a circuit I'm trying to build for a few days now and a friend recommended I ask for advice here. I'm essentially trying to create an electronic switch controlled by a raspberry pi. The switch will open and close a circuit for a heating coil that needs about 0.25A and 5V and is running off a battery pack. The issue I'm having is coming up with a set of transistors or some other configuration that can allow the Pi to toggle power to the coil using only it's 3.3V output. I've fried several transistors already and have moved to Mosfets which are causing their own problems. If anyone has a recommendation or a simpler way of doing this I'd be very grateful. It's the final component I have to contribute to a group project I'm working on. Thanks!

\$\endgroup\$
  • \$\begingroup\$ What kind of problems are MOSFETs causing for you? \$\endgroup\$ – Dampmaskin Apr 10 '17 at 13:43
  • \$\begingroup\$ Essentially I had been using transistors to do a similar thing for a low powered circuit, and hadn't had issues with them once it was working. For that I'd been using a darlington pair. Was told to switch to a MOSFET to deal with the higher current and voltage in the other circuit. Been reading what seemed like contradictory information on how to set them up in this way but end story it that I'm unable to use the transistor to control the gating of the MOSFET. I checked the gate voltage so that should be fine. \$\endgroup\$ – Peter Forde Apr 10 '17 at 13:50
  • \$\begingroup\$ Please post a schematic of your circuit (Transistor or MOSFET). You will see a circuit and a pencil (7th symbol on toolbar). \$\endgroup\$ – StainlessSteelRat Apr 10 '17 at 13:51
  • \$\begingroup\$ With a sufficiently rated logic level N-channel MOSFET you should be able to achieve what you want. When used as an on/off switch you don't really have to worry about gate capacitance or slew rate. Just put a resistor in series with the gate, in order to keep the current from the Pi below the Pi's 16 mA maximum rating. To limit 3.3V to 16 mA, a 206.25Ω or larger resistor should suffice. \$\endgroup\$ – Dampmaskin Apr 10 '17 at 14:01
  • \$\begingroup\$ Thanks @Dampmaskin, I may actually be overdrawing from that pin in that case, the only MOSFETS I have access to readily are 497-5667 \$\endgroup\$ – Peter Forde Apr 10 '17 at 14:17
2
\$\begingroup\$

At these stated current and voltage, any common small signal transistor like the 2n2222 would work. 16 mA from your RPi at the base with a worst case hfe/gain for the 2222 means up to 450 mA at the collector. All you would need is a flyback protection diode on your coil to protect the transistor from the collapsing inductance field when you turn the transistor off. A 1n400x is okay for this application. It should be backwards across the coil.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ So I take it a 2N3904 has too small a collector current? I'll definitely go see if the electronics workshop has flyback protection diodes \$\endgroup\$ – Peter Forde Apr 10 '17 at 14:41
  • \$\begingroup\$ 2n3904 is only 200 mA according to this datasheet. sparkfun.com/datasheets/Components/2N3904.pdf In general, datasheets are your friends. If you want to build electronic stuff, you should learn to use them sooner rather than later. \$\endgroup\$ – Dampmaskin Apr 10 '17 at 14:51
  • \$\begingroup\$ oh yeah I had checked the data sheet , was checking I hadn't missed some other critical detail in the difference , only one I saw was the 200mA vs 1A max collector current. I'll raid the workshop upstairs and see what I can find \$\endgroup\$ – Peter Forde Apr 10 '17 at 14:55
  • \$\begingroup\$ Depending on the manufacturer some are 200 some are 300, and that's a continuous current unheatsinked. Pulsed or with heatsink its more. But honestly I thought it was 400 until I double checked. The 2n2222 in the plastic to-92 case is perfect for this and cost the same really. \$\endgroup\$ – Passerby Apr 10 '17 at 15:29
  • \$\begingroup\$ ok I checked and we don't have 2N2222 available at the moment so I'll ask around, in the meantime I found some others I'll experiment with and was able to find the diodes. Thanks very much everyone \$\endgroup\$ – Peter Forde Apr 10 '17 at 15:38
0
\$\begingroup\$

One problem with a Darlington configuration is that it does not saturate the main transistor, so it has maybe 700mV across it when 'on'.

That means less voltage for your load and much more power dissipation in the transistor. If you allow 200mW for a TO-92, that is just enough for your 250mA over a generous ambient range.

If you don't want to drive the Rpi hard and still want to saturate the transistor so it runs cool you can do something like this (output low = 'on'):

schematic

simulate this circuit – Schematic created using CircuitLab

Or if you prefer high='on', flip everything (this or, these days, a small SOT-23 or SC-70 logic-level MOSFET, would be my choice):

schematic

simulate this circuit

The 2N4401/4403 are good for 600mA theoretically, and are comfortable at 250mA when well saturated.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.