posts tagged with the keyword ‘arduino’

2017.09.27

Moxie

A large part of the Power Racing Series is Moxie. Moxie is best described as, being awesome. The crowd gets to vote for your car using the Moxie Board. Each button press equals a vote. Being fast is one way to get points, but another way is by being awesome… so, Moxie.

Above you’ll see a photo of the official Moxie Board used by the series. Since we also had a PPPRS race during Maker Faire Milwaukee, which overlapped the race in New York, we had to build our own Moxie Board, so here’s what we did…

The Moxie Board

It looks fairly similar, but it’s a bit smaller and lighter than the original, and it’s got 24 buttons instead of 30 (though I believe the original was recently expanded to have that 30 buttons. Who knew there’d ever be that many cars in a race!)

I got some Coroplast from Midland Plastics for super cheap, and they didn’t have any wide enough, so the black strip running down the center is gaff tape used to hold two pieces together to be wide enough. I then found some scrap wood in the shop at work which was long enough, but too skinny to be used for anything else, and built a simple frame with some small blocks of HDPE in the corners to hold it all together. (I was told the reduced weight of this Moxie Board was a big plus.)

The front is screwed into the wood frame, and the back is held in place with some VELCRO┬« hook and loop so we could open it to get to the electronics…

As for the inside and the electronics, while the original uses an Arduino Mega with a Bluetooth module to send real-time updates to Patrick’s Android phone which is running some special app, I chose to do it differently.

moxie-board-04

I’m using a Teensy 3.5 which has plenty of input pins and a built-in MicroSD card slot. The way it works is simple, each button represents a number from 1 to 24, and when pressed, the Teensy gets the value of every button, with the ones not being pressed equal to 0 and the one being pressed equal to 1, and then writes it to a file called MOXIE.csv. When the race is over you just put the MicroSD card in a card reader and import the CSV file into a spreadsheet and grab the last row. (Hopefully your spreadsheet is set up with the names of the cars in the corresponding columns.)

In testing, this all worked fine, but obviously the real world had to come along and crush my hopes and dreams…

moxie-board-05

Failure #1: Because the Teensy is a low power device, it doesn’t draw much power from the USB battery pack we were using. I’ve seen this before, so I use a battery pack with a built-in LED “flashlight” that stays on, as long as you press and hold the button when turning it on. I told this to two people, but forgot to write instructions to put inside the Moxie Board, so there’s a chance this was not done properly and power was lost. (There is an indicator LED that lights up when a button is pressed, but not a “POWER ON” LED which would have helped… maybe.

Maybe Failure #2: It could be that my code isn’t quite right. I do not have the most recent code that the official Moxie Board is running, but I have an older version that may be close. My code is a little different, but should yield the same results… I think. This is worth checking on.

I also do not have a good way to attach Moxie Labels, so they are just attached with tape or Hook and Loop for now. Ran out of time for anything better. :/

One more note! In the photo there’s a bunch of green wire and LEDs attached to the front of the Moxie Board. Those were added for the night race. All the actual wiring for the Moxie Board is located on the inside.

moxie-board-03

I’ve heard of one other group working on a Moxie Board that will use a Raspberry Pi, which I thought about doing as well, but ended up choosing a Teensy instead. As we add more races, we’re going to need more boards, so I’m hoping we see more ideas and eventually come up with even better ideas. (Note that I wanted to stay simple because simple gets done while over-complex builds, while fun, don’t always get finished, or work properly. But then, who am I to talk!?)

2017.08.29

Arduino - The First Sketch

The Inventors & Entrepreneurs Club of Kenosha & Racine invited me to give a talk last year but I was busy teaching PCOMP at UWM so I couldn’t make it, but I offered to come during the summer and we scheduled August for me to visit and talk about the Arduino microcontroller.

A few people were familiar with the Arduino, and one or two had even used them before, but for most people this was an introduction. I covered a bit about what the Arduino is, and what it can do, and how you might use it for prototyping a product.

I updated the Presenations page and added the Welcome to Arduino slides, and noticed I hadn’t given any presentations in 2016, but then I remembered that I had a class full of students twice a week during that time and was pretty much presenting constantly. Life is weird sometimes. (And actually I did do some presentations while at UWM, so maybe I’ll dig through those and post them.)

2017.03.09

clicky-machine-01

I started this project with a goal in mind: test microswitches. Specifically, test the brand of microswitch that I chose for an exhibit I worked on last year. When I was younger, my dad used to have a subscription to Consumer Reports and I remember years ago reading about how they tested things, like using a machine that opened and closed laptops repeatedly to see how many times it could be done before it broke or wore out. One of my goals is to do that sort of thing, but with things we build for exhibits. This is a start. (And yes, I’ve considered just buying/building a robot arm to do these things… I may still do that!)

Meanwhile, since I’m 3D printing again (a lot!) I figured I’d design and print the parts for this machine. Not all the parts… some parts are scrap wood, and (in a recent version) home-made recycled HDPE. The first iteration was a total hack job, and it worked. Sort of. I get in this habit of trying to do press-fit parts, but then I remember that’s a bad idea, so… upgrades happen.

clicky-machine-02

The first version used a PLA plastic arm. Eventually it started to scrape and wear away, and squeak a lot. It was annoying. (Bearings got added to a later version, along with a proper set screw.)

clicky-machine-03

One thing I found out about the cheap microswitches is that the metal arm would bend, and then stop pressing the switch. That’s no good (but good to know.) Then I found times when the switch just wouldn’t trigger the Arduino to advance. Switch failure after just a few tens of thousands of presses? Maybe.

clicky-machine-04

I also had Arduino problems! At some point the cheap eBay Arduino UNO clone from China gave up the ghost and just stopped working reliably. Then I could no longer upload code to it or connect to it at all. Replaced that too!

clicky-machine-05

I also played around with the switch angle… as demonstrated in the above and below photos. I also considered a spring-arm sort of thing the switch could ride on to allow some flex, which would be interesting, but probably less of a real-world test. Maybe.

clicky-machine-06

Here’s a video compilation of some of the testing from early on. This is when I actually thought I could just slap something together and it would work reliably. I’ve since been proven very wrong. I’ll be writing more posts about the changes this machine has gone through and where it stands today. In the meanwhile, if you check out my Instagram or Facebook account, I often post in-progress/sneak-peek photos and short videos.

Stay Tuned!

2016.12.08

Colors

One of my PCOMP students wants to randomly select a set of RGB values from a predetermined list. It’s the sort of things where I know the concept is easy but the execution is a bit more difficult only because I’ve done it in other languages/environments, but not in an Arduino sketch.

The nice thing about programming is that once you know how to do something using one language, the concepts transfer over to other languages, and it becomes mostly a matter of figuring out the syntax and method to make it all work.

Here’s an example sketch that allows you to have a list (array) of RGB values and then randomly select one and return it, split the r, g, b into their own integer variables, and then print them to the serial monitor. (The final version will use analogWrite to control RGB LEDs.)

// RandomColor.ino

void setup() {
  Serial.begin(9600);
  randomSeed(analogRead(A0));
}

void loop() {
  char* rgb = returnColors();
  int r, g, b;
  if (sscanf(rgb, "%d,%d,%d", &r, &g, &b) == 3) {
    Serial.print(r);
    Serial.print(", ");
    Serial.print(g);
    Serial.print(", ");
    Serial.println(b);
  }
  delay(500);
}

char* returnColors() {
  char* myColors[6];
  myColors[0] = "128,0,0";
  myColors[1] = "0,128,0";
  myColors[2] = "0,0,128";
  myColors[3] = "255,0,0";
  myColors[4] = "0,255,0";
  myColors[5] = "0,0,255";
  int colorIndex = random(0,6);
  char* result = myColors[colorIndex];
  return (result);
}

Obviously the list can be much larger than just six elements, but this is example code to be expanded upon.

You can also grab this code from github.

Update: Royce has his own version you can check out. He suggests it should be more efficient because the textual RGB values are converted to binary at compile time rather than runtime.

2016.06.05

Mike's Light Sculpture

The Electronics and Sculpture class I taught this semester wrapped up a few weeks ago and my students showed their final projects at Arts+Tech Night in May. I’ve included a few photos in this post, but each student also posted their project online, so check below for more links.

Lionel's Brick

The class was structured around five projects in total, with three being smaller projects focusing on digital input/output, analog sensors controlling 2-3 digital things, and the third using analog input/output. The last two projects were larger, one being the mid-term project and the other being the final project, which was then shown to the public during Arts+Tech Night, and treated as an installation for the event.

Greg's Drumming Machine

The books we used for the course were Make: Electronics: Learning Through Discovery by Charles Platt and Programming Arduino Getting Started with Sketches by Simon Monk. I think the amount of reading was fairly minimal, but needed up front for a lot of the things we did later in the semester.

William's Ugly Box

Much of the first half of the semester was spent going through some of the basics of electrical circuits and getting up to speed with the Arduino, learning how to wire things up, write code, and use libraries. Some students had never written code before, while others had never really built physical things before. Some students were more versed in the digital arts while others were more skilled in creating sculptural things. Students who had access to the DCRL had an advantage due to the tools and equipment they had access to (and the fact that they studied with Frankie.)

Matt's Controller

As part of the class, each student had to post their work on a public web site. Some students had blogs or portfolio sites, and some created new sites. Here’s the list of students and their web sites:

Not every student managed to write up their project, which caused me much sadness, but many did a great job of documenting their work and process.

Alycia's Kiosk

I’ll be teaching Electronics and Sculpture 318 and 418 again in the fall, and it looks like 6 of my 318 students are returning for 418 (the advanced class) so I can’t wait to see what they come up with next time!

« Older Entries | Newer Entries »


buy the button:

Buy The Button