3. Electrical Assembly

This section should take up to 4 hours to complete.

Electrical assembly of the printed circuit board (PCB) is divided into 4 building-blocks:

  1. Power Supply [60 minutes]
  2. Audio Amplifier [120 minutes]
  3. Microcontroller, Digital Line Converter, and H-Bridge [30 minutes]
  4. Light Emitting Diodes [30 minutes]

You’ll need your soldering iron,  DanceRobot Kit, electrical schematic, and a multimeter for this part of the tutorial.

1. Power Supply

This building-block should take up to 60 minutes to complete.

Our robot is powered by four AA batteries. Each AA battery provides about 1.5 Volts (V). There are four batteries in series (connected one end after another), so that gives a total of 6.0 V (4 x 1.5 V).

IMG_20130911_151638_1

That’s too much voltage for our little robot — it only needs 5.0 V. The battery voltage needs to be reduced and/or regulated, and that is one of the purposes of a Power Supply. A low-dropout regulator (LDO) is typically used to accomplish this.

IMG_20130911_151638_2

Build It!

Take a look at the Power Supply section of our electrical schematic. You’ll see that the Power Supply is made up of 5 components: 1x resistor (R1), 2x capacitors (C1 and C2), 1x integrated circuit (U1), and 1x LED (PWR). These components are for the LDO to be able to convert the battery voltage to the 5V that the robot needs, and, on the right below, to indicate with a light-emitting-diode (LED) that the 5V are available, i.e. the robot has power.

schematic_power_supply

Find these parts in your kit and solder them to the PCB.

POLARIZED COMPONENTS! C1 and the PWR are polarized. Look closely at these two parts and you’ll see that one leg is longer than the other. This is an indication of its polarity — the longer leg represents positive (+) and the shorter leg represents negative (-). The PCB has a marking, either + or -, indicating in what orientation these parts should be inserted.

component_power_supply

When assembling the electronics, slide each part into the PCB as far as possible. To keep the components from falling out while soldering, you can bend the legs of the components. After soldering, cut off the legs using your side cutters. BE CAREFUL! When cutting, point the PCB down so that the legs which you cut off don’t accidentally fly into your eye!

Short-Circuit Test

After assembling (or soldering) all 5 parts, we’ll want to perform a quick short-circuit test before applying power to the circuit. Take your multimeter, switch it to continuity mode, then attach one probe to the positive (+) hole of the battery connector and attach the other probe to the negative hole (-). If there’s continuity between the holes (usually indicated by a zero on the multimeter display and/or a tone), then you’ve short-circuited the supply lines — you’ve accidentally connected the positive line of the battery to the negative line. In this case, you will need to find the error and fix it. Otherwise, you’ve passed the short-circuit test and you can move on!

Test

The power supply is one of the most important building block of any electronic device. Without it, electronic devices, including our DanceBot wouldn’t operate. To test that it works,

  1. Solder the wires of the battery pack (without batteries) to the holes of the battery connector.
  2. Insert four AA batteries into the battery pack and turn on the switch.

detailBatteryLeadsIn

If everything is functioning correctly, the LED should light up!

Switch off the battery pack and proceed to the next building-block when ready.

2. Audio Amplifier

This building-block should take up to 120 minutes to complete.

The amount of audio power (or loudness) generated by your MP3-player isn’t very much. It is enough to power a pair of headphones that you put up next to your ear, but isn’t nearly enough to power a loudspeaker to be played in a room. In order to do this, we’ll need an audio amplifier, which — literally — amplifies the sound of your music.

IMG_20130911_151658

Build It!

Take a look at the Audio Amplifier section of our electrical schematic. You’ll see that the Audio Amplifier is made up of 7 components: 2x resistors (R2 and R3), 4x capacitors (C5, C6, C7, C9), 1x integrated circuit (U4), and 1x connector (JP18).

schematic_audio_amplifier

Find these parts in your kit and solder them to the PCB.

WARNING! Before soldering, always switch off your battery pack.

POLARIZED COMPONENTS! C7 is polarized. Again, the long leg is positive (+) and short leg is negative (-).

component_audio_amplifier

Solder one of the 2-wire cables from your kit to the speaker.

Solder the audio jack cable to the PCB. The red wire should be connected to the right-channel (R), the white wire to the left-channel (L), and black wire to ground (G). You can also use the multimeter in continuity mode to check which wire corresponds to what signal, since not all cables use the same color coding. The connectors are standardized, and you can use the image below for reference, i.e. the tip is left, the ring is right, and the sleeve is ground.

Test

Take the following steps to test your Audio Amplifier:

  1. Connect the speaker to the PCB
  2. Switch on the battery pack
  3. Attach your MP3-player to the audio jack cable of the PCB
  4. Play a song (any song!)

If everything is functioning correctly, you should hear music!

Switch off the battery pack and proceed to the next building-block when ready.

3. Microcontroller, Digital Line Converter, and H-Bridge

This building-block should take up to 30 minutes to complete.

Grab a pair of headphones and plug them into your computer. Now play this encoded song. Notice that the left-side of your headphones plays music. What you hear on the right-side, however, is something else. What you’re hearing is the sequence of dance moves encoded into digital information.

In our robot, this digital information (or electrical signal) is sent to the onboard computer through a Digital Line Converter, which is used to help regulate the signal. Our onboard computer (here we call it a Microcontroller) interprets this information as dance moves, which it uses to command the robot’s lights and motors. An H-Bridge is used by the Microcontroller to control the motor’s speed and direction of rotation.

How is Information Encoded?

In this project, we use something similar to Morse code, but read on about the encoding here.

Build It!

Take a look at the Microcontroller, Digital Line Converter, and H-Bridge section of our electrical schematic. You’ll see that together they are made up of 6 components: 3x capacitors (C3, C4, C8) and 3x integrated circuits (U2, U3, U5).

Find these parts in your kit and solder them to the PCB.

WARNING! Before soldering, always switch off your battery pack.

Solder a 2-wire cable to each of the two motors in your kit. Be careful to note the polarity and follow the picture below!

Test

Take the following steps to test your Motors:

  1. Connect the motors to the PCB
  2. Switch on the battery pack
  3. Attach the audio jack cable of the PCB to your computer’s headphone jack
  4. Play this song

If everything is functioning correctly, you should see the motors turn!

Switch off the battery pack and proceed to the next building-block when ready.

4. Light Emitting Diodes

This building-block should take up to 30 minutes to complete.

Light emitting diodes (or LEDs) are the lights on the robot. We’ve already added one LED, see the Power Supply building-block. Here we’ll add a few more.

Build It!

Our LED unit is made up of 10 components: 2x network resistors (RN1 and RN2) and 8x LEDs (LED0 … LED7).

schematic_LED

Find these parts in your kit and solder them to the PCB.

WARNING! Before soldering, always switch off your battery pack.

POLARIZED COMPONENTS! LEDs are always polarized.

component_LED

9758840925_416148e85f_o

Test

Take the following steps to test your LEDs:

  1. Switch on the battery pack
  2. Attach the audio jack cable of the PCB to your computer’s headphone jack
  3. Play this song

If everything is functioning correctly, you should see the LEDs blink!

Congratulations — you’re finished Electrical Assembly! Switch off the battery pack and proceed to the next part of the tutorial.

> Proceed to Part-4: Mechanical Assembly