dhjacobs6
Posts: 2
Joined: Sat Jan 05, 2019 1:37 pm
Occupation: Parent

Can't get LEDs to work properly

Postby dhjacobs6 » Sat Jan 05, 2019 1:41 pm

We just opened up our new Raspberry Pi kit and are attempting to do Project #1, Light Up Piano. As a test, we have the following hooked up on the breadboard:
Red Jumper cable from J5 to J20, Red LED F20 & E20, resistor from A20 to ground line
Green Jumper cable from J6 to J22, Green LED F22 & E22, resistor from A22 to ground line
Blue Jumper cable from J7 to J24, Blue LED F24 & E24, resistor from A24 to ground line
Black jumper cable from ground line to A17
Our program checks gpio20 (up arrow) and gpio22 (down arrow) for input.

On our first test,
The gpio20 sound works, but the red light does not light up.
The gpio22 sound works, and the green light works properly.
The gpio24 sounds works, but the blue light is ALWAYS on.

On our second test, we moved one end of the red jumper cable from J5 to J6, and one end of the green jumper cable from J6 to J5. With this change, the RED light lights up properly, but the GREEN light does not light up. It seems that what is plugged into J5 does not work, and what is plugged into J6 does work as expected.

Similarly, we unplugged the blue jumper cable from J7 and put either the red or green jumper cable in there. Whatever cable was inserted into J7, the LED was on constantly.

Based on the instructions, it doesn’t seem this is working the way it is supposed to? I can't tell if we are doing something wrong or there is something wrong with the unit.

Any help would be greatly appreciated.

bfinio
Expert
Posts: 367
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff

Re: Can't get LEDs to work properly

Postby bfinio » Wed Jan 09, 2019 8:39 am

Hi dhjacobs6,

Sorry for the delay in replying. You've followed a good debugging procedure so far, and you're right that it isn't behaving as expected. A couple quick things to confirm:

- Make sure your Pi Wedge is inserted into the correct rows on the breadboard. Going by the diagrams in the project, the Pi Wedge labels G22, G23, and G24 should be in rows 5, 6, and 7 respectively. The GND pins should be in row 17. If the whole thing is offset by one row, that could cause weird behavior.
- Make sure your code corresponds to those 3 pins (gpio22, gpio23, gpio24).
- Are the Pi Wedge, ribbon cable, and RPi's GPIO header all firmly connected? Is there a chance any of the pins are bent? A loose connection or pins that got bent when attaching the cable could prevent certain pins from working properly.
- Is this your first project with the RPi? Did you do anything else with it before this? While it's unlikely, it's possible that a short circuit could have damaged some of the GPIO pins.

If you're still having trouble, we can take a look at your code and circuit to try and help debug. That will be easier if you email the pictures to us at scibuddy@sciencebuddies.org, because uploading pictures to the forum is kind of annoying. Take a picture of your code, and a few clear, well-lit pictures of your breadboard from a top-down view (so we can see which holes the pins are in).

Thanks,

Ben

bfinio
Expert
Posts: 367
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff

Re: Can't get LEDs to work properly

Postby bfinio » Wed Jan 09, 2019 8:46 am

edit - when I wrote the response above, I missed "Our program checks gpio20 (up arrow) and gpio22 (down arrow) for input." So I believe your problem is that your program is not using the correct GPIO pins corresponding to the pins you have wires plugged into, as described above.

Also, see the section on "Learn More: Which GPIO pins can I use?" in the project instructions. It explains which GPIO pins are compatible with this version of the Scratch software (gpio20 is not).

dhjacobs6
Posts: 2
Joined: Sat Jan 05, 2019 1:37 pm
Occupation: Parent

Re: Can't get LEDs to work properly

Postby dhjacobs6 » Tue Jan 22, 2019 6:15 pm

Hi Ben,

Thank you so much for replying. It took us a while to find some time to try this out again, but we gave it another go, and I can happily say that we got everything working this time! I didn't try to recreate our original problem, but attempting to use gpio20 was most likely the culprit.

Thanks again!

-Dan

bfinio
Expert
Posts: 367
Joined: Mon Aug 12, 2013 2:41 pm
Occupation: Science Buddies Staff

Re: Can't get LEDs to work properly

Postby bfinio » Tue Jan 22, 2019 6:35 pm

Glad to hear it, please let us know if we can be of any further assistance!


Return to “Raspberry Pi Projects Kit”