Simple GPIO testing board


65 posts   Page 3 of 3   1, 2, 3
by rurwin » Sat Jun 23, 2012 7:15 am
Sorry, in a hurry.

1. red, black, black, brown, brown is 2001 x 10, so 20K, but I'm surprised about that rogue "1" in there. Check it with a multimeter; it's the only way to be sure, some of those colours can be muddy and with four lines it's not always easy to work out which end to read from. I suspect that last brown is the tolerance band and the rest is three-band -- so 2K.

2. That circuit is not the same as the one you designed. The 2K should not go between switch and 3.3V; it should go between switch and GPIO.
Last edited by rurwin on Sat Jun 23, 2012 7:31 am, edited 1 time in total.
User avatar
Forum Moderator
Forum Moderator
Posts: 2902
Joined: Mon Jan 09, 2012 3:16 pm
by basst85 » Sat Jun 23, 2012 7:16 am
RaspberryPiBeginners wrote:Looks like i need http://goo.gl/5255W app on my android phone to check that they are giving me.


Nice app, but there are also plenty of free alternatives:
https://play.google.com/store/search?q= ... ode&c=apps
Posts: 6
Joined: Sat Jun 02, 2012 9:57 pm
by rurwin » Sat Jun 23, 2012 7:43 am
It's worth committing to memory.

Code: Select all
Bill  Brown  Read  Olaf   Yellow's Green  Book;  Very   Good  With        Real Gold and Silver Pages
black brown  red   orange yellow   green  blue   violet grey  white       red  gold     silver plain
 0     1      2      3      4        5     6       7     8      9          1%   5%        10%   20%

The last colour band other than the tolerance is the number of zeros to add:
Code: Select all
brown black black red
1      0     0    00
User avatar
Forum Moderator
Forum Moderator
Posts: 2902
Joined: Mon Jan 09, 2012 3:16 pm
by RaspberryPiBeginners » Sat Jun 23, 2012 1:24 pm
Again i cant thank everyone for the constant feedback. I've never been apart of such an active forum is great.

Rurwin, unless i'm reading it wrong have you not contradicted yourself here?

rurwin wrote: Put something like a 2.2K resistor between the switch and the power.


rurwin wrote:That circuit is not the same as the one you designed. The 2K should not go between switch and 3.3V; it should go between switch and GPIO.


Looking at my design i can see that the PCB is different to my bread board....hhhmmm

My PCB design the 2.2k is between the switch and the GPIO pin.
My BB design the 2.2k is between the switch and the 3v3 supply.
Click here for my unofficial YouTube Channel > http://goo.gl/oFYBD
User avatar
Posts: 214
Joined: Fri May 11, 2012 6:54 am
Location: Soham, Cambridgeshire
by rurwin » Sun Jun 24, 2012 4:54 pm
RaspberryPiBeginners wrote:Rurwin, unless i'm reading it wrong have you not contradicted yourself here?
Yes, I am. Between the 3.3V and the switch should work. If taking it out works, then you can't be getting enough current through to drive the GPIO pin low, but I can't see that; 2.2K will give you over 1mA, which I would have thought was plenty.
User avatar
Forum Moderator
Forum Moderator
Posts: 2902
Joined: Mon Jan 09, 2012 3:16 pm
by RaspberryPiBeginners » Fri Aug 10, 2012 8:53 am
Does anyone know where to get one of these from?

I need a 26 pin surface mount device, i kinda ordered the wrong thing for my new board.

Image
Click here for my unofficial YouTube Channel > http://goo.gl/oFYBD
User avatar
Posts: 214
Joined: Fri May 11, 2012 6:54 am
Location: Soham, Cambridgeshire
by rurwin » Fri Aug 10, 2012 10:59 am
RS have one, but without the latches.
Farnell have several, including ones with latches, but those are not cheap.
User avatar
Forum Moderator
Forum Moderator
Posts: 2902
Joined: Mon Jan 09, 2012 3:16 pm
by MattHawkinsUK » Fri Aug 10, 2012 11:37 am
Interesting thread. In my circuits I am ignoring the internal pull-up-down resistors. I don't want to risk forgetting to set them or making mistakes in the code so I always put in external resistors. Everyone makes mistakes/typos in code. Errors are no problem in software but are more annoying if it destroys some hardware in a blink of an eye! I like resistors I can see. Not as optimised but you know where you are with resistors physically in your circuit. Also people copying your circuit may not realise you are enabling internal resistors.

This is how I do LEDs :
Image

and this is how I do switches :
Image

I like the transistor approach for switching on LEDs because it is the same approach I can use for other low power devices without using a separate design and different components. This works equally well for small buzzers. It also avoids using the GPIO pins for supplying power. It requires more externally components but they are cheap and put more things in the way of damaging the Pi.

Gert kindly commented on my blog and helped me choose better resistor values. (This wasn't an endorsement of the circuit itself but it helped improve it). I use 560, 1K, 10K and 27K resistors for everything now as I bought a few hundred of each :-)

Both these circuits were inspired by the suggestions in the Pi Wiki.

I think a bit of trial and error is ok but you just need to challenge people on their choice of components if you are using circuits off other sites. There are no perfect choices for resistor values but there should always be a good reason for choosing 1K over 10K etc.

In general you should ask these questions :

    How did you calculate/choose the resistor values?
    How does the circuit behave if GPIO pins are incorrectly configured?
    What voltage is presented to each GPIO?Is this ok?

Anyone sharing circuits should be happy to be challenged and should find it easy to justify their choices. I actually appreciate it because it helps me make better choices for my own mad inventions.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook and Twitter (@RPiSpy)
User avatar
Posts: 480
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
by RaspberryPiBeginners » Fri Aug 10, 2012 11:39 am
Bring on the GERT BOARD :lol: !!!!!!
Click here for my unofficial YouTube Channel > http://goo.gl/oFYBD
User avatar
Posts: 214
Joined: Fri May 11, 2012 6:54 am
Location: Soham, Cambridgeshire
by RaspberryPiBeginners » Fri Aug 10, 2012 11:56 am
And apparently you need an account with RS to get a sample sent out which is fair enough.
Click here for my unofficial YouTube Channel > http://goo.gl/oFYBD
User avatar
Posts: 214
Joined: Fri May 11, 2012 6:54 am
Location: Soham, Cambridgeshire
by pjc123 » Sat Aug 11, 2012 1:44 am
MattHawkinsUK wrote:Interesting thread. In my circuits I am ignoring the internal pull-up-down resistors. I don't want to risk forgetting to set them or making mistakes in the code so I always put in external resistors. Everyone makes mistakes/typos in code. Errors are no problem in software but are more annoying if it destroys some hardware in a blink of an eye! I like resistors I can see. Not as optimised but you know where you are with resistors physically in your circuit. Also people copying your circuit may not realise you are enabling internal resistors.


+1.

In my C code the very first things that I do are to set the internal pull-up and pull-down resistors to deactivated, set up the GPIO pins as either inputs and outputs, and set them to a known state.

I am using the same circuits with some very minor differences.

1) For the LED drive circuit, my base resistor is 2.2K, giving me a 1.18 ma base current and a 5.23ma LED current. I may try to increase that to 27K and see if it still works.

2) For the switch circuit, in parallel with the 10K resistor I have an LED in series with a 460 ohm resistor. Not necessary, but when I push the button the LED lights up giving me some feedback.
Posts: 910
Joined: Thu Mar 29, 2012 3:37 pm
by Grumpy Mike » Mon Aug 13, 2012 12:48 pm
MattHawkinsUK wrote:In my circuits I am ignoring the internal pull-up-down resistors. I don't want to risk forgetting to set them or making mistakes in the code so I always put in external resistors. Everyone makes mistakes/typos in code. Errors are no problem in software but are more annoying if it destroys some hardware in a blink of an eye!


Forgetting to enable a pull up or pull down resistor can not destroy anything. It might make it not work correctly, like not seeing a button press or being susceptible to noise but that is it. There is going to be no damage done to anything.
User avatar
Posts: 783
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by RaspberryPiBeginners » Tue Sep 04, 2012 10:20 am
Finally found everything i need :)

Looks awesome and really happy with it.

Image
Click here for my unofficial YouTube Channel > http://goo.gl/oFYBD
User avatar
Posts: 214
Joined: Fri May 11, 2012 6:54 am
Location: Soham, Cambridgeshire
by DexOS » Tue Sep 04, 2012 8:14 pm
I agree, they look very nice, did you have them made up in the uk ?.
Batteries not included, Some assembly required.
User avatar
Posts: 860
Joined: Wed May 16, 2012 6:32 pm
by RaspberryPiBeginners » Tue Sep 04, 2012 8:36 pm
The PBC was make in Germany, is did the soldering
Click here for my unofficial YouTube Channel > http://goo.gl/oFYBD
User avatar
Posts: 214
Joined: Fri May 11, 2012 6:54 am
Location: Soham, Cambridgeshire