Compact 3-in-1 Stripboard DIYduino with Integrated Sensor and L298N Motor Shield
I am presenting a total of five different versions:
2. DIYduino with integrated sensor and 1-channel motorshield – no speed control
3. DIYduino with integrated sensor and 1-channel motorshield – with speed control
4. DIYduino with integrated sensor and 2-channel motorshield – no speed control
5. DIYduino with integrated sensor and 2-channel motorshield – with speed control
My pictures represent the third version, which is the one I chose for a particular robot application that I am currently building.
Step 1: Parts List
I did not consider the prices marked with the single asterisk for the total price of the device. Further note that item prices at Newark drop when you order a certain number of parts, typically if you order more than 10x. I listed the highest individual prices here and also ignored any special offers or promotions. If you buy more the price will go down. On another note, not all of the parts listed here are really necessary for operation. The parts that you can omit are marked with a double asterisk. The ‘bare bones price’ is also indicated at the bottom of the table.
Last not least, the ATMEGA 328 that I used required a bootloader. I recently created an instructable called ArduinoISP Bootloader/Programmer Combination Shield that addressed how to upload a bootloader to a “virgin” ATMEGA. You can also buy ATMEGAs that have a bootloader installed. They are almost double the price. For completion I listed one in the table.
Step 2: Tools and Hardware
1) Solder iron & solder – to solder everything together
2) Carpet knife – to separate copper traces between holes
3) Hand saw with skinny blade – to cut strip board to size
4) File, not too coarse – to deburr strip board after cutting it
5) Wire cutters – to shorten legs of soldered electronic component
6) Fine tipped pliers – to bend component legs
7) Red, black, blue sharpie markers and pencil – to transfer layout to stripboard
8) Third Hand (invented by rstraugh …thanks) – to hold parts and board when needed
9) Track Cutter (invented by scraptopower …much obliged) – to separate copper traces at holes
10) Voltmeter with test leads – to confirm functionality of separation cuts and debugging
11) Scanned in strip board pattern – to develop stripboard schematic
12) ArduinoISP Bootloader/Programmer Combination Shield (not shown) & Arduino with USB to serial chip (e.g. Arduino Uno) – to upload the bootloader and sketches to DIYduino. You can also use a USBtoSerial programmer for uploading a sketch and work around the Bootloader Shield and use the DIYduino you build here to load the bootloader.
13) Cables to plug onto male/female connectors (not shown) – to make connections for testing
14) Variable power supply with voltage range of roughly 3V to 12V – to test voltage regulator and provide power to stripboard (not shown)
15) Computer with Arduino software – to test functionality of DIYduino & motor driver (not shown)
16) Drill and drill bits (not shown) – to widen/drill holes for stand offs and drill hole in heat sink
Step 3: Combining Schematics of DIYduino & Motor Driver
In the schematic shown here I marked my changes in red color:
1. I crossed out the items that weren’t part of my built.
2. I changed the values of the capacitors that smooth potential voltage peaks at the 5V regulator. These are the values that I had available in my stock and they’ll do the job.
3. I crossed out the LED/resistor connected to Pin13 to safe parts. I only connected an LED/resistor temporarily to test the functionality of the DIYduino as described later.
4. I removed the +5V from the Aref as recommended in a comment with respect to this tutorial: http://arduino.cc/forum/index.php/topic,7569.0.html
Then I combined the minimalist Arduino schematic with a schematic of a L298N motordriver that I found on solarbotics’s site. I did this by connecting L1, L2, L3, and L4 (L298N pins 5, 7, 10, & 12) to the ATMEGA’s digital pins 7, 8, 13, & 12, respectively. Pins E1-2 and E3-4 (L298N pins 6 & 11) are connected to +5V for maximum motor speed at all times or to Arduino PWM pins 9 & 6 for adjustable motor speed, respectively. I am also showing the ATMEGA 168/328 pin map, which help me to assign the proper ATMEGA pins and which can be found at http://arduino.cc/en/Hacking/PinMapping168.
Step 4: The Stripboard Layouts
A few specifics with respect to these layouts:
1. Red crosses are track interruptions placed at a hole location
2. Red lines are track interruptions placed between hole locations.
3. Blue lines are connections made on the copper side of the board.
4. Dashed lines are outlines of components such as ICs or connectors.
5. The sensor shield type connector rows are GND/+5V/Signal (GVS) on the left and Signal/+5V/GND (SVG) on the right side with respect to the ATMEGA. This means the signal row is always closes to the ATMEGA and the GND row farthest.
6. There is a pin to connect to the reset of the ATMEGA. This pin, together with adjacent pins Rx and Tx (pins 0 & 1), allows for programming the ATMEGA.