In my spare time I mentor a FTC team. This is the third year mentoring and each year I try to stretch the boundaries a bit as a way to inspire my team members, stretch the imagination, and show them that if they think it, they can likely do it.
This year, I decided it was time to break out the Hitechnic Protoboard that had been sitting around unused since we acquired it three years ago in a bulk buy of equipment from a defunct team. I had an addressable LED light strip laying around in the garage and decided that drivetrain running lights would be cool. This would require an Arduino to drive the strip via Adafruit’s Neopixel library.
FIRST’s rules however are quite strict with respect to microcontrollers on a robot. If used, they must derive all power from the Hitechnic protoboard and the board can only supply 8mA from the 5V pin. Hooking an Arduino up to a multimeter I quickly discovered it consumes almost 30mA at idle. There are ways to reduce power consumption, but I wasn’t going to get where I needed to be. So I took a blank ATmega328, burned an Arduino bootloader on it with a Leonardo and used it barebones on a motherboard.
Current consumption in this configuration is well below 8mA and would work for the project. The lights are on and we are drawing 1mA (note that the LED strip is drawing power external to the circuit supplying the mC, and the current requirement applies only to the mC). In the photo above, the large breadboard has both LM7805 and LM7803 circuits and is supplying 5V power to the light strip and 3V power to the smaller breadboard with the ATmega328 on it. Running the mC at the lower voltage is what allows us to get the current consumption way down and the protoboard has a 3V pin so we are good.
The FIRST rules state that LED lights themselves may draw power from the main robot battery pack , but since this is a 5V strip, a 5V regulator is required. On average the strip draws about 600mA which caused the LM7805 to get hot enough to smell within a short period of time. A bunch of math and reading of datasheets indicated that a heatsink with a thermal resistance to air of no more than 13.75 C/W would be enough to keep the LM7805 cool enough to satisfy the robot hardware inspectors.
From there it was simply a matter of setting up input pins, using the an NXT brick to drive a set of Hitechnic protoboard output pins into the ATmega328 (running Arduino software), reading the input pins and displaying the appropriate pattern on the LED strip. We use one of the interrupt pins to tell the arduino when it should go reread the pin state. The photo below shows what’s happening on the output pins of the protoboard by using a Salaea logic analyzer to show pin state as they change.
The project taught the team members about voltage, current, heat transfer, microcontrollers, binary number systems, and a smattering of Arduino sketch programming. The electronics are all mounted on the robot, the light strip goes on this weekend.
Software here: https://github.com/cmacfarl/Arduino