All posts by Steve

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.

LED Color Mixer – Make and Take

Tomorrow, Saturday 10/4/14, is the fall meeting of the Michigan Section of the American Association of Physics Teachers. If you’re interested, it will be at the University of Michigan, Flint. For more information you should check out the meeting page.

Anyway, Jim Gell and I will be running a Make and Take in the afternoon. One of the things we will be doing again is the ever popular LED Color Mixer. We’ve done this before as a modified version of the LED mixer presented by Chris Chiaverina in the Physics Teacher. This is a pretty cheap demo device, but in the past we ordered $1-2 LED, $1 battery holder, $0.50 ping pong ball, and 2 AA batteries. Cost for each one was between $3 and $4. This was a bit costly to run as a Make and Take. It also involved soldering, which while not particularly difficult did require the direct supervision of someone.
We will be doing the same project on Saturday at a cost of less than $0.20/device with no soldering required. This project is cheap enough that you can have participants make one on site and then send them home with a couple extras to make with their classes. They’re so cheap that a teacher could have each of their students make one to take them home and explain how they work to their families.

The parts list:

I should note that while both the batteries and LEDs are sourced from Amazon, the LEDs come from China and will take a few weeks to arrive. While the LEDs are cheaper than we’ve been able to get them in the past the real savings is from the batteries. In order to make things extra cheap I replaced the ping pong ball with a paper cube.
Simply bend the leads on the LED as shown. The shorter of the two leads goes to the negative side of the battery with the longer going to the positive. Use a little electrical tape to hold the leads to the battery. If needed, slip a small strip of overhead transparency in between one lead and the battery to act as an “off switch”.
Print out a copy of the 2.25″ Cube Template and assemble. Before closing the last flap put 1/2 a Kleenex in to help diffuse the light and cut a hole in one side. The simply slip your LED and battery in and bask in the color changing goodness you have created.
How would you use this with your students? Share your thoughts in the comments.

Fun with a 3D Printer – Physics Wind Turbine Project

Almost a year ago I managed to find money to buy a Makerbot Replicator for my classroom. It really is like magic. Most of the year we’ve really just been playing. Printing out cool stuff from the Thingiverse and a few project enclosures for electronics projects.

I’d been wanting to do a cool design project with my physics students, but never really knew what it should be. 3D design is not a skill in the wheelhouse of virtually any of my students (our CAD program died a few years ago). It turns out there is a cool program that lets you create 3D designs programmatically. It’s called OpenSCAD. The beauty of this is that you can create or find a program that generates the 3D design. Then all you need to do is change some of the variables to get a new design.
I decided to give this a try in my physics classroom. We’re in the time of year after the seniors are gone and now the juniors feel like they should be gone as well. I found a cool Mini-Wind Turbine model on the Thingiverse that was created in OpenSCAD. I played with it a bit to figure out exactly what the variables did and then introduced it to the class. Next year I’ll let them figure out what each of the variables does for themselves.
Each of my two physics classes picked two parameters to vary. We ended up with:
  • Length
  • Width
  • Angle – Which was really twist
  • “Fat Point” – Ratio of top length to bottom length
We created 5 different versions varying our on parameter. I let the students decide what they wanted to set the parameters to as long as the blade was not absurd.
Actually we did end up with an absurd blade when it came to twist, but the group that wanted it were convinced it would be the best. So I went ahead with it.
I asked students to graph and find the relationship for each of our four parameters. Unfortunately none of the parameters gave us very good mathematical relationships. I think we might have needed bigger variation in some and more data points in between in another. Next year I may have students fill in some of the gaps.
Once data were analyzed I asked them to design the perfect wind turbine. Some groups relied on their data and some did not. It should really come as no surprise that the groups that relied on the data did the best. Of these most just picked the one best data point in each and put them together. The very best one extrapolated from their data to predict a better solution. It’s nice when things work out the way the should like that.
The best part for me was how surprising our results were. We all had the image of the big majestic wind turbines in our heads. This, however, was not the shape that we found to be the best. The one we found to be the best looked the least like our pre-conceived notion. It had fat stubby wings rather than long and thin.
Some nuts and bolts details:
  • 3D Pinter costs $2000ish
  • Plastic is fairly cheap. If I had to estimate, I used between $10 and $20 worth of plastic on this project.
  • One full set of 15 blades (3 each of five different states) takes between 3 and 4 hours to print. One set all by itself  40 min to an hour. Time varied depending on the design.