Just wanting to check this idea about RPI GPIO

4 views
Skip to first unread message

shykitten55

unread,
May 9, 2018, 4:59:04 AM5/9/18
to Robots & Dinosaurs
Ok, the new "YAK":

Alas the RPI isn't quite as good with GPIO as the Arduino, but that's how it is.

I have a RPZ (W) and it needs its GPIO pins applied to use.

(See attached)

Sorry for the messy layout.

I have a 4 channel level changer and shall put that on a GPIO pin to drive some NeoPixels.
Only 1 channel is needed/used just now, but.....    The future:  Who knows.

Also there will be 3 LEDs - maybe more - driven from the GPIO pins.
(I know:  shame on me)   But I can't remember if it is better to sink or source the pins.
IE:  The GPIO to the anode of the LED, or cathode.
I'm also not 100% sure about the resistor value, but I'm not at that stage yet.

Would it be better to drive a bunch of UJT/FETs to drive the LEDs?

The next "problem" is power.

Granted I can't suck a lot of power from the RPI.   But as they use the u-USB plugs for power, that has me a bit stumped.

Arduinos use those 2.1mm plugs and that makes power easier to set up if external device power is also needed.


So the "plan" is I get a good 5v supply.   Jaycar.  5v 3A.   But they have Arduino connectors, not u-USB.  But anyway.....
So that goes into the project's box.
From there, it will be fanned out to the RPI and the other things.  (eg: Level converter)

I'm also (maybe) wanting a buzzer to be powered from a GPIO pin.   I'm guessing that WILL need a UJT/FET to drive it.

Oh, and I have a small 5v stereo AMP.    Tiny-winy board.   L/R input; 5v input and L/R output.
Small speakers to be driven.   That will be from the audio out on the RPI.

How do I power the PI?
Must I use the u-USB, or can I send power to it via the GPIO?   (Kind of like the Arduino nano that I have done.)



I'll stop there, as I am worried I am digging a big/deep hole for myself.

Thanks again to all replies.


Desired RPI outputs.png

John Teague

unread,
May 9, 2018, 5:27:06 AM5/9/18
to sydney-h...@googlegroups.com
Hi,

My 2c worth

You should be able to grab a NeoPixel shield - unless you’re looking at building your own with the Level Converter?
I’ve made plenty of Rpi(w) projects - the last was an underwater diving mask with augmented reality (kind of like HUD) that tracked eye movement thru the pi to navigate the user interface.
Cool, cheap little things although power was a concern as far as I recall. Its different than its other RPi family. I think it requires 2A - or performs better with 2A? Or maybe I was just needing the higher Amps for the attached camera component - can’t recall, however better to power with 2A.  Especially if you’re looking at multiple components running off GPIO
I always powered RPi(w) projects either with a 2A battery bank, or USB 2A wall adapter.
I strongly urge AGAINST powering IN via GPIO - can you not split the source up and attach to Vin on RPi and Vin on other devices (like your Audio amp) - or power the amp off the other Vin on your RPi GPIO.

John.

--
You received this message because you are subscribed to the Google Groups "Robots & Dinosaurs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sydney-hackspa...@googlegroups.com.
To post to this group, send email to sydney-h...@googlegroups.com.
Visit this group at https://groups.google.com/group/sydney-hackspace.
For more options, visit https://groups.google.com/d/optout.
<Desired RPI outputs.png>

Cat

unread,
May 9, 2018, 5:40:12 AM5/9/18
to sydney-h...@googlegroups.com
Yeah, there is a nice RPiZ Neopixel shield, but it only has.....  8 (?) LEDs.   And it hogs all the other GPIO pins, as it is a "hat".   Other than putting another intermediate hat between them, I wouldn't be able to get to the other IO pins.

Well, and the LEDs are directly connected to the PI.   So it all has to be "so" to fit.
With a couple (three) wires from the RPI to the strip, I can move it easier.

I'm kinda thinking .......  40.

I'm still innocent at cutting USB leads to make custom power leads.

I guess I would just get an old u-USB cable and cut off the bigger plug and connect the power pins to the "external" point where the main 5v supply is connected.
But that's the limit of my knowledge at this point.   Don't know what wire is what in the USB cable.
Yeah, shocking!   I should know..     <wink>     But just there have been so many Yaks shaven lately, I just never needed to know it.

The only other alternative is that the power supply powers a USB HUB, and the RPI plugs into it.   But then it causes problems with:  from where do the other things get their power?
So really keeping/making it USB isn't really gaining me anything other than not cutting a USB cable.    But it really is just complicating the whole thing - right?

As stated, I'll get the Jaycar 5v 3A plugpack.


Your project sounds neat.   I'm guessing you get underwater a bit?

What kind of AR did it show?  Horizon?  Air supply?   .....?

Just interested.    How did you keep the water out of the RPI and the battery?   And the "display".

John.

To unsubscribe from this group and stop receiving emails from it, send an email to sydney-hackspace+unsubscribe@googlegroups.com.
To post to this group, send email to sydney-hackspace@googlegroups.com.
<Desired RPI outputs.png>

--
You received this message because you are subscribed to a topic in the Google Groups "Robots & Dinosaurs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sydney-hackspace/9Brxqk_MOwY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sydney-hackspace+unsubscribe@googlegroups.com.
To post to this group, send email to sydney-hackspace@googlegroups.com.

Aaron Power

unread,
May 9, 2018, 5:45:04 AM5/9/18
to sydney-h...@googlegroups.com

Everything you read on the Pi will recommend that you power it by the micro-USB port. That's the safest way to do it.

You can power it through the GPIO header using a 5V supply on pins 2 and 4 (see below). **BUT** this puts the power on to the Pi after any circuit protection that's built in to the Pi board. So if anything goes wrong with your power supply, it will most likely instantly fry your Pi.

Having said that, this is the way I typically power most Pi projects, especially if you are making some sort of HAT style add-on board. You just need to be careful that you use a decent power supply, with good regulation - and understand and accept if anything goes wrong, you're going to be buying a new Pi :-)

Cat

unread,
May 9, 2018, 5:54:16 AM5/9/18
to sydney-h...@googlegroups.com
Thanks Aaron.

So cutting a u-USB cable is probably a better/safer way to go.

It isn't rocket science, so I guess I can do it.   Just have to find the functions of the wires in the cable so when I cut it, I put power on the right wires.


Thoughts on the LEDs?  Should I use a UJT thingy rather than directly from the pins.
And buzzer - obviously.
I think that's a given that a UJT will be used.


John.

To unsubscribe from this group and stop receiving emails from it, send an email to sydney-hackspace+unsubscribe@googlegroups.com.
To post to this group, send email to sydney-hackspace@googlegroups.com.

Visit this group at https://groups.google.com/group/sydney-hackspace.
For more options, visit https://groups.google.com/d/optout.
<Desired RPI outputs.png>
--
You received this message because you are subscribed to the Google Groups "Robots & Dinosaurs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sydney-hackspace+unsubscribe@googlegroups.com.
To post to this group, send email to sydney-hackspace@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Robots & Dinosaurs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sydney-hackspace/9Brxqk_MOwY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sydney-hackspace+unsubscribe@googlegroups.com.
To post to this group, send email to sydney-hackspace@googlegroups.com.

Aaron Power

unread,
May 9, 2018, 7:16:24 AM5/9/18
to sydney-h...@googlegroups.com

Most USB cables I've ever cut in to (even the cheap ones) use red and black for the 5V power. It is meant to be green and white for the data (I think?) but I've seen other colours used.

Basically red and black = power; other two = data    <== But of course I would recommend you test before plugging it in.

Unless you are using some insanely bright, high powered LED and buzzer, I would just drive them straight off the Pi GPIO pins. You just have to remember that you are driving them from 3.3V rather than 5V, so the resistor values will be smaller.

Aaron

To unsubscribe from this group and stop receiving emails from it, send an email to sydney-hackspa...@googlegroups.com.
To post to this group, send email to sydney-h...@googlegroups.com.

Cat

unread,
May 9, 2018, 7:48:09 AM5/9/18
to sydney-h...@googlegroups.com
Thanks.

I was only mentioning the UJT to help keep the load on the Pi as low as possible.

The LEDs (the "real" ones) are only for indicating things happened.
So not super bright.


How do I check the u-USB to have the right power connected?
I'd need a u-USB (opposite sex) connector plug it in and compare it to pre-cable cut readings.
(Semi-rhetorical)



Kris

unread,
May 9, 2018, 4:36:15 PM5/9/18
to sydney-h...@googlegroups.com
With it powered off, check the ohms between red and black (should be infinite)
With it powered up

Use a meter to confirm red is 5 and black is 0 going into the connector. Find something you don't care about that charges via USB and test. Not something that would like data.


From: Cat <fuzzywu...@gmail.com>
Sent: 9 May 2018 21:48:06 GMT+10:00
To: sydney-h...@googlegroups.com
Subject: Re: [RnD] Just wanting to check this idea about RPI GPIO
--
Sent from my Breville Talkie Toaster with K-9 Mail. Please excuse my brevity.

Jess Mayo

unread,
May 9, 2018, 5:08:22 PM5/9/18
to sydney-h...@googlegroups.com
Generally gpio pins are better at sinking current than sourcing it, but you'd need to connect the positive side of the LED to 3.3v, and NOT the main 5v supply.

I really like the idea of using a powered USB hub, btw. It gives you a common point to connect to everything with a usb port in a project in addition to providing a common power distribution point. And if you don't want to open up the USB hub's case to solder to the insides, then soldering your own full-size USB plugs is a whole lot easier than messing with micro USB :)

I might use this idea myself sometime. :)

-- Jess
(Everything with a grin :)

Cat

unread,
May 9, 2018, 9:38:26 PM5/9/18
to sydney-h...@googlegroups.com
Jess,

Yes, using a HUB is "nice" but it is also problematic.

As much as it gives me "free" connection to the RPI:  The plug pack from JC won't connect to it.   The plug pack is "arduino input" compatible.   2.1mm cylinder connection.
Putting that aside, then there is the power to the other circuits.
I will have to then cut a normal USB lead to get power to those boards.

I'm kind of erring on the idea of having the 2.1mm socket, wires -->  board.
From there, the other circuits get their power and I cut a u-USB cable to give power to the Pi.

But thanks.

Now, the sink/source on the RPi.
Ok, sinking is better.

I'm not sure how many LEDs I will be driving.  At this stage 3 (maybe 4, only for +1 expansion flexibility.) and a buzzer.

So the FET/UJT idea.....    Is that overkill?
It isn't a big deal, as the logic levels on the output can be jigged to suit what there is, so the code won't change (as such).   Only the output levels for what is what.

Again, I am just asking to know what other people have done in their projects.



andrewl

unread,
May 9, 2018, 10:27:34 PM5/9/18
to sydney-h...@googlegroups.com



Sent from my Samsung Galaxy smartphone.

-------- Original message --------
Date: 10/5/18 11:38 am (GMT+10:00)
Subject: Re: [RnD] Just wanting to check this idea about RPI GPIO

To unsubscribe from this group and stop receiving emails from it, send an email to sydney-hackspa...@googlegroups.com.
To post to this group, send email to sydney-h...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages