I'm new to this Raspberry Pi.

I'm trying to build this project: https://www.hackster.io/hitherejoe/braillebox-braille-news-reader-e86060

But the circuit diagram in it: https://hackster.imgix.net/uploads/attachments/357959/1-8db2h30syhohrgn6zxnyfg_IVxu3IGhW9.png?auto=compress%2Cformat&w=1280&h=960&fit=max looks a bit scary as it is directly taking power from the Raspberry.

Also, in that circuit, from where are the solenoids getting the 5V DC current? They are just connected to ground and the GPIO pins, right?

Also, in case, can I power a very small (3V) solenoid directly off the RPi (using a diode for safety, of course)?

Sorry if this sounds silly.

  • 2
    Could you explain how you plan to connect the relay to the Pi and give details of the relay. Not everyone is willing to trawl through external links for information which should be part of the question. – joan Jan 3 '19 at 12:08
  • Possible duplicate of GPIO pin voltage is too low to energize relay – Dmitry Grigoryev Jan 15 '19 at 8:11

"Houston, we have a problem"...

Just as an aside, and before I try to provide some answers, I should tell you I am really NOT very keen on troubleshooting project designs and blog posts that people drag into this forum. I think @joan's comment above reflects a similar sentiment. Why do I say this - why do I feel this way? I feel that if you're following a project recipe that someone has taken the time to build and post in their blog, the author of that recipe/blog should be your first stop for questions.

That said, I have partially read through the article/blog post you referenced, and my intuitive (aka System 1) reaction is that it's a waste of time. But again, this is my intuitive/System 1 response, with very little System 2 resourcing applied. I base my opinion on the following, all gleaned from the article/blog post:

  1. The author writes, "I’m no expert in electronic engineering, but nothing has caught on fire yet so I think it’s doing good enough for a prototype..." Hmmm...
  2. RPi GPIO pins are rated at 3.3v, but the solenoids used in the project are 5v
  3. The author mentions he adapted the design from one done for an Arduino (and Arduino does have 5V IO IIRC)
  4. A fritzing diagram is used instead of a proper schematic (Note - I don't like fritzing diagrams, but this is a personal bias)

So, this is the basis for my snap judgment. Again, no offense meant to the author, or anyone else, it's just my opinion. And the circuit may actually work after a fashion, but that doesn't mean it's a sound design.

To answer your questions:

I don't think it's generally a good idea to source power for a project like this from the RPi's 5V pin - so yeah, scary would cover that.

The solenoids appear to be driven by the 3.3V GPIO pins, which is odd since they're 5V solenoids. I didn't see any specifications on the solenoids, so I can't say how their current requirement compares with GPIO limits. Also note that the absence of any specifications for the solenoids may have something to do with the fact that the author is offering to sell them on his website. I don't care for this sort of marketing (again, a personal bias).

And finally wrt your question re powering "a very small (3V) solenoid directly off the RPi (using a diode for safety, of course)?": I'm not sure I get your question exactly... I think you could power a 3V solenoid directly from a RPi GPIO pin as long as you placed an appropriate current limit on the pins (individually and collectively). When you mention the protection diode though, are you thinking of arranging it as a "freewheeling diode" to eliminate the L*di/dt "inductive kick" from turning the solenoid "OFF"? If so, then "Yes" again.

In summary then, I'm not at all sure the project you've found is a good one to start with. It's a very nice idea, but IMHO, seems to be lacking in execution of the design. That said, if you're keen on doing a project like this, we're happy to help. My suggestion is to break it down into smaller steps, experimenting as you go, and asking specific questions on points that aren't clear (like your question re the solenoid).

P.S. Here's a link to what seems to be a decent summary of RPi's GPIO system. You may wish to read it as you ponder your path ahead.

| improve this answer | |

Initial Disclaimer: I'm of the opinion that design review/critique is an important part of learning and has a place in a hobby design oriented community like RPI. That being said I do think that the project stands as it is, a perfectly reasonable but underdeveloped prototype that will function for some time as designed assuming you are able to locate similar performing solenoids.

However the design is not entirely robust and will likely break eventually unless the solenoids are very low current devices (<16mA)

Design decisions/assumptions that are implied by this blog and how they are / are not met

  1. GPIO pin current is limited to 33mA by the 100Ohm Resistor for each solenoid
    1. GPIO Rating is max 16mA per pin (33>16mA = Can Exceed for some solenoids)
    2. Max Total GPIO Current is 51mA (33*6 ~200 > 51mA Can Exceed when all actuated)
    3. Max 3.3V Current is 50mA (Can Exceed when actuated and heavy CPU Load)
  2. Generic Solenoids rated at 5V can still work OKish at 2.5V (3.3V - Diode) (Probably True)
    1. Solenoids are "current devices" and are typically specified with a current required to actuate the device at a particular voltage
    2. They will likely specify required current at other voltages as well
    3. The effective resistance of the solenoid at a given voltage can be computed from the datasheet/specification current.
    4. If the system cannot deliver the current then the solenoid may not actuate adequately.
  3. Solenoid impedance at 3.3V combined with series resistor is enough to reduce current below 16mA per pin maximum (Probably true for steady state)

Conclusion: The conclusion is that this approach is very much dependent on the specification of the solenoids used. The design exposes the RPI to possible excess current during solenoid actuation or patterns that require multiple solenoids actuating simultaneously. The solenoids are liable to being underdriven and thus actuate slowly, weakly, or fail to actuate (unless they are <16mA @2.5V) and the GPIO is liable to being overdriven when actuating solenoids as the series resistance will not limit short circuit current to below the max gpio current.

For your specific questions

  1. The 5V is not being used for anything, note that it is powering the breadboard rails, but not used for anything on the breadboard.

  2. The solenoids are being driven at 3.3V directly from GPIO

  3. Resistor and diode serve as moderate current limiting and reverse voltage protection (respectively) . However they are not sufficient to guarantee safe operation


  1. Isolate the GPIO from inductor/solenoid current by using a buffer IC, transistor, or optocoupler (Copy from any of the hundreds of relay driver designs from RPI)

  2. (Combined with 1) Drive the solenoid from high current 5V Directly

| improve this answer | |

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.