posts tagged with the keyword ‘arduino’

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!

2016.05.16

Teensy LC BOB v1.3

Good News, Everyone! The new Teensy LC break-out board is ready! Yes, we’re now at version 1.3 of the Teensy LC BOB.

Preview

I’ve made a few changes since version 1.2. I moved the traces from the top to the bottom (how did I miss that!?) and I added an extra ground line so that you can connect a bunch of screw terminals to the ground row even if you don’t solder in header pins at the end of the board and only do the sides. (This also comes in handy if using the Teensy Audio Adaptor Board.)

I’ve also lengthened the board a bit, and added a fifth hole, and here’s why…

Installed

For a recent project I discovered that the USB cable was able to rip the USB connector right off the Teensy if hit, twisted, or yanked in the wrong direction. The fifth hole is for adding a piece (wood? plastic?) by screwing it into the bottom and then looping a zip tie around the USB cable for strain relief.

USB mock-up

I scanned in a Micro USB cable and placed it over an image of the board to figure out spacing. It should work. I may end up 3D modeling the piece that holds the USB cable in place.

As I use the boards more I may find other improvements along the way. Also, I’m now able to load in custom images and graphics onto the PCB, so I’m already scheming for my next OSH Park project.

2016.05.15

Arts+Tech Night

I mentioned back in February that I’ve been teaching a Physical Computing class at UWM called “Electronics and Sculpture” this semester. So I’ve basically been showing students how to integrate microcontrollers into their artwork. (Arduino is the order of the day, though I’ve got one student exploring ATtiny85 chips.)

Students have been working on their final projects, using techniques they’ve learned all semester, and they’ll have their work on display for the public at Arts+Tech Night happening 6pm-9pm, Wednesday, May 18th, 2016. Come on down and check it out. Most of my students will be on the 4th floor in the center area. (Maybe your friends are already going!)

mike-light

(There is a web site for ATN but sadly, despite my best efforts, It has not been updated this time around.)

« Older Entries |


buy the button:

Buy The Button