LEARN.PARALLAX.COM
Published on LEARN.PARALLAX.COM (https://learn.parallax.com)
Home > BSA Robotics Merit Badge with the Boe-Bot

BSA Robotics Merit Badge with the Boe-Bot

This mini-course will assist you in completing the “hands on” requirements of the BSA Robotics Merit Badge entitled “Section 4: Design, build, program, test”.

 

Download the BSA Robotics Merit Badge Requirements Workbook

This course uses the Boe-Bot Robot from Parallax Inc., a recommended robotics kit for this Merit Badge.

About the Boe-Bot Robot

The Parallax Boe-bot robot kit is a comprehensive program that includes all the hardware, software, documentation, and support necessary to understand many aspects of engineering, mechatronics, and software development.  Included with the Boe-bot kit is a comprehensive book entitled Robotics with the Boe-Bot.  This book is available in hard-copy as well as free downloadable .pdf.

Robotics with the Boe-Bot contains much more technical information than what the Robotics Merit Badge requires.

This abbreviated series of lessons (gleaned from Robotics with the Boe-Bot) was created to encourage Scouts who are interested enough in robotics to obtain their Merit Badge, but not enough to go “too deep, too quickly”.  For some of you, this may be the extent of your robotics adventure.

However, for the rest of you who get “hooked” after achieving the Badge, go ahead and dive right into Robotics with the Boe-Bot — a much larger and amazing world awaits!

 

About this Mini-Course

This mini-course includes “Challenges” which are scenarios where you must come up with solutions, based on what you’ve learned while studying robotics.  You’re encouraged to use Robotics with the Boe-Bot as a reference guide, should you want a more comprehensive explanation of the mini-course concepts.

You should complete at least Challenges #1 and #3.

Challenges #2 and #4 are “real-world” Challenges.  You are highly encouraged to do these, as they demonstrate real-world issues that may/can be solved through the application of mobile, autonomous robotics technology.

You and your Counselor may wish to define two or more “Collaborative Design Challenges” that can be variations or extensions of the ”standard” Challenges.  This is HIGHLY recommended and encouraged, as it involves “working as a team” between you, other Scouts and your Counselor.

And of course, another significant tenet of the Badge’s requirements is to document everything you do. That is what your Engineering Notebook is for – Use it liberally!

This mini-course is a set of web pages.  You can browse through them using the menu at left, or using the links at the bottom of each page.  If you want to save this mini-course on your local computer, or if you want to simply print it out, click on the “Printer-friendly version” link in the lower right corner of the page.  Then, in your browser, choose File > Print or File > Save as to print or store the entire mini-course.

 

Links for Robotics Merit Badge Counselors

  • Robotics Merit Badge Counselor Information – tips for using the Boe-Bot robot with your troop
  • Boe-Bot Kits in the Parallax shop

 

Set Up your Robotics Lab

There are three main “environments” within your Robotics Laboratory.   Each of these must be kept organized – otherwise you’ll have chaos.  Chaos and robots do not go well together.

Environment #1: Hardware

Building robots usually entails working with a wide variety of tools and components.  Many problems can be avoided by simply keeping your work area clean and orderly. Among the items that you may be working with are:

  1. Mechanical components such as wheels, nuts, bolts, and battery holders.
  2. Simple electrical components like switches, batteries, and wires
  3. More complicated electrical components such as resistors and LED’s
  4. Very sophisticated and sensitive electronic components like microcontrollers
  5. A wide variety of tools such as pliers, wire cutters, soldering irons, and test equipment

Safety First!
In dealing with hardware, there is one primary safety rule: 
ALWAYS WEAR SAFETY GLASSES! 
You never know when one little part may pop up and get you.  Don’t take the risk.  Safety glasses are cheap insurance – invest in them!

  • Gather the following items:
    • 1 Boe-Bot Robot Kit from Parallax Inc. 
    • 4 AA cell batteries, 1.5 V each
    • Masking tape
    • A pen or pencils and erasers
    • Your Engineering Notebook
    • Safety glasses

 

Environment 2:  Software

You’ll be installing some software into your computer which will provide a method of getting computer code (that you will be writing or editing) deep down inside the “electronic brain” known as a microcontroller. 

Think clearly about what you’re asking the code to do.  Remember, when computer code is loaded into the microcontroller, the microcontroller will do exactly what you told it to do.  And, with your microcontroller connected to hardware devices (like motors, etc), sometimes your programs may cause un-intended results — perhaps like driving your robot off the table.  Don’t let that happen!

  • Download and install the BASIC Stamp Editor Software on your Windows computer from this page.

 

Environment 3:  Your Mind

Keep your mind on what you’re doing at all times.  Safety cannot be overemphasized!  Something as simple as clipping component leads may result in injury.   It’s possible to wire up a circuit that looks just fine, until power is applied.  Then…poof!… you’ve let the “magic smoke” out.

Today you may be building a table-top robot.   You may write a program that causes it to roll off the table and plummet to the floor.  That’s bad enough.  However, tomorrow you may be creating a control system for an automated airplane landing system.  Failure on that scale is not an option.  Think things through.  And then think them through, again.

Build the Boe-Bot Robot

Follow the steps below to build your Boe-Bot robot chassis. 


Step 1: Mount the Topside Hardware

(1)  robot chassis
(4)  1″ standoffs
(4)  pan-head screws, 1/4″ 4-40
(1)  rubber grommet, 13/32″

 

  • Insert the 13/32″ rubber grommet into the hole in the center of the chassis. The groove on the edge of the grommet sits over the metal edge of the hole.
  • Use the 1/4″ screws to attach the standoffs to the top of the chassis near each corner, as shown.

 


Step 2: Remove the Servo Horns

(2)  Parallax continuous rotation servos.

  • Use a Phillips screwdriver to remove the screws that hold the servo control horns on the output shafts.
  • Pull each horn upwards and off the servo output shaft.
  • Save the little screws; you will need them again soon.

 


Step 3: Mount the Servos on the Chassis

(1)  Boe-Bot Chassis, partially assembled.
(2)  Parallax continuous rotation servos
(8)  pan Head Screws, 3/8″ 4-40
(8)  nuts, 4-40
masking tape
pen

  • Slide the servos into the chassis.  Look at the little arrows: the servo’s mounting tabs set outside, and the little holes in the servo case are facing the triangle end of the chassis.
  • Attach the servos to the chassis using the Phillips screws and nuts.
  • Use pieces of masking tape to label the servos left (L) and right (R), as shown.

 


Step 4: Battery Pack

(2)  flat-head Phillips screws, 3/8″ 4-40
(2)  nuts, 4-40
(1) 4-cell battery pack with 2.1 mm center-positive plug
 

  • Insert the battery pack inside the chassis positioned as shown in the picture below.
  • Insert flat-head screws from inside the battery pack, and secure them in place with the 4-40 nuts and tighten securely.
  • Add batteries to the battery pack.

 


Step 5: Cords and Wheels

(1)  1/16″ cotter pin
(1)  tail wheel ball
(2)  rubber band tires
(2)  plastic machined wheels
(2)  screws saved when removing the servo horns

  • Pull the servo cords and battery pack cord up through the grommet hole in the center of the chassis.
  • Line up the hole in the tail wheel with the holes in the tail portion of the chassis.
  • Run the cotter pin through all three holes (chassis left, tail wheel, chassis right).
  • Bend the ends of the cotter pin apart so that it can’t slide back out of the hole.
  • Press each plastic wheel onto a servo output shaft until it sinks into the wheel’s recess, then secure with the saved servo screws.
  • Stretch each rubber band tire and seat it on the outer edge of each wheel.

 


Step 6: Mount the BASIC Stamp onto the Board of Education

The brain of your robot is a tiny computer called the BASIC Stamp microcontroller. 

 

 

The BASIC Stamp plugs into the Board of Education development board.  It lets you easily connect the BASIC Stamp to:

  • a computer cable so you can send programs to the BASIC Stamp
  • a battery pack to supply power
  • servo motors that will drive the robot
  • circuits you will build on the white grid, called a breadboard

 Mount the Board of Education to the Boe-Bot’s standoffs as shown, using (4) 4-40 pan head screws.

  • Place the board on top of the standoffs, so that the white breadboard is close to the large wheels.
  • Use the screws to attach the board to the standoffs at each corner.

Centering the Servos

Servos are a special type of motor.  They come in two different types: standard and continuous rotation.  Standard servos rotate to a specific point (and stay there) based on the input signal.  These types are widely used in radio controlled (RC) applications.  For the Boe-Bot drive wheels, we’re using the continuous type.

Continuous rotation servos need be calibrated or “centered”.   If a servo has not yet been centered, it may turn, vibrate, or make a humming noise when it receives the “stay-still” signal from the microcontroller.

You will use a small Phillips screwdriver to adjust the servos so that they actually stay still while receiving the “stay-still” signal from the BASIC Stamp microcontroller. We call this centering the servos.

You’ll need the Phillips screwdriver that came with your Boe-Bot kit (Phillips with a 1/8 inch (3.18 mm) or smaller shaft).

  • Launch the BASIC Stamp Editor that you installed earlier on your PC.
  • Connect the USB cable from your computer to the control board.  
  • Place your Boe-Bot up on top of a small box or block so that the wheels are off the ground, and can freely spin without moving the bot.  
  • Set the power switch to position “2”.  This will provide power to the circuit board and to the servos.

  • Download Center Servos.bs2 program
  • Load the program entitled “center servos” into the BASIC Stamp Editor.  You should see a short program that looks like this:
DO
  speedLeft = 0
  speedRight = 0
  time = 30000
  GOSUB Wheel_Speeds
LOOP
  • Click on the Run icon to send this program down into the BASIC Stamp.

Your Boe-Bot may start spinning one or both wheels, in either direction. 

  • Using the small Phillips screwdriver, adjust the screw on the front of each of the servos so that they come to a complete stop.

This short program is sending the “center off” command to each of the servos, and by fine-tuning both of them, they will be completely stopped when this command is received by the servos.

Your Boe-Bot’s servos should now be calibrated and “centered”.

Build a Beeper Circuit

Building Circuits on a Breadboard

The white grid on the Board of Education is called a “breadboard.” You will use this board to plug in little wires and electronic components to build circuits.  How does a breadboard work, and why is it called a breadboard, anyway?

  • Watch this video to find out!

]

In a moment, you will get to build a circuit on your Boe-Bot’s breadboard.  Circuits are described with line drawings called “schematics.”  This video shows you how to look at a schematic and build that circuit on a breadboard.

]

 

Build a Beeper on your Boe-Bot

Ok, now it’s your turn.  This is about as simple a hardware circuit as we can get.  

On the left is the schematic symbol for a small “beeper” – a device that will emit a tone when given a series of pulses from an electronic circuit.  The right  image is what the beeper physically looks like.

This is the schematic diagram of the circuit that we’re going to build.  It shows the inter-connections of the circuit components.  In this case, the “+” side of the beeper is connected to a signal line called “P4” (whose connection is available alongside the breadboard area of the Board of Education)

This is a pictorial diagram of what your completed circuit should look like when you’re done…

  • Build the piezo speaker circuit on your robot’s breadboard.

This completes the “hardware” portion of this circuit.  However, for anything to happen, we need to introduce some “intelligence” (a program) to cause it to do something…

  • Launch the BASIC Stamp Editor and type in the following program:  You can click on the “BS2 Directive” which inserts the first line automatically, or you can type it in as shown…
 
' {$STAMP BS2}

x VAR Byte

FOR x = 0 TO 20
  HIGH 4
  LOW 4
NEXT

STOP
 
  • Click the Run “>” button.  You should hear a short “beep”.
  • Try changing the “20” to “255” – what happens?  How about other values between 0 and 255?
  • Can you explain what the program is doing to the beeper?
  • Write your observations (in your Engineering Notebook) on what the software (your code) is doing to the hardware (the beeper).

 

Controlling the Speed of your Boe-Bot

Let’s take a moment and look at the program that we used before to center the servos:

DO
  speedLeft = 0
  speedRight = 0
  time = 30000
  GOSUB Wheel_Speeds
LOOP

First we have the command “DO”…

…and then five lines below that we see another command …”LOOP”.

This tells us that the program is going to “DO” something (whatever that is), and then it’s going to “LOOP” back up and DO “it” again.  In short, it looks that this program will continue to loop forever unless something interrupts it.

In between the DO and LOOP commands we have:

  speedLeft = 0
  speedRight = 0

This appears as though the speed of the Left and Right servos are set to a speed of “0” …fully stopped?  So what happened when we first ran this program and the servos were perhaps moving?  That’s why we adjusted the screw — we calibrated the mechanical device (the servo) to the program that is going to be controlling it.   Now when any program wants to turn the servos off, all it needs to do give the servo motor a control value of “0” and it’s stopped.

So what do you suppose happens if you change “speedleft = 0” to “speedleft = 100”?

  • Try it and see if you’re right.
  • How about changing the value from “100” to “27”?  Try it.
  • Try different values between 0 and 100 for both the speedLeft and speedRight parameters. Do you see a pattern?
  • Write your observations in your Engineering Notebook.

So what did you discover?  Can you control the speed of both motors independently and simultaneously? 

 

Challenge #1

  • Change the speed values so that the Boe-Bot rolls in a circle (causing both servos to turn) to the right. 
  • Next, fine tune your program, so that the Boe-Bot’s circle is approximately three feet in diameter. 
  • Now, alter your programs such that your robot is going in the opposite direction. 
  • Document these program changes and their results in your Engineering Notebook.

 

Challenge #2

There’s a critical safety issue when baby chickens escape from the protection of the hen house.  But, as luck would have it, you are part of the Chicken Protection Engineering Team (C-PET). Other team members are addressing such challenges as how to detect when a baby chick has “escaped”, and how to get Little Chicken safely back home. Your mission, should you decide to accept it, is to give your Boe-Bot the ability to temporarily “corral” the baby chick within an 18” diameter “safety zone”.  Once your Boe-Bot has established this zone, a suction hose (developed by another engineering team) will deploy, and whisk the baby chick away to safety.  For some inexplicable reason, your Project Manager informs you that part of your design specification requires your Boe-Bot to run in reverse.  Please be advised that no baby chicks shall be injured during this Design Challenge.

  • Change the values such that the Boe-Bot rolls backwards in a circle to the left that’s about eighteen inches in diameter, as quickly as it can go.
  • Write your Code for this Challenge in your Engineering Notebook.  Be sure to use comments throughout your programs.

(Hint: Chapter 4 in Robotics with the Boe-Bot)

 

Collaborative Design Challenge A

Discuss (with your Counselor) and define a Challenge that you’ll need to accomplish.  At a minimum, it should include making the Boe-Bot navigate some pre-determined path.

  • Document what the Challenge is that you’ve agreed upon.  Then, as you try different programs to accomplish the task(s), keep good notes on what works, what doesn’t, and what other observations and ideas that you encountered or came up with.  
  • Once you have a working version of the Code (that accomplishes the Challenge) be sure to give your program “comments” as well.  This will help you in the future when you’re trying to figure out what the program is doing (or supposed to be doing!) as each command is executed.

Servo motors are controlled devices.  They are “told” (electronically) what to do.  We call that type of connection “Output”.  That is to say that the servo is controlled by an output coming from the microcontroller.

In almost every microcontroller system however, it’s a two-way street.  There’s both Output (making something happen), and Input (being notified that something happened).

In the same way that we connected I/O lines (like P12 and P13) to the servos, we can also connect sensing circuitry to an I/O line as well.  That’s why they’re called “I/O lines” – each one (of the 16 available on the BASIC Stamp2), can be used either as an Input or an Output. 

Input Gives your Robot a Sense of Touch

Have you ever stumbled around in complete darkness, to the point where you stretch your hands out in front of you to avoid tripping over something you can’t see?  Well, right now your Boe-Bot is completely blind.  We can’t give him eyes just yet, but we can give him a simple form of touch with what we call “whiskers”.

Building the Whiskers

This is a schematic diagram of the circuit that we’re going to build.  It shows the electrical connections between the individual components.  Don’t panic!  It’s not as difficult as it looks.

 

It would be good practice to draw this schematic in your Notebook because you may wish to alter some of the connections later.  Note that the dots indicate that there is an electrical connection at that juncture.  If two lines cross — with no dot — they are not electrically connected.

Here are the components that we’ll be using to build it:

The resistors (the components with the color bands on them) are as follows:

  • (2)  220 ohms (the color bands are “red, red, brown”)
  • (2)  10 k-ohms (the color bands are “brown, black, orange”)

 

  • Mount the whiskers on the Boe-Bot, like this:

  • Then, build the circuit on the breadboard, like this:

Each of those wires extending out past the Boe-Bot’s body act as the contact switches (labeled Right Whisker and Left Whisker).

  • Download Test Whiskers.bs2
  • Load the “Test Whiskers” program into the BASIC Stamp Editor, and click the Run icon.

A Debug Terminal should open up, like this:

  • Gently push in on each of the Whiskers so that they come in contact with their corresponding (3-pin) connectors.  If your circuit is built correctly, you should see the “0’s” change (on your screen) to a “1” each time you press on the appropriate whisker.  

 

So what’s going on?  Plenty!

You’ve downloaded a program into the microcontroller.  The program (inside the microcontroller) is constantly checking to see if the whiskers have touched anything.  If not, the display simply shows “zeros”.  If they do touch something then the microcontroller sends a signal from the robot, through the cable, and into the window showing us (on the screen) a “1” signal from either of the two whisker “sensors”.  

This simple exercise shows how a “real world” collision can be detected by your robot.  

The trick now is to give your Boe-Bot the ability to not only detect the whisker’s touch, but to also give it the ability to take “evasive” action.  

This is simple intelligence.  You’re giving your robot the ability to make a decision.

  • Download Whisker Press Bot.bs2
  • Next, load the “Whisker Press Bot” program into the BASIC Stamp Editor and click the Run icon.

What happens just after you press Run?

What happens when you press the whisker enough to cause it to touch the 3-pin connector on the breadboard?

  • Write your observations and results in your Engineering Notebook.

Let’s take look at the program:

DO

  GOSUB Check_Whiskers

  IF whiskerLeft = 1  THEN speedLeft  = -30 ELSE speedLeft = 0
  IF whiskerRight = 1 THEN speedRight = -30 ELSE speedRight = 0
  time = 20

  GOSUB Wheel_Speeds

LOOP

 

Here we have another “DO…LOOP”,  so the program is going to DO something and then it’s going to LOOP back and DO it again.

“GOSUB Check_Whiskers” is where the program jumps to another part of the code (not shown on our screen) to check whether either one of the whiskers is touching something.  If one of the whiskers detects a collision, then it will show up as a “1”.  Conversely, if there is no contact, it will show up as a “0”.  

Therefore, the line of code…

IF whiskerLeft = 1  THEN speedLeft  = -30 ELSE speedLeft = 0

…is executed as follows:

“If the Left whisker touches something then the speed of the left wheel will be turned on (backward), at a speed of -30.  Else (otherwise), if the Left whisker doesn’t touch anything, the servo remains off”.

And then of course, “whiskerRight” should react the same for the right wheel.

Your Boe-Bot is sitting there, waiting for something to touch its whiskers.  When something (or someone) does, the Boe-Bot backs away from the offender.

 

Challenge #3: “Make Contact and Avoid”

Right now, your Boe-Bot is just sitting there waiting to have one of its whiskers touched.  And once a whisker is touched, the machine wants to back away from whatever is touching it.  

  • Alter the program such that the robot is constantly moving forward.  Then, when either of the whiskers runs into something, the Boe-Bot immediately backs away from the obstacle and changes direction, and then continues on, looking for more things to run into!

This is a classic “detect and avoid” application where the robot can roam freely about, and hopefully! never get stuck!

  • Write your program in your Engineering Notebook.  Include some of your “thinking” processes as well – in other words – note the “why” of what you’re doing – not just the code itself.   

 

Challenge #4

Thankfully, all three librarians are safe after their grueling, seven hour ordeal.  

Early reports reveal that they were in the process of re-stocking shelves, when they inadvertently wandered into the Reference Section.  It seems that the day shift was unable to finish re-shelving their books and left some on the floor.  Oddly, each of the books was stood on edge.  This presented a navigational challenge for the librarians – they got disoriented and were stuck in that aisle until help arrived, many hours later.

You’ve been hired to prevent this from ever happening again.  The Librarians must have a “rescue bot” that can be deployed to show them the way out, should this situation ever happen again.

  • Program your Boe-Bot in such a way that it can find a way through a small maze of books.  The design of the book-maze is up to you; however it should include at least five obstacles (books, boxes, etc. (Hint:  see Chapters 4 and 5 of Robotics with the Boe-Bot).
  • Write your program in your Engineering Notebook, and also make a sketch of the maze you designed. Again, include some of your “thinking” processes. 

 

Collaborative Design Challenge B

  • Discuss (with your Counselor) and define a Challenge that you’ll need to accomplish.  At a minimum, it should include making the Boe-Bot move forward and backward with the ability to detect obstacles, and then navigate appropriately.  Document this Challenge as well as its solution in your Notebook.

Keep track of things that didn’t work too.  Sometimes there’s a “happy accident” — a solution that happens by virtue of a mistake.  At the very least, you’ll be able to keep track of methods that don’t work, but sometimes mistakes can end up “shining the light” on a whole new solution.

  • Extra Credit:  Include an explanation in your Notebook about what you’ve learned about a robotic system, and what you now know about robots that you didn’t know before you started.

How about trying to see how straight you can make the robot go.  What can you do to the program that would make it go completely straight?

  • Discuss with your Counselor:
    • What types of sensors could be used on the robot?  Are there sensors that can see, hear, or touch?
    • How could you improve the programs that you’ve written?
    • How could the robot’s hardware be improved?
    • What types of robots are currently in use today?

 

Going Further 

We’ve only scratched the surface of what robots are capable of.  You are encouraged to “dive deeper” by going through Robotics with the Boe-Bot in its entirety. Doing so will open you mind to what is possible in the world of robots.  Also, don’t think that a “little robot” is just a “toy”.  The only thing different between a Boe-Bot and a human-sized robot (like in the movies) is the scale.  

The Hardware, Software, and programming concepts are the same.  What you’ve learned on a small scale is directly applicable to a large scale.

As always, document everything you do – Use your Engineering Notebook!  From the idea stage, through the design, prototype, and testing stages – you never know when an unintended “accident” may become a “really cool feature” for you robot’s capabilities.

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024


Source URL:https://learn.parallax.com/courses/bsa-robotics-merit-badge-with-the-boe-bot/
Links