Those of you that know me, or follow me on Twitter, may have heard me talking about building electronic something recently. I’ve been wanting to do something for a while, just didn’t know what. Then recently, something rare happened. I had an idea.
For most people, when this happens, they turn to the ever-faithful Arduino as the controller (brains).
I instead turned to the less well-known Netduino. This board has an almost identical footprint, and more importantly, the same pin-out as the Arduino Uno (an improved & easier to pronounce version of the much-loved Arduino Duemilanove), with one key difference. It runs the .NET Micro Framework.
My idea calls for 4 Bi-directional DC motors. Fortunately for me, there is a shield out there which can control 4 Bi-directional DC motors – The Arduino Motor Shield from Adafruit Industries.
Unfortunately, I hit a minor limitation of the Netduino.
The Arduino has 6 hardware (8 bit) PWM outputs, which are perfect for motor speed control. These are on Digital I/O pins 3, 5, 6, 9, 10 & 11.
The Netduino on the other hand only has 4 hardware (but 16 bit) PWM outputs. These are on Digital I/O pins 5, 6, 9 & 10. As you will notice, they match the inner 4 of the Arduino. This does make it compatible with many Arduino Shields. Not here though.
The Adafruit Motor Driver shield uses the PWMs on pins 3, 5, 6 & 11 to control the 4 motors. The other two, on pins 9 & 10 are used to control 2 Servos.
What I needed was a way to connect pins 5, 6, 9 & 10 from the Netduino, to pins 3, 5, 6 & 11 on the Motor Shield. Fortunately for me, pins 9 and 10 on the Motor Shield are connected directly to the Servo headers, through no additional components, which makes my hack (solution) possible.
My solution (currently untested by the way) is:
- Remove (cut off) Digital I/O pins 3 & 11 on the underside of the Motor Shield. This will mean pins 3 & 11 of the Netduino become permanently disconnected above the shield.
- Jumper pin 9 to pin 11, and pin 10 to pin 3 (or vice versa). I have just inserted wire into the pin headers on the top side of the Motor Shield. (I had intentionally not soldered on the Servo headers, as I had no intention of using them.)
- If you wish to connect any shield above the motor board, you may need to remove pins 3, 9 10 & 11 from the underside, as there will be jumper wire in the headers.
Alternatively, you could solder jumpers between Digital pins 9 & 11, and 10 & 3 on the underside of the Motor Shield or the through hole points available in front of the pin headers. This will mean the pin headers on the top side are not obstructed, and additional shields can be connected without modification. Be aware though that with the pairs of pins joined together, this could cause problems with any shields above that you use, even if you using a part of the shield which does not directly use those pins. All I can say is – be careful! If in doubt, don’t do it.
These modifications mean all 6 ‘Arduino’ PWM pins are ‘used’, and not available for any other shield. All 4 from the Netduino, pins 5, 6, 9 & 10, connect to the 4 DC Motor pins on the Motor Shield, on pins 3, 5, 6 & 11. Pins 9 & 10 on the Motor shield are in use to jumper to the required pins 3 & 11. The Adafruit Motor Shield also uses Digital I/O pins 4, 7, 8, & 12 for control.
That leaves Digital pins 0, 1, 2, 13, 14 & 15 available to shield above the motor board. All 6 Analog Inputs (including I2C on Analog pins 4 & 5) are connected and free for use by other shields.
As I mentioned earlier, this is completely UNTESTED.
I have planned it through fully, but that is still not a guarantee it will work. I am not responsible for any damage that may occur to anything should you attempt this modification.
I will report back here when it has been tested, and post my results.