I've got a little project going where I want to hook up a load of sensors to my RPi (PH, Temp, Humidity, light etc. etc., a camera, and also power a 24v 1a DC device.

I'm wondering if this is possible from the RPi. I'm not looking to run this off of batteries and plan to run this from the mains (I know I can't directly power this from the RPi's GPIO just looking for the best way to do this/control it all.

Thanks in advance


  • (This should be a comment to your question, not a reply, but I don't have 50 reputation yet so I can't post a comment...) Do you mean via a relay? Switching 24v power is no problem via a relay you can control with the RPi. Aug 8, 2014 at 18:55

2 Answers 2


Add a PiFace. http://www.piface.org.uk/products/piface_digital/

It will give you input terminals for your sensors and 2 relays. (and 8 more open collector outputs).

The relays are rated oddly at 20v 5a. Since we can see in the PICTURE of the board on the link above that the physical relays are rated 277V 10A, the PiFace manufacturers rating must be based on the circuit board traces carrying the current, and if it's ok to switch 5A at 20v then 1A at 24v should be just fine.

  • Thanks for this! I had briefly seen this and was wondering how it works. How does the relay/pi face get powered?
    – Tom
    Aug 8, 2014 at 19:20
  • At the bottom of the above linked page there are links to all the various manuals and downloads associated with the board.
    – Tyson
    Aug 8, 2014 at 20:45
  • The datasheet for the relays (OMRON G5LA-1) components.omron.com/components/web/pdflib.nsf/0/… says they are rated for 5A at 24V DC. DC ratings for relay contacts are often around half the AC ratings. Aug 10, 2014 at 20:59

Ill put in my vote for the Darlington pair transistor, such as: 2n6043 or 2n6040, featuring no moving parts, high gain (2500) 8Amp, 60Volt, rating. (means its robust enough to handle all your load.)

you can drive them with a Pi (Ive used them for 12 watt strobes) Cost: about 40 cents, maybe less. size: smaller than a Piface, and possibly smaller than a relay (I've seen some tiny relays) Also, you'll want a 10K ohm resistor in on the base lead.

Oh, and it has a build in flyback diode. If you use a relay, make sure you put one of those in. I also can't tell if the PiFace has flyBack protection, although given its design, it should.

(Flyback protection: allowing a path for a collapsing Electromagnetic field to discharge through)

Heres a datasheet: http://pdf1.alldatasheet.com/datasheet-pdf/view/171229/ONSEMI/2N6043.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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