Lasers bouncing inside stuff

I’ve written before about how I sometimes like to imagine what would happen if you shot a laser in a fully mirrored room. Back then I did a bunch of cool stuff with flat walls, mostly by calculating the distance beyond the wall a bouncing ball was and having a potential energy function that brought the ball back. Recently I’ve been trying to figure out how to do that in much more complex shapes so I’ve been playing around with Mathematica’s “Region” capabilities. It took me a while, but I think I finally have a decent version with arbitrary shapes.

For those that don’t want to read any more, here’s a laser bouncing around inside a cow:

perfect (non-diffracting) laser beam bouncing around inside a cow

perfect (non-diffracting) laser beam bouncing around inside a cow

I was hoping that there would be an easy function like “normal to surface” or something but I couldn’t find anything close enough. There is a nice “RegionDistance” function that tells you how far from a region (a cow) you are. Unfortunately I couldn’t use that as my potential energy because to do the differential equation solving I need to be able to take a derivative of that (that’s what gives you the forces and hence the acceleration of the ball) and Mathematica didn’t really like that (I don’t blame it, it’s not really a differentiable function).

So then I started playing around with “RegionNearest” which tells you what part of a region is closest to your current position (ie the position of the ball). With that, here’s what I do:

  1. Define the region (cow=ExampleData[{“Example3D”, “Cow”}, “MeshRegion”])
  2. Find the boundary of the region (BoundaryRegion[cow])
  3. Launch the laser/ball
  4. Constantly check to see if the position is within some small distance of the boundary
  5. If it is, find the nearest point on the boundary and use that to determine the normal to the boundary (current point minus the boundary point).
  6. Use the normal vector to reflect the velocity vector
  7. repeat 4-7 until your computer crashes.

What’s really handy is the “WhenEvent” feature of Mathematica’s differential equation solver “NDSolve.” WhenEvent basically does part 4 above and triggers the function for 5 and 6. It’s so useful that I use it for this situation that isn’t really a differential equation. Basically I just say the force is zero everywhere and add the WhenEvent feature to do the reflections. It works great!

I should note that I started this project wondering what happens in a sphere. But it turns out that it’s super boring:

Then I went on to an ellipsoid, but that was pretty boring too. So, I went with the cow (my sons helped pick that). When my son saw the one above, he was really interested in what happens when it goes down a leg. Here you go:

going down the leg

going down the leg

Cool, huh?

Thoughts? Here are some starters for you:

  1. I’m in this class and … wait … nevermind
  2. This is cool. I especially like . . .
  3. This is dumb, you forgot about . . .
  4. You should try this shape . . .
  5. Why didn’t you use python to do this?
  6. How do you do the vector math with the normal vector and the velocity vector to do the reflection?
  7. What if the cow moves?
  8. Wait, I thought you were in the dean’s office now. Why are you still doing this cool stuff, aren’t you just a stuffed suit?
  9. Why do you only sometimes italicize the word Mathematica?
Posted in fun, mathematica, physics | 3 Comments

Non-majors teaching tools

This January I’m teaching a 4-wk intensive course called “Hamline Mythbusters”. On the first day of class I verified my assumption: this would be the last science class ever taken by nearly the whole class. They’re almost entirely seniors (the class filled in 10 minutes on the first day of registration) and they’re using this class to fulfill our disciplinary breadth requirement. I’ve been doing a few fun things in this course and I just wanted to get a few of them down here.

Estimation day

On estimation days the students work in groups to determine things like “how many piano tuners work in the twin cities?” or “how many gallons of gas are used in the US every year?” My grading scale is determined by:

\text{score}=100-10 \left|\log_3\left(\frac{x}{\text{actual}}\right)\right|

which is the same as saying a letter grade off for every factor of 3 you are off from the actual answer.

We’ve only had one of these days so far (the gas question) and I was really pleased with the result. Out of the 11 teams, only 2 were more than a factor of 3 off and both of those were due to a simple mistake where they multiplied by average gas mileage instead of dividing. It took the slowest team an hour so next time (tomorrow) I’m going to do multiple ones so that the groups can divide and conquer.

The connection to science is just developing a good number sense and to realize that they know a lot more than they think they know. By the way, I put a box at the front of the room so that they couldn’t just google all the answers:


Debate day

The day before debate day (actually on Friday to prep for Monday) they are told to bring in 2 pro and 2 con sources for debate day. On our first debate day we did “The US should use nuclear power for it’s dominant source of energy.”

In class they broke into the pro and con teams (randomly) and were tasked with finding 5 main topics and to break into groups to develop good quotes from their sources about their topic. Each group in the main debate was responsible for presenting one new idea and rebutting one idea from the other side. The debate ran: pro new idea, con rebuttal, con new idea, pro rebuttal repeat.

I mostly enforced the rule that when they presented they had to basically just read from their sources. This really worked well! My only complaint is that they didn’t really attack each others’ sources’ authenticity.

I graded the efforts with 50% of the points for turning in their annotated sources (making clear which quotes they used) and 50% based on a reflection paragraph on who won and how the authenticity of the sources affected the debate (the consensus was that it didn’t).

What If blog post

I told them to familiarize themselves with Randall Monroe’s What If blog and to prepare a blog post of their choosing. I’ve graded the first drafts so far and they’re all doing some pretty interesting things, ranging from picking on Trump through ice in place of sidewalks to having all cats disappear. I’m encouraging them to really take things to as many new levels as they can. They’ve got some work to do on future drafts, including drawing some funny/ironic cartoons, but I’m really excited about where this is going.

10 100 word assignment

Borrowing again from Randall Monroe, I’m asking them to submit an explanation of a scientific or technical things using the 10 100 most used words in the English language. That’s what they’re doing peer editing on as I type this post.

We talked about the analogy between a scientist needing to change her vocabulary when talking with the general public and them having to do this assignment. We talked about possibly allowing a glossary where they could introduce new words that must be defined using the 10 100 words.

Lateral thinking

Lateral thinking puzzles are those party games where you lay out a situation and the audience has to ask yes/no questions to determine the whole story. Here’s an easy one: 5 pieces of coal, a carrot, and a scarf and found on a lawn. There’s a logical reason why they’re there, what is it? The answer is that a snowman melted.

I’m using them sparingly (ok, I did 3 of them today) because I think they are good practice for the questions they need to ask themselves during their mythbusting explorations. To do well at lateral thinking puzzles you have to constantly question your assumptions and double check what you think you know. Sound familiar? I think it’s quite similar to the traits of good scientists!

Ok, that’s all I’ve got for now. It’s a fun class, though the grading is killing me. Do you have any thoughts? Here are some starters for you:

  • I’m in this class and I really love ____ and here’s why.
  • I’m in this class and I really hate ____ and here’s why.
  • Why don’t you say the 1000 most used words instead of ten hundred?
  • What rubric do you use for assessing these writing assignments?
  • Wait, where’s the Mathematica assignmen? (that’s for Rhett as long-time readers will recognize)
  • What if they make a different assumption during the estimation day than your google search that provides the so-called “actual number?”
  • I think lateral thinking is not a good analogy for problem solving and here’s why. Instead you should ____.
  • How much is Monroe paying you? (He probably doesn’t actually like me very much.)
  • I hear you’re moving into the Dean’s office. Are you just mailing this course in?
Posted in syllabus creation, teaching, Uncategorized | 2 Comments

Physics majors practice presentations

For years we’ve been working to give our physics majors opportunities to improve their presentation skills. We do a lot of oral exams but we also want our students to do well in more formal settings. We have a junior/senior seminar that the students take for 4 semesters, and they have to present in three of them. For their first one (fall of their junior year typically) we don’t want them to stress out over physics content so, assuming they don’t have a research project to report on, we tell them to give us a short presentation on a general physics concept that they understand well. This post is my thinking on how to improve that.

Typically students pick something like a projectile problem and they present it kind of like a mix between an oral exam and a mock teaching situation. The former is weird because it’s usually a really easy problem (for juniors) and the latter is problematic because that kind of presentation tends not to be how we’d choose to teach the material (no interactivity, for example). Normally we end with some token physics criticism/question but them concentrate on suggestions for how they could present better.

My biggest problem with this setup is how fake it is. It’s not the type of presentation they’ll likely be giving in the future. Then they’d much more likely be talking about a data-driven decision or conclusion they’ve reached. They likely wouldn’t be defending their understanding of a simple concept and they certainly shouldn’t be teaching like that (mostly dark room, only one person talking, etc).

So my current idea is to have them still have a pretty safe and easy thing to prepare but to have it be much more in the spirit of the types of presentations we’d like to see from them. I thought it might be cool if they could present their data from a lab they’ve already done. It might be a simple lab from general physics or something, so likely none of us would be surprised by the outcome, but they could be asked to approach it as trying to convince someone of the conclusions they’ve drawn. We could then really help them focus on what aspects of the presentation need focus (well done data plots, clear explanation of any theory necessary, etc). We still might make minor physics criticisms or questions but we could focus on the presentation skills we really care about.

I figure we could ask students in their first one or two physics classes to pick the lab write up they are most proud of and we could keep it for them to hand back when their juniors. We could do that early in the semester so they could have time to get their presentations ready.

Your thoughts? Here are some starters for you:

  • I’m in this class and I like this plan a lot, here’s why . . .
  • I’m in this class and this is a stupid plan, here’s why . . .
  • Why not force them to do an actual experiment? You act like it’s only worth 0.5 credits or something.
  • Would this work for the labs that are more along the lines of verification labs (“yep, I get 9.8 m/s/s”)?
  • Why have them pick their best one? Maybe the lab instructor should pick it
  • Maybe you could make sure that no two students do the same lab. Here’s how I’d set that up . . .
  • I like presentations based on ________ better, here’s why . . .
Posted in syllabus creation, teaching | 5 Comments

Wasted 10 minute quiz

These days I do a daily quiz for my students. It’s a problem randomly selected from the three problems assigned last time (unless it’s a review day, then it’s randomly selected from the previous 2 days). These are typically deep, rich problems so the only way you could do them in 10 minutes is to have really worked on them ahead of time. I usually add some twists or turn them inside out but, basically, if they’ve worked on them and really understood the material they should be doable. The problem is there’s a noticeable minority of students who do very poorly on these quizzes. They get bad scores (1’s or 2’s on my 4-point scale) and spend a large amount of the 10 minutes just sitting there with a defeated look on their face. So I’m trying to brainstorm other approaches and would love it if you, kind reader, could chime in.

Learn their lesson

Option one is just do nothing and hope that they learn their lesson eventually. Perhaps enough 1’s and 2’s will get them to realize they really should work harder (or perhaps differently) on these problems.

Because I use a Standards-Based Grading approach they know they can repair their grade by turning something in later so there’s not a lot of pressure to perform in class. Of course many of these students pile up a lot of 1’s and 2’s and tend to fall far enough behind that my two week rule gets them in trouble.

I guess what I’m feeling right now (facing the prospect of (once again) turning in lots of F’s for midterm grades) is that the lessons aren’t being learned.

Remind them to ask for help

I could remind them that since the quiz grade doesn’t set in stone that standard’s score, if they feel like they’re likely to get a 1 or a 2 they could try to explain on their quiz what they’re struggling with. When this happens now, admittedly rarely, I tend to either give that person some feedback on their quiz paper, send them a video, or send the whole class a video with some explanation. I think in the smaller classes that I could handle this scaling up a little and I think I’d understand better where the students are at than grading a crappy quiz performance.

I think if I didn’t stay on top of it and continue to give personalized feedback, students would likely stop writing a whole lot and instead continue to use their 10 minutes in class to do other things (with a defeated look on their face).

Show them something else

I was brainstorming with a student who’s in class with me right now about what would work better for him on days when he doesn’t really know how to start the quiz. I asked him about the notion laid out above and he thought that seemed reasonable. Then we started to brainstorm this new notion. Maybe I could give students a choice: either take the quiz or come with me to another room where I’d do some additional instruction on the topic. Maybe that could just be me trying to articulate every thought in my head as I try to do the quiz.

I’m definitely attracted to this if only to avoid looking out and seeing defeated faces. On the down side I feel like this sort of direct instruction 1) makes the students feel like they’re learning, but 2) doesn’t really help their learning. It reminds me of the students who say “I own the solution manual but I don’t use it to do my homework. Instead I love to study from it much more than struggling over any suggested exercises.” I’ve never actually believed students when they say that (not the first part, the second part). I think they look at well solved problems and dutifully nod their heads saying “oh yeah . . . of course . . . yep that’s right” instead of what we want our students to be thinking: “hmmm … not sure… oh wait  … let me try … ooh, now I know!”

I’m also not sure if students would tend to make the right choice (for them) when offered to either take the quiz or come with me. I guess I’m not sure what to think.

Your thoughts? Here are some starters for you:

  • What does “turn them inside out” mean?
  • I like the _____ option but not the ____ option because . . .
  • Why do you do quizzes at all? Instead you should . . .
  • I’m in this class and this post is great because . . .
  • I’m in this class and I hate this post because . . .
  • Wait, how do they use Mathematica during their quizzes?
  • I study from worked examples all the time. Why are you criticizing me?
  • That’s not what I think should be going through students heads when working problems. Instead I’d like to see  . . .
Posted in syllabus creation, teaching, Uncategorized | 11 Comments

Interactive arduino internet-of-things

I’ve written before about my Math and Computational Methods for Physicist course and how we’re doing a cool Arduino-based Internet of Things project. I’ve been brainstorming some new things we might do with that project and I wanted to see if you, dear reader, might have some suggestions/observations/complaints/whatever.

First an update on the database and our prototype. I haven’t added much to the database. Really only a dashboard list for the admin (me) showing the total number of measurements for each machine and when the last measurement was. It turns out that even though I fixed the pretty common wifi freeze with the watchdog approach, it still goes down about twice a week. I’m not really sure what’s up with that. The most recent time it happened I didn’t notice for about a day so when I went to look at it I noticed it was pretty hot. Unplugging it for 10 seconds or so and then replugging it seems to have fixed it for now. Any thoughts on how I can figure out what causes those very intermittent problems would be greatly appreciated. The class has devoted one lab to Arduinos so far and they all got to the point where they were measuring and calibrating temperature and controlling an LED. Pretty good for 90 minutes. We meet again about it this coming week when I’m hoping they’ve all found a “client” that they can program the arduino for.

Using a clock

The first new idea is to deal with client requests that are time-based. Something like “every night at midnight check the XXXX and report” as opposed to what we already have: “every Y minutes do something.” The arduino has a millisecond timer on it, but you can’t trust it to know in absolute terms what time it is. So at first I thought we couldn’t handle those requests. But then I remembered that we have a working wifi card on all of these! I figure we can just have it check the absolute time on some time server somewhere and at most be off by Y minutes. That’ll likely satisfy those sorts of clients (at least I hope so).


Already a few potential clients have asked for things like “every time the door opens measure XXX and report.” If they can handle a resolution of Y minutes, then we’re all set. Otherwise we’ll have to use the built-in interrupt stuff for arduinos. Then if the door opens an interrupt will be thrown and we’ll execute the whole “measure XXX and hook up to the internet” code.

Make a measurement if we say so

This is the one that I would really like some advice on. Some students and I were brainstorming how we might communicate to the arduino to make a measurement. Really this would be an extension of the “using a clock” idea above. We’re thinking of updating the database web site so that the owner of the machine (which is currently defined as the person who most recently updated the code for that machine) could update a page with something like “yes” or “no” returned so that the machine would check that page first (every Y minutes, say) before deciding whether to do anything else. We could, of course, get more complicated with various messages triggering lots of different responses from the machine. The limit would be the storage on the arduino (20 totally different codes stored might not be possible, for example) but I think we can still do some cool stuff.

I guess my question is: is this the right way to go about it? I read a lot about making the arduino basically a web page server so that you can go to it and ask for things. That’s the bulk of the pages you get if you search for “arduino internet of things” so I know it’s pretty popular. My problem is that it seems like it’s asking the arduino to do quite a lot, and essentially be fully on (as opposed to a boring “pause” loop) all the time. I figure this approach saves a lot of that, but maybe I’m missing something.

So, we’d love your help. If you have any ideas/hare-brained-schemes/concerns/anecdotes/love-letters-to-mathematica let us know in the comments below. Here are some starters for you:

  • I’m in this class and I’m really excited about this project. What Andy forgot to add was . . .
  • I’m in this class and I hate it. What I’d love is if someone made it clear to Andy that this is a dumb project so we don’t have to do it.
  • I’m in the HUWebApps group that Andy talked about here and I think this could be some fun work for us. One thought I had was . . .
  • I think these new ideas are really cool. One thing I’d be a little worried about is . . .
  • I think that some of these ideas are really bad, damage-people-for-life bad! Here’s a better way to go about it . . .
  • I’ve done some similar work <snark>thanks for linking to me</snark> and I’d suggest you read this, this, and this.
  • I run my arduino as a web server and it works great! You should really switch because . . .
  • I run my arduino as a web server and it sucks! I’m thinking of switching to how you do it, can I use your database?
Posted in arduino, HUWebApps | 6 Comments

Web apps workgroup

We’ve been thinking a lot lately about finding new ways to give our students more computer programming skills. We don’t have a computer science major but are willing to do certificate/minor-type things that will help students succeed in their chosen major. One thought I had was to introduce students to web programming (scripting with PHP and database backend with MySQL because that’s what I know) but I’m not sure how to pitch that class (and at what level). Instead I thought I might just try to develop a club/group on campus that develops web apps to see where the sweet spot is.

Web vs mobile apps

This article helped me clarify my thoughts about why web and not mobile apps. Honestly, for me, it’s a learning curve thing, since I know how to do web stuff (I’ve written my own LMS, a course schedule web site for my institution, a site for concept tests/quizzes, a jeopardy quiz site, and an Arduino Internet of Things site (which I wrote about in my last post)). Also it seems that you don’t have to make a choice between apple and android if you go with web apps. However, I think we’ll concentrate on things that’ll work well on mobile browsers just to keep that audience in mind. It helps that Twitter Bootstrap is mobile-first.


The hope would be that we could develop something that people need. I wrote about something that I’d like a while ago so maybe we’d just start with that one (it’s a site where students could upload photos that would be added to an ongoing slideshow that would be projected). I’d love it if we could respond to the needs of the community to make things that are useful (and teach students some useful coding skills).


We would use github and trello to keep organized. Github would allow us to has a core of working code along with branches where new features are developed. Github would also let new people join in pretty easily, though a working project might be intimidating to some. At first at least we’d be coding in the Laravel PHP framework. Participants would need a development machine that could run Laravel/php along with mysql. Installing xampp would do the trick, along with composer to easily handle various code dependencies. Once they have those working (really it only takes about 10 minutes to get all that working on a windows machine) they would just pull down the githup repository they’d like to work on and they’re in business. Really the notion of handling code with others using git is a useful skill.

Trello is an awesome way for a group to keep track of what there is to do, who’s doing what, and what’s done. I used it to great effect this summer with my research students (here’s our public list).

Once students have got a cool feature working on their local machines I would just have to merge the repository and pull it down to the development machine (for now it’ll be physics.hamline .edu which is where all the examples above are hosted – eventually I would hope to get something like or something). That way I’d be the only one dealing with the production machine and any headaches that come with getting it working right. I really like how github would help with that (and how students can see the working code on their development machines without having to wait for me to get it up for the whole world).


I think it’ll be fun to work with students who are developing these types of skills. I think I’d be a little hands-off with dictating what we work on and how, but I’d probably stick to Laravel, Test Driven-Development, and mysql. If someone comes along with skills to get other approaches working, then sure! I got all excited about Meteor a few months ago but getting it to work on a server with ease of community-based updates was a big hassle (for me). So Laravel/PHP/MYSQL for us for now. I think that students who really put some effort into this will be able to easily sell their scripting and collaboration skills with some production code to show off.

What’s missing?

So what do you think. This is really just a 2-day-old brainstorm for the moment. I’d love some help moving this project forward. Here are some starters for you:

  • I love this. What I’d add is . . .
  • I hate this. Instead you should . . .
  • PHP?!??!! Why in the world would you expose students to that crappy approach? I’ve never heard of Laravel but I bet it’s a piece of crap built with crap.
  • Why not Django? I suppose you’re too scared to ask your ITS to add yet another module to Apache, huh?
  • Why not Meteor hosted on Galaxy? What are you, cheap?
  • Ooh I’ve got some great ideas for apps. Where would I send them?
  • Ooh I’d love to work on this. When are our meetings?
  • I don’t understand. I love the apps on my (fill in a brand of phone here). Why don’t you just develop more of those?
  • The photo/slideshow app you’re looking for exists. It’s called . . .
  • This sounds like a better class than a club/group. I think it should be called . . .
  • This should never be a class. Keeping it separate from students courses is smart.
Posted in technology | 3 Comments

Arduino internet of things

This summer several colleagues and I had some seed money to brainstorm ways to put more sustainability ideas into our curriculum (physics, chemistry, and math was represented). One of the projects we decided to flesh out is having students develop arduino hardware and software to collect data about our campus that would help with energy management. We followed some online tutorials  though we decided to have the arduino simply send its data to a web page every 5 minutes instead of having it act as a server that you could go to with your browser. The idea is that the arduino will record its probe data every 5 minutes (say), hook up to the internet, and send the data to a simple url like cooldatabasesite/probe1=X&probe2=Y. We did the initial testing with a Wolfram Data Drop but later decided to just make our own database to collect the information. I wanted to write this to get the gist of the project down and to possibly see if our database could be of use to others.


With some more internal funds we now have enough Arduino Uno’s, CC3000 wifi boards, and DHT 22 temperature/humidity probes for my whole class this fall (13 students). The total cost was something like $1200.

Arduino code

I based the code on two examples that come once you download the cc3000 library from Adafruit. The “build test” example checks the functionality of the board, and, importantly for how we wanted use it, sends the MAC address of the board back along the serial line to the computer. Then the “web client” example is what I made slight adjustments to in order to get it to work with our database. Really you’re just having it connect to a simple web page (with a GET request) and then having it read the result and then shut down. There’s a lot of code to help with connecting to the wifi but it’s pretty straightforward. At my institution the main wifi signal uses WPA2-EAP (I think) for security (the kind where you put in a username and password in the wifi configuration on your computer as opposed to the kind where you put your username and password into a browser page) and the cc3000 can’t handle that. I thought we were out of luck but one forum I read suggested seeing if my ITS department would be willing to just store the MAC address of the boards and allow them on the network without all the certification stuff. It turns out they were willing to do that! It’s on the “guest” wifi signal as opposed to the main one but it seems to work great. (Note the comment above about being able to have the arduino print out the MAC address with the initial test).

So you load the cc3000 library, run the “build test,” grab the MAC address, send it to ITS, then run a doctored version of “web client” with the appropriate wifi settings and the correct url for the database (and collecting the appropriate probe data).

One major headache that happened was the arduino would hang every few hours or so. It gets stuck in a loop and won’t do anything. Hitting the reset button fixes it, but that’s a pain for a machine placed somewhere on campus. Luckily there’s a very cool “watchdog” library for arduino that allows you to program the machine to reset if it goes into an infinite loop. Unfortunately the longest you can have it do something before it’s decided that it’s stuck is 8 seconds using the default watchdog approach. That sucks because the whole “connect to the wifi, send the info, parse the result” takes something like 24 seconds. Luckily, I found a very cool work around that allows you to multiply that 8 seconds by any integer you’d like. It uses interrupts on the watchdog and is very slick. Check it out. So now if it hangs in the wifi hookup process, it just resets itself and continues right along. If I look at my data I see usually one or two gaps of 6 minutes instead of 5 minutes between my data points every day. Not too bad.


I wanted to build a pretty flexible database for all this data. I wanted authorized uses to be able to add new machines (register the MAC address), attach probes to it (so the system could make sure that the type of data submitted was of the right sort), and describe the location it’s in. I also wanted to have a place to store the arduino code on the machine so that people could check it to understand any calibration issues. I’ve got nearly everything done:

  • Admin section
    • Approve uses
    • Edit machines (location, attached probes)
    • Add/edit probes (what’s available to be attached to machines)
  • Add machine
    • submit MAC address (right now the format is just decimal without colons but possibly changeable)
    • attach probes
    • put in location
      • short name
      • description
      • GPS coordinate (I haven’t standardized these yet but I think it should be possible)
  • Accept measurements
    • …./measurement?macaddress=XXXX&p[Y]=y&p[Z]=z&…
      • where Y and Z are ids of the probes in the system
  • Display data
    • You see a list of locations
    • Then see a list of available measurements
    • Then see a plotly.js-driven interactive plot of the data
    • below which is a list of downloadable formats
      • json
      • html table
      • excel
      • csv

This was the first time I programmed an application using Test Driven Development and I really liked it. I now have a suite of tests (over 50) that test every aspect of the application. That way if I make a change I’ll know if I’ve screwed something else up. Basically it’s a way to test all your web pages and user-clickable events to make sure they’re all still working. In the old days I’d just make a change, make sure the new thing I was working on was working and only find out days later that I screwed something else up. Very cool.

You can see the working database here.

I’m pretty excited about what we can do with that. We can have machines all over campus submitting data that we can really put to use. I’m also excited because I think I could easily handle other people’s data as well. If you’ve got a wifi-enabled arduino, just register on the site (and maybe send me a message), I can approve you and decide if you should be an admin or what and then you’d have access to your data. Alternatively people could feel free to fork my application and just host it on their own server.

By the way, there’s also a Plotly approach having arduino stream data to a graph if that’s all you’re interested in.


In the old days I’d just make up some dumb thing for my students to work on when learning how to work with an Arduino (make a working stoplight circuit, move a motor at a speed determined by the temperature, etc). What I’m excited about with this project is that they’ll be learning many of the same skills while adding to a larger university-wide project that other people care about. I hope that helps motivate them.

Working with my math colleague has been fun because he has his students deal with data sets in his statistics courses. Now he’s excited to use this data instead with really very little change to the learning outcomes. Again motivating the students to come up with hypotheses that could be tested using our data should be easier with this.

The other thing I’m excited to do in this upcoming class is to encourage the students to engage with community members. My hope is to identify several potential “clients” that they can go talk to and figure out what kind of data they want logged and why. It’s a math methods class for physics majors so maybe they can do some modeling of the system being measured. Not sure about that (though simple heat flow should be pretty easy) but it’s certainly possible.

So I’m pretty excited. Your thoughts? Here are some starters for you:

  • This is great! Something else you could do is . . .
  • This is dumb. Haven’t you seen . . .
  • Why didn’t you post your Arduino code here?! It’s almost as if you’re typing this on a chromebook at home because you left your development computer at work.
  • Wait, let me get this straight: you abandoned a solution based on a Wolfram product? Who are you and what happened to SuperFly?
  • It seems like you’re doing application testing, not unit testing. Did you do any unit testing?
  • What code do you use for the database? (It’s a Laravel/PHP/MySQL stack – I really like coding in the Laravel framework)
  • Why don’t you use a Raspberry Pi for this?
  • Wait, 15 machines every 5 minutes is 3 million data points per year. Can your system handle that and expand beyond it?
  • Could you have a machine take rapid data over a short period and then repeat that daily?
  • Why are you so inconsistent with your capitalization of aRdUiNo?
  • Why are you doing all of this in a math methods class (the actual name is Mathematical and Computational Methods for Physicists)
Posted in arduino, community, lab, technology | 5 Comments