This Clever Arduino Shield Lets You Know Which Pins Are Currently High
Fran Blanche designed an Arduino shield that lets you know which pins are currently set to high.
Debugging code in general is always a headache, but that’s especially true when you’re programming microcontrollers, because you have to figure out if you have some syntax issue or if your hardware is simply connected improperly. If you’re like me, you fill your prototype code with serial messages so you can confirm that each part of your code actually executed as expected. But it would be incredibly useful to know what your hardware is really doing at any given time. That’s why Fran Blanche designed this clever Arduino shield that lets you which pins are currently set to high.
While microcontroller development boards like Arduinos certainly have other functions, it is most common to interface with hardware components by setting the digital pins to either high (on) or low (off). But you can’t actually see what a pin’s current state is. That’s where this shield comes in. Like all Arduino shields, it sits on top of the development board — an Arduino Uno in this case. This shield has additional pin headers on top of it, so you can stack on other shields. Each pin’s state is passed through Blanche’s shield to the other shields or components that you have connected. But the shield contains an array of LEDs that light up when the corresponding pin is set to high, so you get a visual indication of each pin’s state.
You can easily make this shield yourself using a perfboard and a handful of common components. One of the frustrating quirks of the Arduino Uno is that the two rows of pin headers on each side of the board have a gap between them, so they don’t fit the standard perfboard and breadboard spacing. So you’ll need to mangle the perfboard to fit. Each LED is connected to its I/O pin through a transistor, so power is coming from the 5V source instead of from the pins themselves. That is important for avoiding the LEDs acting as current sinks. And that’s it! As long as the circuits are wired correctly, a pin being set to high will trigger the corresponding transistor to turn on its LED. This lets you see exactly which pins are set to high at any given time, which should make it a lot easier to debug your projects.