oatkinson
Posts: 2
Joined: Mon Jan 28, 2013 4:35 pm

Using Buffered I/O to change an LED

Mon Jan 28, 2013 4:45 pm

Hi,

Im relatively new to electronics and have purchased a Gertboard Rev 2.

I have an external LED and I want to be able to send the Gertboard a signal to turn it on and off, (I do not want the LED on the board). I am not sure what to connect where, or where to ground the LED.

This is a picture of the LED I am using:
Image

I have tried searching online tutorials for a basic step by step explanation however I am not very competent with electronics and do not understand the lingo very well. I am however experienced with programming.

I have made the setup work using a PhidgetsInterfaceKit via USB to the RPi however I want to cut Phidgets out of the equation and just use the RPi and Gertboard.

Hope this all makes sense, I will try answer questions about my setup as best as I can (and can take pictures if necessary).

TL;DR I want to send an signal to a buffered output to change the state of a external LED.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Using Buffered I/O to change an LED

Mon Jan 28, 2013 7:33 pm

Choose a GPIO port, say 25.
Connect a wire from GP25 to a buffer pin, say B1
Connect the long leg (+) of your led to the corresponding buffer pin BUF1 and the short leg to -| symbol next to it (all -| are joined)
Don't forget to put a resistor in to limit the current to the led.

Then write your program. When the port is HIGH, led will light.
Alex Eames RasPi.TV, RasP.iO

domesday
Posts: 258
Joined: Fri Oct 21, 2011 5:53 pm
Location: UK

Re: Using Buffered I/O to change an LED

Mon Jan 28, 2013 8:43 pm

Perhaps you should try the interfacing articles in the MagPi magazine, will probably help you.

oatkinson
Posts: 2
Joined: Mon Jan 28, 2013 4:35 pm

Re: Using Buffered I/O to change an LED

Tue Jan 29, 2013 2:25 pm

Thanks, got it working! Was quite simple after your explanation.

Shame the Pi only supports 3.3v out on the Buffered I/O - my stepper motor controller needs a 5v pulse. I have opted for an Arduino UNO instead.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Using Buffered I/O to change an LED

Tue Jan 29, 2013 2:41 pm

oatkinson wrote:Thanks, got it working! Was quite simple after your explanation.

Shame the Pi only supports 3.3v out on the Buffered I/O - my stepper motor controller needs a 5v pulse. I have opted for an Arduino UNO instead.
You can use the open collector on the Gertboard to run a stepper motor with an external power supply for the motor, which I believe can be up to 50 volts.

Have a look at the open collector ocol program and just use four or six ports (pulsed) instead of one. I know it works because I've been doing it with a 12 V stepper motor and darlington array, which is what the Gertboard has at U12. I don't have any software to share at this stage though.

You can also use logic level converters to shift up from 3v3 to 5v. But there's no reason not to have an Uno as well - I'd like one too. :D
Alex Eames RasPi.TV, RasP.iO

Return to “HATs and other add-ons”