We're going to power and control the neon LED strips with a Metro M0 Express microcontroller. The Metro M0, like all microcontrollers, is designed to power low voltage devices with a small current draw -- such as individual LEDs -- from it's digital output pins. We can't run high current devices such as solenoids, motors, and neon LED strips from the Metro M0's pins directly. So how can we do it?
No fear! The answer in this case is the Darlington driver!
The Darlington driver is a DIP chip with eight addressable Darlinton transistor pairs inside. By sending a small 3.3V control signal to one of the Darlington's input pins, it can switch on and off a high-voltage, high-current flow to it's paired output pin.
In fact, we use a Darlington driver on our Crickit boards to power the solenoids and electromagets and the like that you can plug into the Crickit's Driver ports!
Here's the breadboard diagram of our circuit. In it you can see, for example, the yellow wire running from the Metro M0's digital output pin 12 to the Darlington's pin 1 (input 01). When this pin 12 is sent high, the teal neon LED strip that has its ground plugged into the Darlington's pin 18 (output 01) will suddenly flow with 12V current and turn on!
Rather than building it on a breadboard, we'll solder the chip and circuit wiring to a Proto ScrewShield as shown here.
If you haven't done so already, solder together the Proto ScrewShield following these instructions.
Solder the Darlington Driver to the ScrewShield
Next, we need to provide power and ground from the Metro M0's VIN and GND to the Darlington's legs 10 and 9 respectively.
We'll trigger each of the transistor pairs in the driver by sending digital pins high on the Metro M0 using the following connections: (you can add more if you want to control more neon strips separately for animations)
- D12 to Input 1
- D11 to Input 2
- D10 to Input 3
Solder the wires to the digital pins' holes as usual and then bend their other ends onto the Darlington's pins before soldering.
Now, you'll solder jumper wires from the Darlington's output pins to the ScrewShield's W, X, and Y terminals. It is here that we'll connect the neon LED strips later through a cable.
- Darlington Output 01 (leg 18) to Y
Darlington Output 02 (leg 17) to X
- Darlington Output 03 (leg 16) to W
The three outputs we just connected are for the ground wires of three neon LED strips. Now, we need a convenient way to share the common 12V line. We can do this by soldering a jumper from the VIN connection we made already at Darlington leg 10 over to the ScrewShield Z terminal.
Now we get the very satisfying task of inserting the ScrewShield into the Metro M0! Just like that, all of the Metro M0's pins are connected to all of those screw terminals and to our pre-wired Darlington circuit!
We'll use two buttons to control the sign -- an on/off latching button and a momentary button to control the animation of two of our neon LED tubes.
These buttons are special -- they each have an LED built into them. So, we'll wire them so that we have a nice little cable bundle per button for ground, digital input to the Metro M0 to read the button state, and digital output from a Metro M0 pin to light the LED.
We'll even solder in a 220 Ohm resistor inline with each button's LED power pin so the wires can be plugged directly into Metro M0 pins via ScrewShield terminals!
Wire the Red On/Off Button
Repeat this procedure for the yellow momentary button, this time with these color connections (to make it easier to follow the schematic above):
- Jumper between LED GND and Switch contact to ground
- Black to GND contact
- White to 220 Ohm resistor to LED Power contact
- Orange to Switch contact to digital pin
Now you can insert the button wires into the ScrewShield screw terminals. Follow the diagram above and this drawing. Note that you can twist the two black wires together and have them share a single GND terminal.
We want a good way to connect the neon LED strips to the Metro M0 that is solid, secure, and polarized to avoid plugging things in the wrong way. Enter the 4-wire polarized cable set! Screw the wires of the female receptacle half into the W, X, Y, and Z terminals as shown in the schematic and the photo below.
The board circuit and wiring is complete, time to program it with MakeCode!