The Arduino Mega power and prototyping shield provides:
- An independent, buffered, LED on every I/O pin
- A 30V 500mA output on every I/O pin
- Two buttons
This page covers the Rev 1.0.0 Mega LED & Power Proto Shield. I plan on making 10 total, and have only completed 4 so far. My goal is to made a new revision that addresses some of the problems with the Rev 1.0.0. If you really want to buy one of the Rev 1.0.0 units, I have a couple available (though the pins may have been bent and re-straightened). Email the address at the bottom of the page if you are interested.
Here is the quick start guide for using them.
Known issues
Before using this, keep in mind that:
- Yea, this page is long and annoying to read. But damage is likely to occur if you don't know what you are doing.
- Once installed on an Arduino Mega or Due, this thing is very difficult to remove without bending a few pins (see below).
- When installed on an Arduino Due it appears to goof with the USB ports, so you can't program or communicate with the Arduino when this is installed on a Due.
- For the first 4 made, activating every LED will roughly max out the Arduino's 5V power supply, leaving nothing for other stuff. Whatever is hooked up via the current-sinking pins will, of course, be unaffected. If I assemble any more Rev 1 boards, I will change the current limiting resistor to mitigate this problem.
Quick Start
- Set the jumper JP1 to set the back EMF protection. If you don't know what you are doing, just jumper the center to the right pin. Or leave it disconnected.
- Plug the unit into your Arduino Mega.
- If desired, place a breadboard in the center area, as shown in the examples.
- If you are using an external power supply, wire ground to the middle screw terminal and +V to the right.
- If you are powering the Arduino via an external power supply, the left screw terminal is connected to Vin, and the center terminal is the common ground. You can also leave it disconnected and power the Arduino over USB.
- Use the inner ring of pins as normal Arduino I/O pins (dashed blue boxes below).
- Use the outer ring of pins to control higher voltages:
- Wire the +V side to your power supply
- Wire the GND side to the desired current sinking pin in the outer circle of pins (solid red boxes below)
- When the Arduino's corresponding pin is LOW the GND will effectively be unplugged. When it is HIGH the GND will be connected and current will flow.
- PWM will work as expected. A true analog output will be amplified, but will saturate well below the Mega's 5v.
- Remember that:
- When using a pin as an input, wire the input signal to the inner pin. The Arduino will not detect inputs wired to the outer pins.
- The LEDs will light up and the associated current-sinking pin will turn on and off with the input value. This is normal.
- The Darlington transistors may draw up to 1.25mA of current from the Arduino I/O pins. This may be a problem if you have a load pushing the 40mA output current of the pin, or if you have a low current input signal.
Caution
As with most Ardunio shields, misuse of the Mega Power & Proto shield may result in damage to your Arduino. Here is a list of the most common issues that you may encounter.
- Wiring one side of a device into high voltage and the other into an Arduino input, instead of into the powered port.
- When using an external power supply make sure that the ground is securely connected to the center screw terminal. If it is not the Arduino will serve as a ground and damage may result.
- Connecting the suppression diode control jumper to Vcc when you are powering an inductive load with a high voltage. This may result in a surge passing through the suppression diode into Vcc, damaging your system.
Removal
Removing the thing is difficult due to the number of pins connecting the shield to the Arduino Mega. If you simply pull them apart there is a good chance of bending a few of the pins. You can straighten them again with small pliers, but they aren't as nice afterword. When pulling it apart, slowly and carefully work it off. I have had some luck partly unplugging it and then using a nylon pry tool to get it the rest of the way off. But I need to find a better solution.
The Buttons
There are two buttons included, one wired to pin 52 and the other to pin 22; the other side of each button is wired to ground. They are normally open, so you can use the pin for something else and simply not press the button. This also means they don't have pull up/down resistors. When using them you should enable the pull up resistors using INPUT_PULLUP:
pinMode(22, INPUT_PULLUP);
The buttons are not debounced. If necessary, you could use a software debouncing approach. For many Arduino projects the bounce is not a problem.
A reset button is also included since the on-board reset is covered up. Resetting your system by pounding on it with a hammer is not recommended.
More Details
Each Arduino I/O pin is connected to a Darlington transistor inside a ULN2803A transistor array, as shown in the schematic. When an Arduino I/O pin is high the Darlington transistor connects U3 to ground, allowing current to flow both through the on-board LED and through any attached load. When the I/O is low the Darlington transistor appears as a high impedance and current does not flow. As this may result in a high voltage at U3 there is a protection diode in series with the LED, preventing the high voltage from feeding back into Vcc.
Figure 1: This wiring scheme is used on all I/O pins.
Each array of Darlington transistors should be limited to 2.4 amps total, as imposed by the trace connecting each ULN2803A to ground. The entire system should be limited to 18 amps, which is the current limit on the screw terminal.
Advanced users should review the TI ULN2803A datasheet for details on the Darlington transistor arrays used in this design.
The screw terminal allows easy connection for the higher voltage you plan on controlling, as well as external power for the Arduino. While it could be any voltage up to 30V, I call it +12V for convenience. The ULN2803As will handle up to 50V, but I don't recommend working with voltages that high on this board. Strictly speaking, it is not necessary to wires up the +12V; you only need the shared ground. Wiring up +12V allows for connecting the back EMF suppression diodes and also provides a convenient place to wire up your high power device.
Example
In the sample configuration a potentiometer was wired up to one of the Arduino analog inputs and used to control the speed of two fans.
- 12V power was wired into the green screw terminals (ground into the middle)
- Fan power was connected to 12V power via the power bus on the breadboard.
- Fan ground was connected to the outer ports, allowing control via the Darlington transistors.
- The potentiometer wiper was wired to an analog input, via the inner ring of pins.
- The LEDs change brightness with the duty cycle of the PWM signal.
- The LEDs for pins 1 & 2 are light up. LEDs may light up on unused pins, depending on their default state.
Unknown issues
This board has not yet been fully tested, nor has it been used enough for possible bugs to come out. Some issues that will need investigated:
- When does the current draw from the Darlington transistors cause problems? Does it prevent some or all SPI and I2C communication? It appears to cause problems with the Arduino Due's USB communication.
- Is heat dissipation a problem when a large number of high power outputs are running?
Possible improvements
As noted above, I do not plan on making more than 10 of the Revision 1.0.0 Mega LED & Power Proto shields. However, depending on demand, I may make an updated version. Here are some of the improvements and bug fixes under consideration:
- Properly label the screw terminals and JP1; indicate wiring and functionality.
- Move JP1 and make it accessible from the top side
- Add some pins connected to +12V, making it easy to wire up your +12V devices.
- Size it to fit in a standard enclosure
- Fix the position of the mounting hole by the reset button
- Replace the individual resistors with resistor packs
- Find a way to make it work properly on the Arduino Due
- Add jumpers to disconnect key pins, like Tx and Rx
- Figure out that the deal is on A12 to A15; they aren't working in my test program.
Another idea is making a version for the Arduino Uno. It may also be possible to make a combo Uno shield and a Mega expansion shield, letting the two work as a pair on a Mega. This would make it easier to use just half of it on an Uno. And you could remove half at a time from the Mega, which would make pulling the thing off a lot easier.
© David C. Hunter, 2019
fb [at} dragonsdawn {dot} org