REVOBOTS 5/6: The end of the REVOBots Story

Students in REVOBots

For schematics and code, check out the revobots page here.  For video of the bot, look here.

Well folks, it is about time I wrapped up REVOBots, which turned out to be just as much work as expected; which is to say that it took more time and effort that I had planned.  And as expected, attendance dropped off towards the end of the semester as our project based classes go into full swing and spring (and the opportunity to lounge around outside) starts to warm up the weather.

REVOBots 5 ended up being an explanation about some code that I wrote, and an introduction to EagleCAD.  I have attached the code to the revobots 6 pdf because if fits in better there.

A student testing a ‘bot in the dark

REVOBots 6 was a build day dedicated to making the revobots go.  There were two critical failures on my part before revobots 6:

  • Did not spec out the motors/H-bridges properly.  The motors turn out to run at 3V, while the H bridges run at 5- ~30 V.
  • Did not order parts early enough

That said, the bots still work at 5 volts, albeit with a drastically shorter motor life.  But operating at 5V this seemed to cause too much of a current drain on the power supply, so we got some weird twitchy behavior during the class.  Since then I have developed a cheap fix using two 2n3906 NPN transistors, and a smattering of decoupling caps.

Top view of the ‘bot

What is a decoupling cap though?  Doesen’t the five dollar arduino already have them?

The answer to the second question is yes, but the cap was not big enough.  The problem the circuit was having was that the batteries were  trying to output a constant voltage.  This means that as current demands changed in the circuit, the battery had to adjust the output current.  With the microcontroller taking only a few miliamps, the circuit is not drawing much power.  BAM!  Motor turns on and what happens?  The battery needs to supply more current, but can’t.  Then the mcu shuts down as it looses power, sending a short pulse to the motor.  So bigger decoupling caps were needed to smooth out the power supply, which the caps do by charging up to 5V, and then discharging if the voltage drops due to sudden current demand.

So the symptoms were: mcu turning on and off, which I could tell because the status LED I had attached was flickering.

The prescribed cure was: Find all the capacitors on my floor, and stick them across the power rails.

Result:  REVOBot works!  Check it out here!  (In this video it is running away from light because I have the motors running in reverse).

REVOBOTS: Manny the Manual Line Following Robot

Manny, the manually operated robot

So the other day I got bored and prototyped something which I quite liked for revobots.  It might be to people advantage to see it here before revobots meets again in two weeks, so I thought I would do a post.

One might wonder what a manual robot is.  Well, thats what I am calling this.  It doesn’t have any actuators, so you have to move it around with your hand, but if you follow the instructions it gives you (via the LEDs) it will follow a line!

The pseudoalgorithm for this is that each sensor has some threshold so that it reports a status back- either light or dark.  If the middle sensor is dark, and the outer sensors are light, then light no LEDs.  If any sensor is not on the proper darkness, a corresponding LED is lit.  So if the left sensor strays onto the line, and the other two are off the line, then the middle and left sensor LEDs turn on, indicating the need for a right turn.

Oh no! Hard to port!

Soon I will have this mounted on a revobot chassis with power, then I will post a video and documentation!



REVOBOTS Week 4: Rebobot Factory

Robot Factory!

Videos: Part 1 Part 2

Guide: TSK4

Today AC113 was turned into an assembly line for pololus robot chassis kit.  The lecture today was about controlling big things with little things, with interrupts (which I thought was an important topic) thrown in in the context of encoders.  The turnout was a little below what it normally is, but still pretty good.  Word on the street is that the freshmen have a lot of stuff due this coming week, so there is a big crunch to get that done and therefore there are less REVONauts (as I call them).  Still, there was a good turnout.  Next time I would definitely teach the class in pairs of two to a robot, but one to an arduino.  I am afraid that there is going to be too much debugging of implementations of different robots/hardware that it will be hard to get to each student individually.  Working in teams raises the threshold for when people come to me, and it might actually increase the quality of the exercise for everyone so that people get more done.

Here are some shots of the assembly line:


Attendance was not too shabby

REVOBots Week 3: Halfway There

Another good turnout. Obviously, this is not a picture of everyone who attended…

Material for week 3:

Videos: Part 1 Part 2

Guide: TSK3

And by halfway there, I mean halfway done with REVOBOTS!  So far, we have built a $5 arduino clone, learned about several kinds of sensors, and finally, this week I (properly) showed them how to write code that runs on the clone.  I think it went well.  This class alleviated a lot of the previous frustrations people were having with the device as far as having hardware but not knowing how to use it.  By the end of class several people had actually managed to build a breakbeam sensor, which I thought was awesome.

Debug ALL the problems!

On the other hand, the actual devices that the students built are starting to show some wear and tear; often people have some trouble connecting them to their computer.  Often, the problem is that the USB cable had come unstuck from the header pins and needs to be resoldered, or the ground and power wires are touching (Which shuts off the USB port), or the usb cable came out of the breadboard and was plugged in backwards (D- and D+ swapped).  I think it might be worth my time in the future to cad up a board for these bootloaded atmega328s so that they are less likely to fall apart, or be put together wrong.

Inspiring student gets breakbeam sensor to work.

Despite the frustrations and the general roughness of the first pass at teaching revobots, I think it is worthwhile for both me and the students.  Hopefully I will teach this again soon, but better.

REVOBots Week 2: Gotta Switch up The (Teaching) Plan

This week we talked about sensors. The amount of light on the LDR changes the brightness of the LED

Class two videos: Part 1, Part 2, Part 3, Part 4

The Guide: TSK2

REVOBOts continues to be a fun class to teach.  We had another great turnout, considering that it is candidates weekend, which is always on of the buisiest times of the year.  I would say there were at least 20-25 people, which is about 2/3 of the class.

The topic this week was sensors.  Sensors are handy things, and we talked about resistive sensors (LDRs or photoresistors, thermistors), photodiodes, switches, and digital sensors.

My feedback was again mixed.  Some people enjoyed hearing about the broader material that we did not immediately use, and really liked seeing the datasheets, while some people thought it was too in depth or not valuable.  Next time I should definitely check out the datasheets before I pull them up; one of the sheets had all sorts of useful stuff on it, while the other one was lacking the very graph that I wanted to show everyone!

One area I need to improve on is retention.  I made an almost-joke last time that I am just throwing mud at a wall and seeing what sticks; this is becoming all too true, and the wall is starting to look more like a teflon pan in terms of stickiness.  It seems like people are getting a lot of information about the things they have, like these sensors or parts I am handing out, but they don’t know how to combine them.  I guess it is hard for me to anticipate some of these problems because I expect them to have some modicum of electronics knowledge, or sense from the required freshmen classes.  I guess Brian Storey and Brad Minch are having the same problems with I am, as far as balancing the “coolness” and “breadth” vs. teaching people electronics basics.  People also had a lot of questions about the “arduino language” that is used for programming these devices, and that is something I have not covered as much because as freshmen, they all have done quite a bit of matlab coding.  I see now that I should always provide code examples.

In this light I am going to tweak next weeks curriculum a little bit.  It was supposed to be in depth on different communication protocols, but instead I will only cover the usbsimple library, which is used instead of the serial library on the secret knowledge $5 arduino.  This is because the TSK arduino does not have an FTDI chip, and therefore has no serial output.  Instead, it uses VUSB to talk to the computer, and a python program on the other end to displat the data in the command line.  It might be nice to spice it up a little and have some kind of bar graph or canvas drawing instead of a command line thing, but that will depend on the free time I have between now and next saturday.

By concentrating on the USBsimple library, I will be able to also go through some of the more useful core arduino functions and libraries, like servo.h and map().  I will think of some examples, and then some in class exercises, and try to shrink my talking time to 45 min instead of an hour++ as it has been the last couple times.  To increase engagement and concentration integrity, I will have them work in groups and then present their project.  I don’t know if I will enforce pair programming but that is another way I might be able to increase concentration, because one person will be busy dictating and the other typing, which prevents either of them from checking their email or making memes.

REVOBots Week 1: A Success, Overall

Microcontrollers, Yo.

Links to videos and handouts for class:

Part 1, Part 2, Part 3

REVOBots handout 1

REVOBots week 1 was a success, in my opinion.  Teaching a class is tricky.  This first class was doubly so because it was my first time giving a long lecture, and because I had about 25 people to distribute tiny parts to, and then I had to walk them through manipulating these tiny, unfamiliar parts so that they worked.

The first mistake I made was not printing out the handouts ahead of time.  This was a big mistake- there were four color pages + a black and white feedback page, and for 25 people + extras, it took the xerox about 10 minutes to print them out.  This delayed me getting to class on time!

Lots of people=lots of prep

This of course, meant that I didn’t have time to parcel out the tiny components we were going to use to build the arduino.  This took up more class time, but it was not something I was willing to spend my own time on.  Since I am the one doing basically everything for the class (aside for actually paying for parts, which has been graciously funded by CORE, the Council of Olin REpresentatives), and that takes a lot of time, I try to minimize the amount of extra time I spend on it for just one person.  In other words, I try to optimize my bang-per-hour.  That means I have to stop myself from hunting people down and delivering their parts because they couldn’t make it, because that takes too much time (10 people x 10 minutes is an hour and 40 minutes!).

Once the handouts were out I started in on a very broad lecture about microcontrollers.  I tried to cover all the important aspects; brands, memory size, programming, and how PWM, ADC, and counters worked.  I intentionally went broader than the scope of what we were going to do in class because, I am basically throwing mud at the side of a barn and seeing what sticks.  I might as well throw a lot of mud, because people are not going to be able to devote a lot of time or effort to this class since it is once a week and not for credit; more mud means more will stick, which is the point of this class.

Now I know how the guy in the blue (one of our professors) feels sometimes!

After the talking at people was completed, I asked that people fill out the first half of the feedback sheet.  Then parts were passed out, the building of secret knowledge arduinos began!  I wish I had been able to prevent people from starting to build the circuit, but since some of them knew how to read the schematics (aided in large part by my guide), people began to build the circuit.  I tried to walk people through step by step, but I was often interrupted by people who needed help or by needing to supply tools to do part of the assembly.

This of course, fragmented everyones build process, much to my chagrin.  I saw everything wrong with the circuits over the next hour; D+ and D- switched, power shorted to ground, diodes in backwards, resistor in the wrong spot, chip in upside down…the works.  Many cries of “it gets really hot” were heard, and some magic smoke was released, although only two chips were damaged permanently.

Oh Windows 7, y u no work?

By the middle of the build session a few software problems had come up, particularly with windows users.  Linux users are advised to start the arduino IDE with sudo arduino, which works well and gives you USB privileges.  Windows users will need an installer designed by Kevin Mehall, which I will try to add to the downloads page.  It also turns out that the new version of the arduino software does not work very well, as in it couldn’t compile its own example code, so people had to revert to the old version.  Other than that, everything went well.  I tested everyones board before they left, to ensure that they were ready for the next class!

REVOBots: Getting Ready!

Custom SMD Attiny45 USBISP programmer doing its job!

Last night a small package from monoprice, and a huge box from pololu arrived.  In it were the materials for the REVOBots class I am going to teach.  Since the first class is this weekend, I really needed to finish the guide/handout!  I spent all night building a Tamaiya gearbox (pictorial instructions soon!), re-building a $5 arduino, and eventually fixing an attiny45 based usbisp programmer.  The git repo for the bootloader of the $5 arduino is here.  It took about 6 hours to finally get everything working.  There were several stumbling blocks, like the gearbox having 3-4 configurations, and a dead ATMega chip.  But when I finally got the arduino IDE to talk to the chip, it was worth it- it was much easier to sleep knowing that the parts coming in from digikey would work.  Anyways, the first REVOBots guide is posted now, in the downloads section, or with this link.  REVOBots are coming!

REVOBot 001