1
$\begingroup$

I'm still new to RPi and I am currently trying to do a smart home model.

I planned to use RPi only to control 5 servos (which will be controlling the open/close of the doors by setting the angle) and 5 LEDs.

Will I need to use an external circuit to supply the power for the servos or is it fine to just connect them to the RPi?

$\endgroup$
  • $\begingroup$ Hi Kar, and welcome to SE Robotics. Yes, you could, although additional circuitry ({power] transistors mostly, I guess) would be required in order to provide sufficient current to the servos, as the GPIO is rather limited in its current capability, as well as only providing 3.3V on the I/O. 3.3V (and the low current) would be fine for the LEDs, however, and only a resistor is required for each of the LEDs. You might find it easier to use an Arduino with an Arduino servo shield. However, I guess you want to learn the Pi and use it in a project, in which case fair enough, and yes you can. $\endgroup$ – Greenonline Apr 18 '16 at 16:27
  • $\begingroup$ Thanks a lot, actually I was thinking to use arduino too. But I was trying to use Webiopi to provide a UI for controlling all the components and I couldn't quite get how to code for the serial connection. $\endgroup$ – Kar Keng Chan Apr 19 '16 at 6:41
  • $\begingroup$ Arduino would be better, IMHO. However, regarding WebIOPI - In that case, you may want to edit your question, and ask that instead, or (better still) ask a separate question on Stack Exchange Raspberry Pi, as your second WebIOPI issue is more related to Pi that Robotics. This current question, as it stands is a little too broad, and may get closed. $\endgroup$ – Greenonline Apr 19 '16 at 8:12
  • $\begingroup$ Also, take a look at this question, Advice on domotic project improvement and the video $\endgroup$ – Greenonline Apr 19 '16 at 8:25
  • $\begingroup$ Welcome to robotics Kar Keng Chan, but I'm afraid it's not clear what you're asking. We prefer practical, answerable questions based on actual problems that you face, so it's a good idea to include details of what what you would like to achieve, what you tried, what you expected to see & what you actually saw. Please take a look at How to Ask & tour for more information on how stack exchange works & work through the Robotics question checklist to edit your question to make it clearer. $\endgroup$ – Mark Booth Apr 19 '16 at 9:15
3
$\begingroup$

Though, there is not much information about your servos let's assume that they consume at least 1A each. This value will probably be higher given that you want to move doors and that requires torque.

Now let's see the RPi's capabilities. An answer from Stack Exchange Raspberry Pi, tells you the necessary information and sources about the RPi's power rails and GPIOs.

The 3.3 V supply can source a maximum of 50 mA, as the GPIOs are driven from this rail too. A GPIO can source max 16 mA, the overall current sourced by GPIOs cannot exceed the 3.3 V rail's max 50 mA.

This is far not enough but also 3.3 V would be too low for supplying a servo, as servos usually need 4-6 V.

The 5 V supply rail is limited by the power supply that powers the RPi, minus the RPi's current consumption. You did not provide what model do you use, so here is a table with each (except RPi3) models power requirements.

enter image description here

Now, if you want to power your servos from the RPi's 5 V rail, your maximum current is at least 5A + RPi's consumption. If you check, most USB micro type B connectors are rated on 1.8 A, but even if the connector can handle 5-6 A, driving this much current through the board just to supply your servos would be risky.

The best solution would be an external supply which provides 6 V as your servos will have higher torque at 6 V. Also it must be able to supply six times a servo's current.

A possible block diagram:

schematic

The driving circuit can be a simple current limiting resistor an each pin of the RPi or you can use an appropriate small-signal FET as an interface.

As for connecting the LEDs, you can use a simple current limiting resistor and GPIOs, but be careful to not exceed the 50 mA of the 3.3 V rail.

$\endgroup$
2
$\begingroup$

Raspberry Pis can be used for a huge range of things! And I like your idea!

Although, you could use an Arduino Pro Micro board as that has everything you need and doesn't have unnecessary items like Ethernet cables etc... It comes a lot cheaper - £2 here in the UK from Amazon!

Bence Kaulics explains it very clearly and I suggest you use that idea.

My suggestion is that you can use a relay board that the Raspberry Pi controls and the relay board will power the servos. Use a relay board because you need a stable current and voltage to power the servos, especially to move a window, you will need powerful servos. The relay can suit the needs and protect the servos.

You can also connect more items to the relay if you want to improve the smart home model by adding motion sensors outside the window and alarms.

$\endgroup$
  • 2
    $\begingroup$ Hey Sid, I edited out the introduction of your answer, because it doesn't add to the answer directly. Please do not add it to all of your posts. We are an international Q&A site with users of all ages. There's no reason to apologise for your age (this is true in general) If you want to say something about yourself, feel free to do so on your profile page. If somebody doesn't understand something in your answer (or question) or wants to point something out, they will leave a comment (like I'm doing here right now) $\endgroup$ – Bending Unit 22 Aug 8 '16 at 15:04
  • $\begingroup$ Thanks a lot for your support! Also, thanks for the advise, will use in the future! $\endgroup$ – SidS Aug 9 '16 at 7:56

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.