Mini FET Shield Hookup Guide
This Tutorial is Retired!
This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.
Project Time
Now that we have all this hardware hooked up to the Mini FET Shield, what can we do with it? Well, for one, we can make a mobile light show!
Tools
To make a truly epic laser show, you'll need a hot glue gun and a few stick of hot glue. Also, if you don't already have some, you'll need a hex key to assemble the Actobotics parts and a slightly smaller hex key for the set screws.
Hardware
Along with all the parts we used in the Assembly section, you'll also need a LiPo battery, and some mounting hardware to hold everything in place. You can just use some angle brackets and some hot glue, or, if you want to get serious about your laser show, we've picked out some Actobotics parts to help you mount the motor and laser.
Going over building the mount is beyond the scope of this tutorial, but here's a picture for guidance.
Firmware
Every project needs at least a little bit of code to get it going. Here is a simple sketch that turns the laser on with the switch and spins the motor when the button is pressed. Upload the code onto the Pro Mini using a 3.3V FTDI Basic.
language:c
int motor = 2;//write HIGH to turn on
int laser = 3;//write HIGH to turn on
int swtch = 10;
int button = 11;
void setup() {
pinMode(motor,OUTPUT);
pinMode(laser,OUTPUT);
pinMode(swtch, INPUT_PULLUP);//internal pullup
pinMode(button, INPUT_PULLUP);//internal pullup
digitalWrite(motor, LOW);
digitalWrite(laser, LOW);
}
void loop() {
if(digitalRead(button) == LOW)//spin motor when button is pressed
digitalWrite(motor, HIGH);
else
digitalWrite(motor, LOW);
if(digitalRead(swtch) == LOW)//turn laser on with switch
digitalWrite(laser, HIGH);
else
digitalWrite(laser, LOW);
}
There is one downside to driving a motor with the Mini FET Shield. Unlike a traditional H-bridge, such as the IC found on our Ardumoto Shield, the FET can only turn the motor in one direction. If you need your motor to move in both directions, you may need to find a different solution.
With that, you should have a working project that utilizes the features of the Mini FET Shield.