“The main board consists of a [number of components, including an] ATMega328, nRF24L01+, a protection diode and stabilizing capacitor,” Benschop explained.
“The ATMega328 is running at 5V while the nRF24L01 requires 3.3V. However, I needed the IO pins to run at 5V and although the nRF24L01 requires a lower supply voltage, all interface pins can handle 5V.”
As the Hack A Day crew notes, the enclosure for the LegoDuino is compatible with other LEGO bricks, simply because it is made from a 6×16 plate (three blocks high), with sufficient space for the electronics, three AA batteries and IO headers.
“I downloaded [Minibloq] and found that I could add my own blocks relatively easily. For the LegoDuino target in Minibloq, I copied the ArduinoUno target. I modified minibloq.h to use my defined port names as well as the minibloq target board definition (main.board),” wrote Benschop.
“I also added some of my own programming blocks and the Arduino NewPing sensor (instead of the existing Ping sensor). [Plus], I copied the DCMotor programming block and modified it into a LegoMotor programming block. And I added some special power button [along with] LED support so the power button can be used to turn the LegoDuino on and off, but also to power off the LegoDuino after a fixed time. This way, the batteries will not be drained when my son forgets to turn it off.”
Interested in learning more? Additional information about Benschop’s custom electronic LEGO microcontroller system can be found here.