Electronic – arduino – How to use the LEDs on Sainsmart protoshield


I have an Arduino Uno with a top-plugged SainSmart proto shield. There are 2 LEDs on the proto shield, but I don't know how to make use of these LEDs in a sketch. Are they directly controllable out-of-the-box, or do I first need to solder the LED leads to analog/digital (not sure which) outputs on the proto shield to make them accessible? And how to use the "S1" button?

Best Answer

enter image description here

So this is just a bare board with a few LEDs and buttons. jippie points out that series resistors are indeed included, as can be seen in the picture he linked to. (Thanks jippie.) The buttons don't have pull-up resistors so they seem to rely on the AVR's internal pull-ups for that.

A schematic of the board would help. I would find it hard to believe there wasn't one included, or at least a link to the schematic on their site. On the top side LEDs and buttons don't seem to be connected to anything, so we need to have a close look at the bottom side. Can you post a sharp picture of that?

It's unlikely that LEDs or buttons would be hard-wired to any of the I/Os, but the bottom row of the breadboarding area is possible. I marked two intriguing holes next to LED2. They're not vias, but more like the holes on the breadboarding area. They seem to suggest connections for the LED, but then where are the connections for the buttons? So I'd go back to the breadboarding area. Check if you see traces connecting to the holes on the bottom row.

Once the connections are cleared up you'll have to wire up the LEDs from +5 V to a digital output of the controller. Making that output on the Arduino low will light the LED.

The button goes between a digital input and ground. You can use the microcontroller's internal pull-up resistors, or use an external one. This goes form the input to +5 V. If the button isn't pressed the resistor pulls the input to +5 V, so you'll read a 1. When you press the button you connect that input to ground, so that will read as a 0. You can use a 10 kΩ for the pull-up.

Button tutorial
very basic circuits