-1

I have electromagnets I want to control using a Raspberry Pi. They run on 12V and each use 0.3A when briefly operating.

For various reasons I want to control the positive and negative sides of each magnet separately. I can achieve this using simple relays but wondered if I could use MOSFET drivers.

The website at http://www.gammon.com.au/motors has both high- and low-side MOSFET driver examples.

Would it be possible to have an arrangement (see below) which effectively combines a high- and low-side driver for the same load? I.e. the magnet would only operate if both the pins from the Pi are high.

(Diagram adapted from ones on the aforementioned website.)

enter image description here

Thanks.

user2878409
  • 111
  • 6
  • 3
    Note that the I/O pins on a Pi are 3.3 V not 5 V. – evildemonic Mar 11 '22 at 19:41
  • 2
    Just out of curiosity, why do you want both a high and low side switch? – evildemonic Mar 11 '22 at 19:44
  • 1
    There's a bit more context behind my question here: https://electronics.stackexchange.com/questions/609615/controlling-flip-vane-clock-digits?noredirect=1#comment1606328_609615 @evildemonic – user2878409 Mar 11 '22 at 20:03
  • "So to display a segment, you'd apply +12V to the digit Common and -12V to the segment's Display terminal. To reset it, the -12V would go to the Reset terminal instead." Is this the reason? – devnull Mar 11 '22 at 20:27
  • 1
    Yes, pretty much. I can then 'strobe' the signal across the digits by switching the common off/on for each of them. – user2878409 Mar 11 '22 at 20:35

2 Answers2

1

This works just fine. You have what amounts to half of an H-bridge circuit.

evildemonic
  • 8,698
  • 2
  • 25
  • 44
1

From the first question in this series, it seems that the high side switch would have to handle 1.960mA (for seven segments) and each lower one would just need to handle 280mA for each segment. The PMOS may need a heatsink depending on the model you choose.

Additionally, -12V is mentioned, unlike the schematics in the question. If this is correct, you'd have 24V in the PMOS gate, which will damage most parts you'd have at hand. A voltage limit with a Zener is probably the simplest way to solve this.

Finally, the NMOS needs a low voltage threshold (search for logic level MOSFET). Otherwise, you would need a different circuit using the 5V from the Pi and not the 3.3V from the pin directly.

devnull
  • 8,447
  • 2
  • 15
  • 38
  • Thanks, I'll consider the heatsink and whether it's needed depending on the (logic level) MOSFET I go for. The -12V which was mentioned was a mistake by me - it should just say 0V. Do you think the resistor values are fine? – user2878409 Mar 11 '22 at 23:16
  • 1
    The resistor values are not critical. Larger values would switch slower, which is not critical for this application. You may want to increase the high side resistors to 10K since the collector one will consume ~1/8W with the PMOS on, and you will have many of those. – devnull Mar 12 '22 at 09:37
  • Thanks for info. Just one more thing - does the high-side MOSFET need to be a logic-level one as well? I note on the http://www.gammon.com.au/motors webpage that it just describes it as a P-channel MOSFET and not specifically a logic-level one. – user2878409 Mar 12 '22 at 10:10
  • No. There will be 12V between gate and source. Make sure from the specs of the part you choose that it can withstand that. – devnull Mar 12 '22 at 10:41
  • I've finally got round to doing some testing with this. I tried it with one high side and one low side and it controlled a vane. However when I added another high side, both high sides switch on regardless of which one is 'active' (via the Pi's pin). The one that should be on reads 12V, while the one that shouldn't be on reads 11.6V. Do you have any idea why this could be? Thanks. – user2878409 Apr 14 '22 at 22:09