Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

4. Project: Clock > Parts List

Parts List

The following tools, electronic components, and Lego parts will be needed to complete the clock:

Tools & Electronics

  • Arduino Uno

  • Bricktronics Shield

  • 4 Mindstorms wires

  • Power supply rated for 9V at 1.3A or greater with a 2.1mm center-positive plug. This provides power to the Arduino and Lego motors.

  • Drill & 3/16th inch drill bit

  • Hot glue gun

ABOUT THE L293D CHIP

For the original iteration of these projects, we chose the L293D motor-control chip, and we went on to use that as the heart of the Bricktronics Shield. You’ll be using the Bricktronics shield in this project, but here’s some background on the L293D.

The L293D is a robust motor control chip that enables precise control of one or two motors including voltage and direction. Let’s examine both of these factors. First, the controller can tell a servo whether to turn forward or backward with the help of three inputs: A, B, and Enable. If Enable isn’t active—in electronics parlance, we call this high—the motor doesn’t turn. When Enable and A are high, but B is low, the motor turns one way at full speed. When Enable and B are high, while A is low, the motor turns the other way at full speed. If both A and B are at the same level, the motor doesn’t turn.

Second, we can also use these inputs to control the speed of the motors, through pulse width modulation (PWM)—switching between two voltages fast, creating a series of pulses. The length of the high part of the pulse compared to the length of the low part of the pulse determines the effective “value” of the PWM voltage. In Arduino, the value can range between 0 and 255. 255 means maxed out at 5V, while 0 means no voltage. If we put a PWM voltage into B, while keeping A low, we can change the speed of the motor. When the PWM pulse is high, the motor will move, and when it’s low, the motor won’t be moving, but these happen so fast that it is mostly unnoticeable.

So, why do we need the L293D? Can’t the Arduino drive motors? The quick answer is yes, an Arduino can control hobby servo motors quite well, but the Mindstorms motors are more complicated and need a dedicated motor control chip to avoid maxing out or damaging Arduino pins. For a longer and more detailed answer, see Chapters Chapter 2 and Chapter 3 where we delved into Mindstorms and Arduino, respectively.

The L293D is a handy chip if you want to drive motors with an Arduino
Figure 4-2. The L293D is a handy chip if you want to drive motors with an Arduino

Lego Elements

You’ll need these elements in the quantities listed below to build the clock
Figure 4-3. You’ll need these elements in the quantities listed below to build the clock
  1. 2 Mindstorms motors

  2. 2 touch sensors

  3. 4 3M Technic beams

  4. 2 7M Technic beams

  5. 1 9M Technic beam (blue or some other bright color[12])

  6. 6 11M Technic beams

  7. 4 15M Technic beams[13]

  8. 12 double angle beams, 3x7[14]

  9. 11 half bushes (2 of them yellow)

  10. 23 bushes

  11. 26 connector pegs

  12. 28 cross connectors

  13. 6 3M connector pegs

  14. 7 tubes (3 of them brightly colored)[15]

  15. 1 90-degree angle element

  16. 2 double cross blocks

  17. 1 4M cross axle

  18. 2 6M cross axles

  19. 2 7M cross axles

  20. 2 9M cross axles

  21. 5 10M cross axles[16]

  22. 1 12M cross axles

  23. 1 8M cross axle with end stop

  24. 2 8-tooth gears[17]

  25. 3 24-tooth gears[18]

  26. 1 40-tooth gear[19] (modified; see Prepare the Gear, later in this chapter)

A NOTE ABOUT SOURCING LEGO

As you begin gathering together materials to build the clock, you may realize that you’re missing critical elements. Maybe all you have is the standard Mindstorms set and the 40-tooth gear isn’t in it. In Chapter 2 we explored where you can acquire all the parts you need to build the robot of your dreams. In the meantime, feel free to substitute parts and change the format of the clock. We created it one way, but there are a million legitimate configurations. Go crazy! That said, be aware that you’ll need to adjust the code if you switch up the gears. See callout 14 in the same code at the end of the chapter for an explanation.

Also, as you did in Chapter 1 you may need to buy additional parts. The following parts are not found in sufficient quantity (or at all!) in the Mindstorms set:

  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint