Navigation:

BOE Bot

whiskerbot.jpg

The Board Of Education robot (BOE Bot) is an Arduino-based self-navigating robot that can be constructed to sense the world with touch, visible light and infrared light. You can make it navigate mazes, detect edges, follow paths and detect and follow other BOE Bots. Have a look at the following examples on Youtube:

Aims of the experiment

Today much of science and technology relies on using computers to process and make sense of large bodies of data. This often requires a knowledge of programming languages like C, C++ and Python. But programming on its own can be intimidating and even (to some) boring. In this cool experiment we will combine hands-on electronics and robotics with programming to actually see the results of our programs.

You will learn how to use and program the Arduino microcontroller which forms the brains of the BOE Bot. The Arduino is a simple but powerful microcontroller that can accept various forms of input (from sensors) and process the inputs (using the program - this is where you come in) to produce outputs (that is, control the robot).

By the end of the experiment you will know how to use and program the Arduino, the basics of electronics (resistors, diodes, photo transistors) and will know enough to get you going onto your own projects.

Assessment

The assessement of this experiment is rather different from any of the others you will have done in the SCM laboratory. There is no error analysis or data collection in the usual sense. Instead the focus here is on programming and the development of algorithms to control the robot. Therefore, you will be assessed on

Note

//Should you include programs in your report? //

If you do so, the report will become very long indeed. But you do need to include the important bits of the programs you have used.

//How do you know which bits of the programs to include? //

The parts needed to make your point are all that you need. Do you really need the definitions of all variables? Or the setup() portion? Often not. Often all you will need is to say something along the lines: the following function was used to read out the phototransistors....followed by snippit of the function...and an explanation of how it works.

For an example of how to quote only small portions of the program see the examples on this page. (click here for a PDF version)

Try to be as concise as you can. Remember that the report must be between 8 to 12 pages only!

Important

Structure of your report: Your report should be broadly structured as follows:

  • Theory: There is no theory as such. This is a programming exercise, so your Theory section should describe the elements of programming that you have learnt during the course of this experiment. Use short snippets of code to illustrate the different structures. Start from the overall structure of an Arduino sketch.

  • Experimental setup: This would include the Arduino, the BOE bot, and related circuits.

  • Results: These would include the data you have been asked to record below. But unlike the other experiments you have done, you are expected to describe the working of some programs.

  • Error Analysis: There is none. Instead the marks usually allocated to this will be distributed to the Results section.

  • Conclusions: This I leave to you. What was this experiment all about? What happened? What did you learn? What were the results of the exercises? Where do you see this lead? What's the point of programming in the context of a Physics laboratory? What are the applications of microcontrollers? What are the strengths and limitations of the Arduino? These are only some questions you will want to consider. No doubt you will find others.

The BOE Bot

We will be partially assembling your BOE Bot. Yes, it is more fun assembling it on your own, but we don't have time for everything. So what you should see is something like the BOT on the right (but without the LEDs and resistors):

boebot-assembled-1.jpg

The Arduino board hangs under the BOE shield (add-on boards to the Arduino are called //shields// - perhaps because that is what they do: they shield the microcontroller from the World).

Getting started with the BOE shield

Have a good look at the BOE shield. This is where you will connect all components. It is the board sitting above the Arduino. The shield contains a number of Input/Output (I/O) pins (black) with numbers. Also present is a white //proto-typing// area which is where all the components will go.

We will no go through a series of activities. You must get through these in sequence.

Important Assessment

  • Brief description of the steps you have taken and the results of this section. Start with the aims of this section.
  • Solve the three exercises in the Challenges section. Your report should include a detailed description of the third exercise only. This must be in your own words and not a cut-and-paste from the website.

  • Include any relevant circuit diagrams and programs. Remember to include comments in your programs.

Assemble and Test the BOE Bot

boebot-led-indicators-1.png

You are nearly ready for some real robotics, but we first need to test the BOE Bot to make sure all is well. The Bot has already been assembled for you, but it has likely not been tested. Make sure you get through all activities in this section before proceeding.

All done? Take the Challenge. Solve Exercises 1 and 2.

Important Assessment

  • The data table and plot of the transfer curve for the servos.

Warning

You should have finished all parts to this point by the end of week 1. Have you got:

  • Data for the transfer curve?
  • Notes for the elements of the programs so you can describe the working of the programs?

boebot-maneuvers-1.jpg

In this section you will learn how to control the BOE Bot using more advanced programming techniques. Work through as many activities as you can (time permitting) and try and understand the programming methods the tutorials explain. By the end of this section you should have a good understanding of functions in C and should be able to get the BOE Bot to maneuver in well-defined ways.

Done? Go to the Summary and Challenges. Do exercise 3 only.

Important Assessment

  • A description (with a commented program) of functions. In particular the maneuver function.
  • Include a detailed solution to exercise 3 only. As always, this should include the program and a description (in your own words) of what the program does in each stage.

Maneuver with Tactile Sensors

whiskerbot.jpg

This is the stage we have been working up to: An autonomous robot capable of moving around and self-navigating.

Go to the Tactile Navigation page and try out all four activities. Links to these are also provided below:

Don't forget the Challenges at the end and do exercises 3 and 4 only.

Did you manage to get your BOE Bot to get out of corners? This is probably the hardest thing to get right. Ever seen insects unable to get out of a window? The BOE Bot behaves like that when in a corner. Play around with the code to build in a bit of atrifical intelligence to make it recognise a corner and get out of one.

Important Assessment

  • A description of the robot and how it senses its environment.
  • A detailed description of the algorithm used to get out of corners. How does it work? Can you think of a way of improving it?
  • Solutions to exercises 3 and 4. Relevant parts of the program and a description.

Warning

You should have finished or almost finished all parts till here by the end of week 2.

boebot-phototransistors.jpg

Navigation with whiskers is neat but not too exciting. It's like walking around blindfolded, with your arms extended out like the whiskers are. You can get around, but it would be nicer to //see// what's around. This is where the phototransistors come in. They allow the BOE Bot to sense light levels around the room and navigate towards the light, or away from it. It is even possible to get the Bot to circle a light - exactly the way phototactic insects like moths circle ceiling lights.

We will do all the activities in the Photo-Navigation section. These are also listed below.

Important

  • Assessment

    • Describe how you used a single photo transistor to get the robot to detect light and stop under a bright light. Circuit diagram and program needed.
    • How does a charge-transfer circuit work? What are the principles involved? Circuit diagram needed here. How does the program work?
    • How do you get the robot to navigate under different lighting conditions? How does the code adapt to differnt conditions? Can you think of any weaknesses in the code?
    • Provide an example of a graphical display of the light measurement from the two photo transistors.
    • Provide the code you have used to get the robot to navigate with light. Make sure it is well commented. You may provide the code in sections, with textual descriptions of each section.
    • Solve project 2: Get the robot to seek shade rather than light. How did you achieve this? Provide a clear explanation.

Tip

  • Final Challenge: Navigation with both whiskers and light sensors

Can you now combine the whiskers and phototransistors to allow the robot to navigate with light (using the phototransistors) as well as the whiskers? This is a useful combination when it encounters light reflected off a barrier: the phototransistors alone will cause the Bot to go towards the reflected light, but the whiskers would be able to tell it that it can't get through.

You will need to

  • combine the two circuits. Plan it so that all components fit on the small bread board.
  • combine the two programs: The navigation with whiskers program will need to be combined with the light navigation program. Since this can be tricky, I have put a sample program here. You will find hints included in the program. Feel free to edit it. Bear in mind that this program must be made consistent with the circuit layout you decide upon.

Once you are done, show the result to your lab demonstrator. Take a photo of the setup. If you have modified the program, save a copy and include the relevant portion in your report. Make sure you explain clearly what you have done using suitable comments. The code is long so please do not include all of it and try to keep most of it in an Appendix. As with all programs, you need to explain how it works. This needs to be a high-level, algorithmic description. It should not be too long!

In your lab report you will need to display a clear circuit diagram of the circuit used (this should be the schematic circuit diagram, not a photo of the circuit! You can sketch the circuit diagram and photograph it, but make sure it is a clear and well-labeled sketch.) for the combined whiskers and phototransistor navigation.

Warning

  • The assessed part of your lab ends here.

Proceed to the next step (which is optional!) only if you have completed all parts of above, assessed portion!

The final stage in the development of the robot is to get it to navigate with infrared light emmitters and sensors. As we shall see, these behave like long-range whiskers. We will now be able to get the robot to detect the edge of a table (risky and will will instead use black take to simulate the edge) and, optionally, to follow another robot around.

If you finish the required parts of this section early, you could attempt to get the robot to navigate a maze (we will have a competition) and perhaps even to follow another robot.

We will attempt all activities in the Navigating with IR section. These are listed here:

Tip

Maze navigation

If time permits (and you get to this stage!) we will have a maze navigation competition. This can be tricky. You will need to really understand what your robot is doing to get it to navigate in the confines of a maze.

IR and visible light navigation (optional)

It is possible to combine the IR and visible light navigation codes and hardware. With this, you could make a robot that used visible light to look for bright (or dark) areas, but which switched to IR navigation if obstacles were detected. (This is optional.)

My code for IR and visible navigation is here. You may want to compare codes. Which one is more efficient and robust?

SKIP THIS

The Arduino

arduinounotop.jpg

You will first need to learn a little about this microcontroller. This is best done by using it to build a few projects:

  1. Blink, (dead easy - mainly a way to test to see if your setup works) (PDF)

  2. Control a single LED (PDF),

  3. Digital Inputs (PDF).

There is more information and more ideas for projects on the Arduino page. Additionally, you will find links to the C-language reference and other useful information. So have a look there.

Try to understand what the programs - called //sketches// in Arduino lingo - do and how they achieve the behaviour.

When you are comfortable with those get back the BOE Bot.

Important Assessment

  • You do not need to describe these experiments in your report. But you do need to (briefly) describe what an Arduino is and how we communicate with it using I/O pins and a sketch. Don't spend too much time on this. The main aim here is to introduce you to the Arduino and the basic elements of programming this microcontroller.

AJMPublic/teaching/arduino-pi/projects/arduino/BOE-Bot (last edited 2021-04-14 13:04:20 by apw109)