Building the Electronics 

Electronics

Building the Electronics You will learn about Building the Electronics systems that will operate your robot in this article. About Building the Electronics The identical modules—a motor controller kit and an already assembled Arduino board, such as the Arduino Uno or Leonardo—are used by both the two-wheeled and four-wheeled platforms. The AFMotor shield from Adafruit Industries is the motor controller that is discussed in this book. The AFMotor shield offers straightforward connections for the power and signals to all the sensors and devices mentioned in this book, even if alternative motor controllers may be used (see Appendix B). Additionally, it can power four motors, which is necessary for the chassis with four wheel drive.

Building the Electronics

Requires Hardware Component

• List of tools
• Shield kit for AFMotor
• Three female headers (6 way 0.1″).
• Three reflectance sensors QTR-1A
• Three three-way 0.1″ headers on a stripboard for mounting line sensors
• Ribbon cable, sliced as follows with a sharp knife, whether it is 11 ways or wider:
—A single 10-inch ribbon cable with five conductors for line sensors
—Two 10-inch ribbon cables with three conductors each for edge sensors
• Three-way 0.1″ female header for an optional charging circuit is optional.
• Three-way, 0.1-inch female header for optional wireless connection is optional.

Construction Methods

Soldering

First before Building the Electronics you need to learn some skills.
With little practice and an understanding of the fundamentals, soldering is a simple task. Using the proper solder and applying the appropriate amount of heat to the components that need to be soldered are the keys to creating a successful solder junction. Soldering printed circuit boards is an excellent use for 22 AWG solder (0.6mm or.025 inch) or thinner. The perfect iron is one that has temperature control and ranges from 25 to 40 watts.
Wires should be crimped around terminals to ensure that the components to be linked are mechanically secure and do not move while the solder cools. The iron’s tip has to establish good contact with each component that needs to be soldered in order to form the junction. Put a tiny bit of solder where the iron touches the components that need to be connected. Remove the solder first, then the iron, once the solder has flowed around the joint. The joint should be glossy and the connection should be mechanically tight.

Constructing the Motor Controller

This robot’s brain is the motor controller shield. Through this board, all of the sensors are connected to Arduino and may control the motors. The shield comes as a kit and works with both 2WD and 4WD robots; the attachment to the chassis and motor connection processes are the main variations.
Figure 2-1 displays the shield’s component parts to Building the Electronics.
Building the Electronics in Arduino projects
Figure 2-1: Components needed to assemble the Motor Shield
The shield is packaged with the components below and to the right of the board, however it is not included with the three 6-pin headers on the left. The sensors are connected using these headers.
The Maker Shed companion kits that accompany this book come with these headers. Female headers are also available from Adafruit and other vendors.
First, solder the smallest parts together (Figure 2-2). You may put the two resistors and the three tiny capacitors in either direction because they are not polarized.
Figure 2-2. shows Solder the Small Components
As seen in Figure 2-3, the resistor network, which is the long, thin component with ten pins, is polarized; the end with the white dot points to the left of the PCB, closest to C1.
Solder the resistor network in Figure 2-3. The circular marker denotes the proper orientation.
The LED, ICs, and big capacitors are all polarized. Make sure you have positioned the correct value component in the correct orientation because the color of the components in the step-by-step assembly pictures on the Adafruit site (link at the beginning of these build notes) might not match the components or layout for the parts you received (especially the capacitors).
The shield PCB layout for version 1.2 is seen in Figure 2-4 Building the Electronics .
Two IC sockets for the L293D chips are included in the package. These are optional, as stated in the Adafruit site assembly instructions, but if you want to be safe and utilize the sockets, connect them such that the contour printed on the PCB and the indent marking pin 1 match.
Solder the remaining polarized components, as shown in Figure 2-4.
All of the conventional shield components, including the screw terminals, headers, and push button, are soldered on the board seen in Figure 2-5. Soldering the three 6-pin female headers in close proximity to the analogue input pins completes the construction process. These headers come with the Maker Shed kits, however they are not listed in the Adafruit step-by-step assembly instructions nor included in the shield package.
Figure 2-5 shows all soldered components aside from the sensor headers.
All parts, including the soldered sensor headers, are shown in Figure 2-6. When the shield is inserted onto the board, trim the component pins on the underside so they are clear of the Arduino (except from the header pins that link the shield to the Arduino). To link the motor power input and the Arduino VIN (power input), find one of the jumpers included with the shield and plug it into the pins labelled “power jumper.” This allows both devices to be powered by the batteries that you will be wiring after the robot chassis is constructed.
Figure 2-6: Sensor header shield
The locations of all the sensors and additional external devices are depicted in Figure 2-7. For some of the applications, the three-pin female headers are not required, but soldering them to the shield now will be useful.
Figure 2-8 displays two different connection techniques. The wiring plan based on a stripboard, as detailed in “Making a Line Sensor Mount” (page 17), is located on the left. You may experiment with different mounting techniques, such as the stripboard-based one, as you’ll see in subsequent chapters. The wiring for sensors that are connected independently is seen on the right side of Figure 2-8.
You’ll employ one of the two wiring designs as you go through the subsequent chapters and try out other mounting methods. You may mix and match the connection schemes you want since you will be connecting the sensors using ribbon connections and sockets rather than being restricted to one specific setup.
Figure 2-7: Connectivity for devices discussed in the upcoming chapters
Figure 2-8. Individual jumpers are illustrated on the right, while connection detail stripboard wiring is displayed on the left.

Connecting the Reflectance Sensors via Solder

A tiny PCB and a 3-pin header are included with every sensor kit. As seen in Figure 2-9, insert the header such that the shorter length pins show on the side of the board where the components have previously been connected. Solder the three pins after making sure the header is oriented correctly.
QTR1A Reflectance Sensors, Figure 2-9

Assembling a Line Sensor Mount

This book’s line sensing experiment makes use of three reflectance sensors that are connected to analogue inputs. It is more practical to utilize a tiny piece of stripboard to link the power lines together, even if it is feasible to wire the three connections (+5V, Gnd, and Signal) using nine jumpers. You can quickly disconnect the sensor and change settings by soldering header connectors to the stripboard. This allows you to switch between line and edge detection.
The arrangement of the stripboard is seen in Figure 2-10; take notice of the five holes that require hand drilling. The wires connected straight to the stripboard pads are seen in Figure 2-12.
In an article of Building the Electronics the stripboard that isn’t being used, you can drill a few more holes to provide some strain relief. Subsequently, separate the wire into two sets (one set for the positive and negative pins, and another set for the analogue pins). Then, pass the wires through the board’s big holes before soldering them. In this manner, the wires will draw against the holes before your solder junctions if you pull on them.
Figure 2-10. Installing QTR1A reflectance sensors on a stripboard arrangement for line following
Either cut the tracks as indicated in Figure 2-10 (cutting along the third column from the left, or the “C” column) or put insulated washers between the bolt heads and the tracks to make sure the mounting bolts don’t short the tracks. The header socket connections are shown in Figure 2-11, and the finished stripboard with the ribbon cable connected is shown in Figure 2-12.
A cable of 10 inches is more than sufficient. The ribbon’s opposite end is seen attached to shield pins in Figure 2-13.
Stripboard with three 3-pin header sockets, as shown in Figure 2-11.
Figure 2-12: Soldered wires on a stripboard
Ribbon cable connects to shield pins, Figure 2-13

Building the Four-Wheeled Mobile Platform, for information on mounting the stripboard depending on the robot chassis. The three holes that are shown will work with any chassis, although you might want to wait to drill the holes until after the chassis is constructed.

One thought on “Building the Electronics 

Leave a Reply

Your email address will not be published. Required fields are marked *