MagPi - In Control


8 posts
by lemoncurd » Wed Jun 06, 2012 11:02 pm
Hi,

Firstly, I would like to congratulate all those involved in creating the MagPi. The magazine reminds me of the computer magazines from my youth, and I look forward to the next one!

Now for the (hopefully not too) dumb question. One of my main uses for the Pi is to start learning some more about electronics and experimenting with interfacing, so I am enjoying the In Control articles. This month's piece talks about digital logic states, and the need for a pull-up resistor to tie the IO port to 3.3V. This makes sense to me however my question is why is the separate 10K resistor necessary - is the connection not already present through the LED and the 470 resistor?

My experiments seem to suggest it works without the separate resistor, but I am keen to understand if I am missing something?

Thanks,

Oh, and if anyone is looking for male:female jumper wires in Maplin, you can get some small (4.5cm) ones described as interconnect cables (A39GF).
Posts: 2
Joined: Wed Jun 06, 2012 10:34 pm
by domesday » Thu Jun 07, 2012 9:19 am
Yes you are correct the LED & 470Ω Resistor would provide a pull-up, so the separate resistor is not strictly necessary. As the LED is there just to provide a visual conformation that the switch is working it would probably be a bit confusing to explain the dual purpose of using it as a pull-up. It basically lays the groundwork for the next instalment where we turn the 470Ω resistor 90deg so it is in position D1-D5 and connecting a second GPIO to point E1 so that now you have an input and an output.
Posts: 256
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK
by lemoncurd » Sat Jun 09, 2012 3:18 pm
Hi,

Thanks for the response. The electronics side of things is fairly new to me (or refreshing things covered in school 15 years ago) so it is good to know that I wasn't missing anything.
Posts: 2
Joined: Wed Jun 06, 2012 10:34 pm
by antiloquax » Mon Jun 11, 2012 12:06 pm
lemoncurd wrote:Oh, and if anyone is looking for male:female jumper wires in Maplin, you can get some small (4.5cm) ones described as interconnect cables (A39GF).


Thanks for that - I couldn't find these in my local Maplins. Now I know what to look for.
mark
Posts: 406
Joined: Sun Nov 20, 2011 11:37 am
by domesday » Mon Jun 11, 2012 12:17 pm
The Tandy catalogue number is (276-156) but unfortunately out of stock at the moment :(
Posts: 256
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK
by meltwater » Tue Jun 19, 2012 4:41 pm
I take it that you could use the circuit to drive the LED too as an output, effectively using one circuit as both input and output tester (without changing the wires).
Is there any issue with doing that? I guess that 1k resistor connected to the GPIO would protect it if the switch is pressed even when driving an output.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am
by domesday » Tue Jun 19, 2012 6:46 pm
You could use a single GPIO as both input and output but it would need a slightly different circuit. The resistor that is in-line with the GPIO connection would prevent there being sufficient current to drive the LED. It was deliberately created with the resistor being the first thing connected to the GPIO to avoid damage in case someone made a mistake connecting things on the breadboard.
Posts: 256
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK
by meltwater » Wed Jun 20, 2012 7:23 am
Looks like my LED is a very low powered one, so it still lights up.
It should do for what I have in mind, as long as there are no other issues with it.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam
User avatar
Posts: 981
Joined: Tue Oct 18, 2011 11:38 am