Square One Autonomous Innovative Vehicle Design Competition

Square One Education Network hosts a number of events every year. These include high quality Professional Development as well as student competitions. For the last three years our students have been competing in their Autonomous Innovative Vehicle Design Competition. The goal is to turn a Power Wheels Jeep into an autonomous vehicle. For this competition Square One provides the Jeep and also gives teams money to buy parts and supplies.

I’ll be documenting some of what my students have done this year here in this post. I’ll be updating this post with pictures, more details on parts, and all of the code (that will likely be after the competition)

Parts and Sources:

Things to Know/What we used these parts for:

You need some sort of a motor controller to allow your Arduino to regulate the current from the battery to the drive motors. We’ve used the Monster Moto Shield from SparkFun every year and it works like a champ. This will let you run the motors forward/backwards and give you a measure of speed control. You’ll need to solder on header pins and screw terminals, so be sure to order those at the same time. One weird thing we just discovered. We ran into a motor control problem last night that could only be solved by disconnecting an ultrasonic sensor from pin A0.  So, we’re avoiding pin A0 altogether for now.

The wheel encoders we found didn’t fit at all. The hole was too small, so students used a soldering iron to melt the rubber bushing to enlarge the hole. They then used a little superglue to affix the encoders to the really short shaft sticking out of the motors. Maybe next year we’ll be able to find some encoders that actually fit, but these seem to work for now.


The steering servo works well. If you buy one from ServoCity they offer to assemble the servo for an additional $30. I highly recommend you take them up on this. It’s not just putting the gear box together. It includes taking apart the servo itself and doing some modifications involving soldering and cutting a bit off a gear. I’ve bought two of these over the three years. This year we paid the $30. Totally worth it!


Our code is still being written. It will all end up in this Google Drive Folder when we’re done.

Playing with Programming

I’m teaching AP Computer Science Principles this year following along with the CS50 AP from Harvard. I like it, but this curriculum is way too heavy on the coding end to really match the intent of APCSP.

My plan next year is to mix and match Code.org’s material with ideas from CS50, but instead of C we’ll use JavaScript. With this in mind I’ve been playing with p5.js. I like it a lot for two very important reasons. First it gets students to graphics right away. It’s a lot easier to get student excited about code when they can create cool pictures on the screen than it is when all the do is print text.

The other thing I really like about JavaScript is students can run their code on pretty much any device with a modern web browser. As an example, check out the sketch below. I created after watching a cool video by Dan Shiffman. I made this in Openprocessing, a cloud editor for p5.js. If you’re interested, Wikipedia has a great explanation of the math involved in my program.

Paper Circuits

I’ve been teaching a semester long electronics class every semester since I started teaching in 2000. It started as a basic circuits course, but several years ago I started teaching it with the Arduino micro-controller platform. It has undergone several transformations over the years and I’m changing it yet again this semester.

We’re starting with some basic circuit fundamentals. In the past I assumed they would learn these fundamentals as we worked with Arduino. It turns out I was wrong. One of the circuit building things we did this week involved making paper circuits. This worked out really well and gave students a chance to discover differences between series and parallel circuits. They also got to do some trouble shooting to figure out closed, open, and short circuits.

All in all it was a fun project to help set the tone for the semester while also giving us an activity we can refer back to as we move forward.

Parallel Paper Circuit

Recommended resources:

Conductivity Meter for Chemistry Class

We have a new chemistry teacher this year. At his old school he used these conductivity meters from Flinn Scientific. He said they work really well. He had students use them to make qualitative comparisons of the conductivity of different solutions. The only problem I saw was their price tag. They are $22 ea. This is not horrible, but there really isn’t much to them. So I decided to see if I could make them cheaper.

Turns out it was pretty easy to source the components to place the cost at no more than $1.50 ea. So, for the price of one of Flinn’s meters I can make a classroom set.

I created a set of instructions for making your own:  Conductivity Meter Tutorial (PDF)

I used Plasq’s ComicLife to create this. I’d forgotten how much I enjoy using this for making tutorials.

Parts:

Cheap sensor help students answer real questions

I gave a presentation a couple months ago at the Spring meeting of the Michigan section of the American Association of Physics Teachers highlighting a project a pair of my electronics students did last school year. My students used an Arduino to read a 250g accelerometer to investigate the force a brain might feel in a violent football tackle.

From an Arduino point of view it was a trivial program. However, it was still a cool project for a variety of reasons. There were many opportunities for problem solving. They had to figure out how to embed the sensor in a meangingfull way, mount the helmet, and simulate a rough tackle. First task was determining how to mount the sensor. They asked if they could 3D print a head. This seemed reasonable to me, but I wasn’t sure if they’d have to design it or if we could find one. The head of Stephen Colbert was readily available and made us laugh, so that’s the one we printed after modifying it to accommodate the sensor. In retrospect this was not the best head to print as Colbert’s hair when 3D printed doesn’t squish the way real hair would. For this project it worked out fine, but for a side impact would not be ideal.

3D Printed Stephen Colbert in Helmet
I really like this project because it gave students a chance to investigate something of interest to them that is also very topical. As football players, this was of direct interest to them and something with wider potential impact as well. When they finished it I immediately wanted to share this project with other physics teachers. It would be cool to see other teachers working with their own students to do similar projects. However, whenever I try to show teachers how to use Arduinos to collect data, their eyes start glaze over as soon as the code hits the screen.

I decided to attempt to meet my physics colleagues where they are rather than where I am. Most of the physics teachers I know have access to either Vernier or Pasco interfaces and sensors. At our school we have Vernier, so that’s what I used. I assume you could do something very similar with Pasco equipment.  Vernier sells a cable you can use to make your own analog probeware. It turns out this was very easy to attach to our $30 accelerometer.

img_0322.jpg

The Black Wire goes to GND, the Orange Wire is +5V so goes to the VCC, and the Red Wire attaches to OUT. The other wires were not used. All you need to do is solder these three wires to the sensor and plug it into a LabQuest or LabPro. This is something pretty much anybody can do. However, if you’ve never soldered before I recommend this tutorial from SparkFun Electronics.

The 250g Accelerometer we used is an analog sensor. This makes it easy to interface with Vernier hardware. Nerd Alert: If you need to know, basically we are using it as a voltage comparator. On the LabQuest (or LabPro) we set up our sensor to read Raw Voltage (0 – 5V). For our sensor, zero volts corresponds to -250g’s, five volts with 250g’s, and at 2.5 V we have zero g’s. In reality the 5 V wire gave me 5.2 V (the USB standard is 5 V but can be up to 5.25 V or as low as 4.4 V), so zero g’s was at 2.6 V and 250 g’s would be 5.2 V. Since the output from this sensor is linear, I used the LoggerPro program to convert the voltage readings to g’s by creating a “New Calculated Column”. I ended up with a slope of (500 g’s)/(5.2 V) and a y-intercept of -250 g’s.

Screen Shot 2016-07-28 at 8.36.54 PM

The graph of my calculated column resulted in a graph of force vs. time. In the example graph below, the hit lasted for about 0.003 s and reached a peak of just over 63 g’s. Based on readings from the literature, a hit of this magnitude and duration would be unlikely to cause a concussion.

Football graph

With the growth of the Maker Movement there are now a lot of cheap sensors out there that can be interfaced in exactly the same way. Adafruit makes a 200g 3-axis accelerometer that looks promising, but you’d need 3 Vernier cables to read all thee axises simultaneously (also true with Vernier’s 3-Axis Accelerometer).  I’ve also been thinking about using some flexiforce pressure sensors to measure the force/area actually applied to the head in a collision. This would be a simple modification of this lesson on the Vernier site.

Iteration and Re-mixing with 3D printing

Just over a year ago I made a physics apparatus to help students develop a good mathematical model of acceleration. The idea wasn’t original to me, I just made it easy to make via 3d printing. My design works really well, but I wasn’t really satisfied with it. It consisted of a ring with two cones glued to the center of both sides. The side of the disk facing down always needed some clean-up prior to gluing. I let redesign ideas percolate in my brain to see if I could come up with something better. Then a couple months ago I saw a cool spinning top on the Thingiverse.

cd top

The two halves screw together and are sized perfectly to fit a CD. The instant I saw this I immediately knew I could do the same thing for my acceleration apparatus. All I needed to do was combine my idea with the nut-bolt bits from the top.

For me the ability to easily share, iterate, and re-mix existing designs  is where the power of 3D printing really hits its stride. I don’t have the CAD skills to make working screw threads and even if I did I wouldn’t have hit on using a CD as the disk. Since Gwo-Shyong Yan shared his design on the Thingiverse with a Creative Commons License I was able to not only find inspiration, but I could also build directly on his work.

After the inspiration came the iteration. Overall, I printed at least seven different versions before I was satisfied. I was trying to balance printability, usability, and overall appearance. When I was done I was pretty happy with the final design.

Of course, since I completed my original design more than a year ago I’ve already printed a full set of my old apparatus for the physics teacher in my school, so I really have no need of a new design. So, why did I spend several hours on this project?

There are really multiple reasons that all play into why I spent a Saturday working on this. I wanted to create a thing that other teachers could use with their students. I also wanted to add back to the community of Makers so that someone else might find inspiration to create something cool. But really I did this just to see if I could. I did it for the sheer joy of making a thing. That others might find this useful or interesting was really secondary. This makes me wonder, how do we engage our students to embark on things like this? How do we get them interested enough in doing a thing that they are forced to learn the bits they need to get it done? If you have any insights into this, or really any thing else please share them with me in the comments or via twitter (@falconphysics).

If you’re interested, you can find my final design on Thingiverse. You can also find links to my Tinkercad projects there in case you want to modify my designs.

Learning with OpenSCAD

I’m currently teaching a class to pilot AP Computer Science Principles (will be AP for the first time in the 2016-17 school year). At the beginning of the second semester I decided to deviate from my planned curriculum and drop in a little 3D printing. I had students play with OpenSCAD. OpenSCAD is used to create 3D models with programming rather than more traditional means.
 OpenSCAD is really cool for a number of reasons. If students have any experience with writing code they can dive right in. They quickly realize there are many different ways to create the same part, just as there are always multiple ways to get any program to do what you want it to. Most of these ways will involve thinking in 3-dimensional coordinates while also thinking about positive and negative space. Depending on the chosen approach students may also need to bring in a variety of mathematical knowledge and skills they’ve developed over the years.

The task I gave my students was to develop a stand/holder for their own cell phones. It took them a bit to settle into this idea. I kept getting questions like, “Do I need to plan for a case?” To which I’d reply, “I don’t know, does you phone have a case?” I really wanted them to plan for a holder for their own phone.

In the future I’ll need to put some limits on their designs. Most designs were much bigger than they needed to be, many would easily hold an iPad. Maybe I’ll put a limit on the mass of plastic they could consume. I also need to make sure their design will fit the printer. I had one that would not.

After printing their stands they all realized there were problems with their designs, things that were not obvious before they tried using the physical objects. This was a great lesson and gave us a chance to talk about rapid prototyping and iteration. Each student shared their first designs with the class so everyone could learn from each other’s mistakes. The designs were then updated to fix the problems. In the redesign I also had students add in variables for phone size. This would then allow the program to be used to make a holder for any phone by simply changing the values of the variables for phone height, width, and thickness.

Overall I really liked this assignment. Students got to use their programming knowledge in a new way with a new language. I personally delivered no instruction in OpenSCAD. Students had to rely on the principles of computer science they’d already learned, tutorials found on the net, and each other, just as they would in the real world. The task was simple enough that I knew this would not be a problem. I will be doing this again as a planned part of the curriculum next year, but I’ll add in design constraints related to size and total cost of materials.

Arduino RC Car Part 2

Tony DiLaura asked me about tutorials for high school students to build Arduino controlled RC cars. I didn’t really know of any that I liked so I started outlining what one might look like. This is part two, you might want to check out part one first. This post will be about control mechanisms.

In my last post I said my students had never made remote controlled cars. It turns out this was not at all correct. I’m getting too old and the memory begins to fade. It’s a good thing the internet never forgets. In this post I’ll share some that my students have made in the past. In the next post I’ll dive into ones I’ve seen on the net but haven’t tried yet.

Wiichuck

WiiChuck carOK, this one isn’t radio controlled, but wired instead. It uses the Wii Nunchuck to control your circuit. I suppose if you have a wireless nunchuck you could also make this wireless. If you have to buy a nunchuck this might not be the cheapest option, but I bet one of your students has one at home in a closet somewhere. You can chop the end of the Wiimote plug or you can buy a cheap adapter

  • SparkFun $1.56 – Cheapest and I’ve used this one in the past
  • Adafruit $3.00 – Might be a better option. Looks like it’s designed to snap in and stay in a bit better.
  • WiiChuck Page – All about using a WiiChuck with Arduino including a library download
  • Lego – Lego Electronic GizmO – Lego robot controlled by Arduino and Wiichuck created by my students several years ago. Includes some sample code. Uses the joystick because the accelerometer was a bit too twitchy for them. That could have been solved with programming.

TV Remote

zwally-IR RobotWe’ve also had luck controlling Arduino robots with old TV or VCR remotes. Be aware that some work far better for this than others. The only way to know is to experiment. This is really in the same price range as the Wiichuck solution and makes your car wireless as long as you have line of sight. In theory, you could also create your own remote using a second Arduino and IR LED, but I’ve never done this.

Keyfob

rf receiverI’ve also had students use a keyfob transmitter and receiver. This uses RF and is probably the simplest from a programming standpoint. If your students can program an Arduino to respond to a button press then they know everything they need to to make this work. I don’t have any links to the modules my students used. I can’t remember where I bought them from. Which is probably just as well, they worked, but were not great. However, I did find virtually the same thing on Adafruit’s website. I trust Adafruit to have good stuff.

 

Tutorial for an Arduino RC Car?

A buddy of mine recently sent me a tweet:

RC Arduino Tweet

This is an interesting question the short answer I have is, “No.” The longer answer is a bit more nuanced, so I asked for a little clarification. This is what I got back:

RC Arduino 2

Now I had a lot more to go on. With this in mind I have something to sink my teeth into. Now we have something, so now my response is, “No, I haven’t seen anything that would fit.”

OK, now that that’s out of the way lets cover how I would tackle this problem. Tony is an awesome math teacher in Zeeland, Michigan. He co-teaches a project based math/physics class. I’m going to work from the assumption that he’s working with students starting with little previous knowledge of electronics and Arduino programming, and that he’d like to leave as much room as possible for students to explore. Everything I cover will be with that in mind.

With a project like this you need break it up into pieces. I’m going to think of this as a robot even though it won’t be autonomous because we still will have a computer controlling an independently moving device. As with any robot type project you have three fundamental challenges, the programming, the electronics, and the mechanics. However, with this project we’ll need to consider a forth part I don’t usually think about with a robot, and that is the control mechanism.

Mechanics

You could go crazy with this and start with a platform like Tuggy from the very cool OpenRC Project. While totally awesome I think this takes all of the thinking away from the students and simply turns them into mechanics. Which is fine if that’s your goal. Instead I’d start with ThinkFun’s MakerStudio collection of building sets.

macaroni box car

You can buy sets or download and print from the Thingiverse. I’d start by having students play with the gears and such and make simple cars with parts available, then begin thinking about what their RC car needs. They’ll need to make a variety of decisions. How will their cars be steered? Will they use skid steering (like a tank) or rack and pinion (like a car)? What sort of  platform will they need? I’m not sure a Mac & Cheese box is the best choice. How many motors will they need? Will they use gearbox motors or simple DC motors and then use the gears in the set? Some of these decisions might be made by the teacher and some or all might be left out the students. I’d probably go with simple DC motors and use the gears from the set.

Once these decisions have been made students can then think about the parts in the MakerStudio kits they don’t have but need. Things like motor mounts, rack and pinion mechanisms, bits to mount the gears to the platform of choice, and such. These could should all be designed and 3D printed by the students.

Electronics

Tony asked for Arduino, so we’ll stick with that. It also doesn’t hurt that I know a lot about using Arduinos with high school students. Unfortunately, you can’t run any sort of reasonable motor directly from an Arduino. You need some sort of transistor or h-bridge. Digital outputs on your Arduino only put out 40 mA, this is woefully inadequate to power a motor.


Students can wire an h-bridge themselves, but I highly recommend using a motor shield. I’ve had many students use an h-bridge and breadboard their circuit which mostly works. There are a lot of connections that need to be made and by the time students got to soldering stuff together numerous problems would typically crop up. In order to get around a lot of headaches I now have students use motor shields and skip all the complex wiring. You can buy shields from China really cheaply, but I like to use SparkFun Electronics. SparkFun is based out of Colorado and they offer an educator discount of 20% and allow you to easily set up payment accounts allowing you to pay via purchase order. The other thing I really like about SparkFun is that they include code example and/or tutorials for almost everything they sell. So I can hand a shield to a student and then point them to the product page and step back.

Most motor shields will allow you to control two motors, perfect for skid steering. If your students chose to go with rack and pinion then you can get away with one drive motor, but you’ll need a servo-motor for steering. There are lots of tutorials for controlling servos with Arduino and ideally where ever you get your motor shield will tell you how to wire your motors to it and give you a simple program to control your motor(s).

Other Stuff

At this point we just have programming and control mechanism left. I have some ideas about control mechanisms, but I haven’t done any of these in the past. When I say “I” that really means my students. So, I’m going to do a little more research and then another post. More than likely I’ll be looking at some sort of the cool BlueTooth module and an app running on a cellphone or tablet. There are other ways, but controlling a robot with your phone is just too cool.

Working with Cub Scouts

Last night the Divine Child High School Robotics club gave a short presentation to Cub Scout troop 1127. The presentation covered their participation in the Square One Autonomous Innovative Vehicle Design Challenge. Last year was our first year and it was so much fun we decided to do it again. The competition involves transforming a power wheels jeep into an autonomous car. The club members also showed off our new Polar3D printer.

After the presentation the club led the scouts through building bristle-bots. We’ve done this with middle school students in the past and we’re happy it was just as big a hit with younger students.