Champaign-Urbana Community Fab Lab
University of Illinois at Urbana-Champaign
Champaign-Urbana Community Fab Lab

Seth Sawant Iteration Assignment

This week’s assignment was to to either build upon a previous week’s project or to start it over from scratch. Because we’re soon starting the final project, I decided this would be the perfect opportunity to combine two projects into one to create a larger more and ambitious design. I also wanted to make something that was functional and something that I think that I think would hard to find commercially, so those things with in mind I brainstormed various ideas. The final project I settled on was creating a temperature display for my apartment, as one of the first pieces of information that I need in the morning is the outside temperature so I can dress accordingly. At the same time, I wanted this to be something I would want to display in my apartment, so the means of displaying the temperature will be a mechanical display similar to that of an odometer or a mechanical counter. For the iteration project portion of this, I tackled just the electronics aspect of the piece, namely the method of acquiring the temperature information and driving a motor based on that data, leaving the mechanical (and more complex) part for my final project.

The DHT22 temperature and humidity sensor I used.

For the backbone of this project, I decided to use Adafruit’s Feather HUZZAH micro controller, which is an Internet of Things focused device with built-in support for low energy Bluetooth, WiFi, and useful power-saving features built in. The chip can be programmed numerous ways; I started by trying to use MicroPython, but got frustrated by the unreliable programming method which involved connecting to the HUZZAH over WiFi and using a web-based terminal to update the code. Instead, I used the Arduino IDE which was less effort but required a little setup by installing some special board packages.

For acquiring the temperature data, I used two methods: one was to use a temperature sensor to get the ambient temperature of the room, and the second was to pull the weather data from the internet to get the outside temperature. The thinking behind this is that for my final design, I want the display to periodically switch between the inside and outside temperature to highlight  the ccool transition between digits that mechanical displays have. For the ambient temperature I used another piece of Adafruit kit, a DHT22 temperature and humidity sensor, which comes with an Arduino library which makes getting readings from the device easy. Although I didn’t use the humidity readings in this project, I’m thinking of adding the ability in the final project to alternate between showing the temperature and the humidity. To get the outside temperature from the internet, I used a weather API called OpenWeather which gives basic weather information for free, and used the Arduino HTTP library to send the API requests. Finally, to display the temperature data to the user I made a simple dial out of cardboard and a servo to act as a stand-in for the final, more complex display. Although the servo worked in this case, I realized that because servos can’t rotate more than one full rotation it probably won’t work for my final design; I’m considering other options like using a stepper motor or a regular DC motor, which can rotate indefinitely in one direction.

 

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <ArduinoJson.h>
#include <Servo.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <DHT_U.h>

#define WIFI_TIMEOUT 5

const char* ssid = "NETWORK_NAME";
const char* password = "NETWORK_PASSWORD";

HTTPClient http; //Declare an object of class HTTPClient

double outside_temp_k = 273.15;
double outside_temp_c = 0;
double outside_temp_f = 32;

double inside_temp_c = 0;

Servo dial;
DHT_Unified dht(14, DHT22);
sensor_t sensor;

void setup () {
dial.attach(2); //attach servo object to pin 2 of the Feather
dial.write(0);
dht.begin();
Serial.begin(115200);
WiFi.begin(ssid, password);

int timeout = 0;
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED && timeout < WIFI_TIMEOUT) {
delay(1000);
Serial.print(".");
timeout++;
}
}

void loop() {
dht.temperature().getSensor(&sensor);
if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status
http.begin("http://api.openweathermap.org/data/2.5/weather?id=4887158&appid=API_KEY"); //Specify request destination
int httpCode = http.GET();
if (httpCode > 0) { //Check the returning code
String payload = http.getString(); //Get the request response payload
DynamicJsonDocument doc(1024);
DeserializationError error = deserializeJson(doc, payload);
if (!error) {
outside_temp_k = doc["main"]["temp"]; // gets the temperature in kelvin
outside_temp_c = outside_temp_k - 273.15; // convert to celcius
outside_temp_f = (outside_temp_c*1.8) + 32; // convert to fahrenheit
}
} else {Serial.println("Error contacting OpenWeather API!");}
http.end(); //Close connection
delay(2500);
} else {
Serial.println("No network connection!");
}

dial.write((int)outside_temp_f); //-20 to 120 to 0 to 180 range.

sensors_event_t event;
dht.temperature().getEvent(&event);
if (isnan(event.temperature)) {
Serial.println(F("Error reading temperature!"));
}
else {
if ((int)event.temperature != (int)inside_temp_c) {
inside_temp_c = event.temperature;
dial.write((int)inside_temp_c);
}
}

// ESP.deepSleep(2000000); connect GPIO pin 16 to RST for this to work
delay(500);

}

Continue Reading

Arduino Iteration Adventures

My iteration project was built as a stepping-stone from my newly-acquired Arduino skills to my final project. To do so, I built a box with a map of my local area on the front, and a number of LEDs that lit up at 13 different bus stop locations to indicate where certain buses where. 

before we dive into the process, here’s the final result:

The three lines near my house are green, gold, and silver, as pictured above. 

 

My previous project for Arduino was a strip of NeoPixel LEDs that could be controlled using a joystick:

Arduino Adventures

 

This iteration project began with a sketch of some ideas I was considering:

Option (A) was the one I decided to construct, with the integrated LEDs. Option (B) would have involved a sort of clock/timer with rotating servos to indicate approximately when the next bus would arrive. Options (C) and (D) involved using LCD screens, which were a little too advanced for what I was looking to work with for this project.

To design the front of the box, I found a site call snazzy maps that could modify the look of google maps to be whatever I wanted. So I took a screenshot of my local area with just the roads visible and converted it to an SVG for the engraving process. I then found a different online tool to construct the SVG files for my wood-engraved box.

The initial SVG for my local area

The final SVG for the front-facing part of my box, with holes designating bus stops

 

 

I was initially looking to use individual LED bulbs for each bus stop, but if I wanted to use a multicolor LED, I would have 4 pins on each bulb, and 13bulbs in total… so I decided to change my approach and use NeoPixels. Since I was primarily concerned with accuracy on the map for the bus stops, I hadn’t considered the troubles I might experience when attaching NeoPixels to the board. this resulted in a bit of a haphazard setup, with the NeoPixel strip contorted in order to line up each hole in the board:

 

I then went over to the Makerspace and learned how to solder! I tried looking at a few youtube tutorials to help me along, but it was still quite a time-consuming process. I asked Niel about how he goes about soldering, and he showed me a technique that involved applying solder to each component separately, and then bringing them together and heating to attach them securely. This made the process much easier, and I was able to successfully attach all of the neopixel strips together. In particular, I made sure that I had the data line all heading in the same direction to avoid trouble later down the line.

 

My first attempt at soldering NeoPixels

First set of LEDs attached, and they work!

The completed soldering job, with Clear tape in place to secure the pixels onto the board

 

Now that the LEDs were setup, I began programming the device! Since I would need to connect to the cuMTD servers to get bus data, I decided to use a Wifi-enabled Arduino. I then installed Postman onto my laptop so I could test my API calls to MTD, and then implemented them into the arduino code once I felt confident. 

 

I ran into some trouble when making API calls through the university wifi, as they likely have security measures in place. With that said, the project is working successfully at my apartment! Here’s the code I used, which utilized a mix of NeoPixels, HTTP requests, and WIFI connectivity code:

https://pastebin.com/SNyX4EuR 

Some issues that I was facing with the implementation is that random LEDs would light up for colors that I haven’t even programmed in, as seen here:

My best guess as to the source of this problem was due to power surges in the data signal for the LEDs. After getting access to a resistor and a capacitor, I was able to mitigate this issue. 

 

Here’s a video of the final product in action:

 

 

 

Continue Reading

Iteration Assignment

Ideation: For this week, I wanted to improve my sewing skills because while I had a lot of fun during sewing week, I saw my technique had abundant room for improvement. So, I went back to the google drive folder of patterns and picked a plushie. I made bags last time, a drawstring one and one with a zipper (which was more difficult than the drawstring one). So, I decided to challenge myself and work with stretchier fabrics like felt and plush, which was a jump from working with pure cotton on the bags. The plushie also was more of a sewing challenge because it had a variety of strokes used (zigzag, straight, and basting). While I am not iterating the exact bags I made from that week, I am taking my sewing skills and techniques further by creating something more difficult and considerably different than last time. 

Images of previous project:

Construction: Unfortunately, I didn’t take many pictures of my build process, but I can describe the process in detail. I first cut out the pattern, and there were a lot of pieces. Then, I started sewing together the face. After that, I went ahead and put the sides and bottom together, which brought the squares to 3D. The places I had difficulty were the legs, because the fabric had to be squished a little to get lined up on both sides, so it came out a little frayed. 

Reflection: This project was actually fun to make. The hard part was understanding some of the directions actually, which the lab assistants helped to explain and show. Also the good part was that I didn’t have to start over on any of the pieces this time. I learned what y-seams, basting, and gathering / gathering stitches are. So, I feel like a more sophisticated sewer (not sure if that is the word for someone who sews yikes) than when I first began. Of course, my most favorite part was stuffing. The end result came out pretty good! I was impressed with my abilities and now I have a cute little plushie to put on my bed. 

Continue Reading

Iteration Project – Record Streamer – Isaac Iyengar

Intro:

The goal of this project was to extend my nametag project from the beginning of the semester. That project was a simple press-fit box with stained plywood, and a black acrylic hot glued on top. The black acrylic was cut and rastered to resemble a standard vinyl record. 

I started collecting records once I was gifted a record player from a friend, and it helped me explore a lot of old Jazz and Soul music and collect some of my favorite Hip-Hop albums as well. I like listening to music on my record player and even just seeing the motion of the record, however, I also use Spotify a lot, so I wanted to have a record player that would instead play Spotify.

I wanted to iterate on this project because I wanted to make a motorized version that would spin the record and also function as a music streaming box. The Raspberry Pi fits this specific use case. Essentially its a smart speaker in the form of a record player. 

Here’s a link to the original project: http://cucfablab.org/isaac-iyengar-nametag/

Rotating Record:

Unfortunately, the Raspberry Pi was not able to drive the DC motor on its own, so I used an Arduino instead which received bytes of data via serial indicating whether to spin the record or halt from the Raspberry Pi. I used a DC Motor following the circuit schematic shown below. The Arduino code would simply wait for signals to spin or stop spinning sent via Serial and write to the motor accordingly. 

 


Completed Circuit for DC Motor Control:

Music Streaming:

I explored using the Spotify Web API for this since it allowed for a lot of different functionality with the music such as receiving the current song playing, album art, and various playback functions. However, the Web API for my use case required authentication for every single API call, which is impossible to do in a headless setup of the Pi. Instead, I opted to use Raspotify which allows the Pi to function as a connectable device from Spotify Connect. This essentially made the device a connectable speaker. This worked perfectly and audio would seamlessly play through the speaker connected to the Raspberry Pi. 

 

Below is Demo Video from before the project was in the enclosure and synchronization between playing music and motion of the record was setup.

 

Enclosure:

To design the enclosure I used an online press-fit box generator and cut out holes for the speaker, cords, and ventilation. I sprayed plywood black and etched a pattern into the design to expose the bare wood where the wood was rastered. This created a really cool white on black look to the record case. I also attached a clear acrylic laser cut record to the DC motor so you could see the record spinning. The enclosure also has a slot that currently contains a computer speaker that was taken from a computer monitor. 

Below is a photo of the finished laser cut job.

Speaker inside enclosure:

 

Improvements to Current Design + Reflection:

This implementation requires WiFi, which isn’t great to use in a headless RPi setup since this would require SSH from another laptop to modify the file that specifies which network the device connects to. This works fine from my room, so I’m going to modify this design to work as a Bluetooth device. 

Spotify Connect is fairly limited as a means of streaming music, I’d like to be able to incorporate an LCD display into the record player that shows the current song playing, and push buttons that allow the user to have playback control. One design feature I really want to investigate is incorporated some sort of accelerometer into the record to determine if a user places there hands on the record or spinning the record, and have this be the means of playback functionality. For example, a user could stop the movement of the record with there hand and this would pause the playing. This would be similar to an actual record player.  There are services like Mopidy that I’ll need to investigate some more which allow for much better streaming of music, and incorporation with SoundCloud Last.Fm and other streaming services, all in a really nice UI that I could display on an LCD touch screen. 

 

Mopidy Front End:

One improvement I really want to do is to take apart a record player, and put the hardware inside this enclosure and control it through the Pi. This would be a really cool improvement since this project would then be able to stream music and play records as well. 

Overall though, given the time constraints for this project, I’m really pleased with the results. It’s definitely a significant improvement from the original record player nametag project. I was successful in playing music through the Pi, while rotating the record. My favorite part about this project is definitely the enclosure which turned out really nicely with the black etched wood. 

 

Here’s the Final Product:

Continue Reading

Iteration Project: Papercut Lightbox

For this iteration project, I wanted to redo my papercut lightbox from Assignment 3: Paper Circuits. The first project can be found here: 

The final product wasn’t too bad, but there were definitely some issues and snags I would’ve liked to have done better. Some of these included:

  • I originally attempted to put layers of styrofoam in between the layers, but even after laboring with a hot kitchen knife and the wrong kind of foam for an hour, the foam would simply crumble. Therefore I had to use pieces of cardboard instead.
  • There was no frame around the layers so you could see all of the inside, and it looked unfinished and messy. 
  • As the project was supposed to be focused on the paper circuits and LEDs, there were only three lights within the backdrop. The three LEDs showed through as discrete light points instead of the collective diffused ambience as I wanted them to be. 

Because I had these distinct points of improvement, I thought this project would be a good choice to iterate on. My improved plan was to create the lightbox with papercut layers as before, but with the right kind of foam, a wooden frame, and a string of lights around the backdrop border. 

I brought my proposal up to the instructors, and they gave me the helpful suggestions to use Arduino NeoPixels instead of fairy lights, and Duralar sheets to diffuse the light more than regular paper. Also since the previous type of foam I used was extremely difficult to cut and quickly crumbled, the instructors gave me foam core to use this time around. 

For the paper art, I chose to recreate the artwork of one of my favorite albums. This part took a lot of thinking through the layout of the art and breaking up the components into paper layers. After some time I managed to reduce everything to ten layers, which I then outlined in dark pen to better distinguish what to cut out. I got several sheets of plain white cardstock and added a .5 inch border around the image. To trace the art onto each sheet of cardstock, I came up with a makeshift tracing lightbox using my phone flashlight and my empty sock drawer lol.

The foam core ended up working perfectly; it was MUCH easier to cut, and the cuts were very clean. The thin bars were firm and easy to work with. I reinforced each layer with .5 x .5 inch squares on the corners and 3 inch bars along the sides, as seen on the right.

 

 

 

I cut each of the paper layers by hand using a thin box cutter; this part definitely took the longest time (an all-nighter!) and the most labor intensive. However after everything was cut out and finished, it worked out pretty well! The right image is the final product after assembling and gluing all the layers together. 

Next were the NeoPixels. I had never sautered before, so I got some help from my ECE roommate to show me how to use a sautering iron and solder. We successfully sautered the three wires to the end of the NeoPixel strip. However, when I wrote and uploaded the code to make the strip shine white to the Arduino, nothing happened. After talking to an instructor I found that it was because I had sautered the wires to the wrong end of the strip; apparently they were supposed to be joined at the DI end following the arrows, where I sautered them to the DO end. (Another great learning experience from this project.) After removing the old sauter and trying again, I finally got the NeoPixels to properly light up. 

Lastly, the wooden frame. Another instructor suggested the Box Maker site to me, where you simply input your desired dimensions and the site exports an SVG of the design for a press-fit box. I opened the SVG in good old Inkscape and, as I learned during the first week of class, I edited the layout to fit on a 15 x 30 inch wooden board and for the laser to cut straight through the wood. Uploading the file to the printer, cutting the pieces out, and assembling them was a quick process, and easily enough I had my frame. 

 

I finally had all of my parts, and it was pretty quick to setup everything up. I cut out a huge square for the front frame, and a small hole in the back panel to feed the Arduino wires through. I’m not really sure why the lights ended up being orange instead of white even though the code had values for white, but that wasn’t too much of an issue. 

 

I didn’t have a hammer to completely press the sides together, and plus it was 1 in the morning so I didn’t want to make too much noise doing so. So the box sides are a little loose in the pictures, but otherwise here’s my final product! 

 

Reflection

Overall I’m pretty happy with how this turned out, considering how much work I put into it. Only nitpicky things I would fix are how gluing paper layers directly on top of each other, e.g. the lion and the man, makes certain pieces look darker which I wasn’t expecting. The sun in the top middle also is rather faint and not as pronounced as I would like it to be, so perhaps there’s a solution for that. Outside the scope of this project I would like to paint the frame white and keep it. 

Even though this project took a lot of work and time, because it was over something I really wanted to do, none of what I put in felt like a lot at all. I had a lot of fun doing this and see how much the iteration project improved from the original, and I also got to learn the new skill of sautering. 

 

 

Continue Reading

Iteration Project– Joy Shi

For my iteration project, I decided to redo the first assignment, using the laser cutter to make a name tag. My original name tag was nice and simple, though a little small. For my iteration, I wanted to make my name out of acrylic as it makes the name tag look cooler than the plywood. I noticed that when rastoring on acrylic, the print is white and I wanted something with more of a color. My original idea was to use the Silhouette cutter to make a sticker that I would then place on top of the acrylic. While also looking for inspiration on Google, I came across someone using an LED light and coin battery to light up the acrylic. The effects of the light were really cool, and it seems simple enough for me to do. While proposing my idea to Maxx, she concluded that my idea was too simple. She suggested I instead use NeoPixel strips as the base and have the light shine up that would give the rastored acrylic some color instead of placing a sticker. After showing me a few examples that were in the FabLab, I decided that this was a much better idea than what I originally thought of doing.

Original Name Tag

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Since I already had a general idea of what I wanted to put on my name tag, the designing part of the name tag was relatively easy to do. Since I wanted this name tag to be more personalized than just having my name on it, I decided to add my Bitmoji with a coffee cup since coffee plays such an essential part in my life!

I decided to print out a prototype version of the name tag on plywood, just so I can see if I liked how the designed turned out and how big it was. Right when I was about to print, Maxx noticed that the name tag was a tad too big. After adjusting the size, I was ready to print it out! The final prototype turned out pretty nice and I really liked the size and design of it.

Sketch of the design

 

 

 

 

 

 

 

 

 

 

 

 

Prototype

 

 

 

 

 

 

 

 

I went back and made a few tweaks on the design since there was a bit of blank space on the prototype. After adjusting, I decided to laser cut my design onto acrylic. Halfway through the print, I realize that I forgot to adjust the size of the design!! So in the end, the design was slightly larger than I anticipated, but it was still really nice. 

 

 

 

 

 

 

 

 

After all that fiasco, I went to search for NeoPixel strips. Sadly the only NeoPixel strips they had didn’t have the wires soldered on. After a brief tutorial, I was soldering the wires onto the NeoPixel strips. The process was pretty cool and was really easy if my hands weren’t so shaky. With the wires connected to the NeoPixel strips, it was time to test it out. Since I’m not that good with coding for the Arduino, I just found a code on Google. With the code loaded and wires connected, I tested out the NeoPixel strips.

 

 

 

 

 

 

 

 

With the acrylic design ready, and NeoPixel strips working, it was time to determine how to make the stand I was going to put my acrylic on. Google had many ideas, from using a box to 3D printing to using the laser cutter. Since I was already using the laser cutter, it only seems reasonable to continue using the laser cutter. The design of the stand was relatively easy to format. Drawing out the stand on Inkscape was relatively easy since they were all rectangles cut into different shapes. I specifically was very careful when it came to the measurements of the slit for where I was going to place the acrylic. The lasering of the stand was also straight forward. However, when I attempted to put the acrylic into the slit I made, the acrylic wouldn’t fit!! I was slightly disappointed since I specifically paid attention to make sure that this wouldn’t happen:( Thankfully it was only slightly off, so I used some sandpaper to remove the excess part. Surprisingly this took a while since the pieces were small, and I didn’t want to break it. After finally being able to have all the pieces fit through the slit, I worked on placing the NeoPixel strips. With the help of some double-sided tape, I placed the NeoPixel strips on the base of the stand. I then glued the top part of the stand with the acrylic on top of the NeoPixel strips.

Using sandpaper to make the acrylic fit:(

finally with all the slits lining up with the acrylic

In the end, I really liked how the whole project turned out, even though now it’s more like a nameplate than a name tag!!!

 

Code used:

https://forum.arduino.cc/index.php?topic=282769.0

 

Inspiration used for base: 

https://www.xstron.com/how-to-make-custom-dimension-wood-led-base-for-acrylic-plate

Continue Reading

Iteration Project – Scott Kim

 

Iterating on the first Arduino project.

The project was something that could definitely work well in theory, but ran into a lot of issues and shortcomings that I didn’t initially expect. The original idea was to be able to type out words without the use of fingers or fine motor skills. It would be used in a way like this:

  1. Once the ultrasonic sensor detects your hand, it keeps measuring the distance. It uses this distance select a letter.
  2. Once the sensor detects a sudden change in the distance (in that, you moved your hand away from the sensing area), it would select and type the letter corresponding to the most recent letter.

 

But it had a lot of problems.

This seemed like a good idea in theory, but a lot of its shortcomings can be summarized through this:

(sorry for the dark video, the screen was just too bright in comparison)

Digging into what might be the problem for it being inconsistent, I printed out what the sensor measured as distance and got this:

Despite its errors, it did work well enough for a short demonstration and video for the assignment, but it really was nowhere near what I imagined. The whole thing needed a better frame to make the hardware more reliable, and an entire software rewrite to accommodate for the small errors. Even with that, I found some oversimplifications in my original description of the project.

So immediately, the distance measurements are unreliable. I saw three sources of this, and three solutions to them that I would try to implement first:

  1. When you’re really far out (the letter Z is ~50cm away from the sensor) you can’t really tell if the sensor is facing in your hand’s direction.
    • I need to make some solid frame that holds the sensor perpendicular to some ruler/surface
  2. “A sudden change in distance” is really vague and hard to quantify. Especially with an unreliable sensor like this.
    • Once I get the frame, have something at the end so I can tell exactly when a hand is/isn’t on the sensor path.
  3. “Hands” are oddly shaped and aren’t always detected too well.
    • Use a 90 degree reflector instead

 

First, making more reliable hardware

I knew that about 2cm per letter was a good amount of room where it doesn’t take too much space, but you also don’t have to be too precise. So, I started preparing a ~55cm long scaffold to hold the sensor and display. I created a cutting pattern for an open box using Boxes.py, and added a few more cutouts of my own for the sensor, screen, and wires.

The pieces at the top will make up the open box, while the 4 bottom pieces in the cut pattern will be used to solve problem #4 and create 90 degree reflectors.

Once cut, I started putting together the pieces!

 

My proudest part of this, really.

The ultrasonic sensor was a amazing fit, with 10/10 positioning of the wiring hole. I was honestly way too happy for just getting this one bit so perfectly 🙂


 

Downhill from there

The display might look like an almost perfect fit, but the cut hole was just barely too small because of a tiny part of it I didn’t account for. I amend this later.

The 90 degree reflector! I heard that using angled pieces like this more reliably reflect lights and sounds back to the source, so I thought it would help a lot.

I made the mistake of cutting a little too big a piece because I didn’t correctly tolerance it when measuring, cutting, and Pythagorean Theorem-ing.  

And then finally, it’s all coming together! Some last things to fix though.

 

Measure once, cut twice

Now as I mentioned before, the screen was not fitting perfectly, and the reflector was cut too big. I quickly fixed those issues.

The oversized reflector was marked, cut, then put back:

 

And then for the screen, this tiiiny part of the screen/wires were getting caught in the wood and would not let it fit.

 

And so, a bit of careful carving out the wood later, I managed to make some room. (There’s a pretty guilty-looking utility knife in the background)

After some hot gluing, taping, and writing the letters on the board as a guide, it came together pretty well! From a hardware perspective, it had everything to make the ultrasonic sensor as reliable as possible, addressing all 4 of the problems.

 

Actually writing good code this time

It was now time for the software rework.

After toying with the old version of the code, I saw several issues that I should address similarly:

 

Issue #1: No matter how reliable everything is, I’ll get the occasional outlier from the ultrasonic sensor.

The first method used the statistical mean of ~30 samples, but outliers affected that a lot.

Instead of using the mean, I now used median. That way, huge outliers won’t have any affect as long as they’re not the majority. 

 

Issue #2: As I move my hand away to “select” a letter, I might accidentally select an adjacent letter instead.

For example, say the user wants to select ‘h’ which is between 18cm and 20cm. The sensor might return series of numbers like this:

  • 19.3cm (h)
  • 18.8cm (h)
  • 19.1cm (h)
  • 21.2cm (i)
  • 57.8cm (hand completely moved away)

Once the sensor realizes the hand completely moved away, it needs to select the letter that was most present in the last few seconds (which is ‘h’), not just the most recent measurement (which would be ‘i’).

I solved this by keeping track of the ~7 most recent measurements, and then taking the median value once it realizes the hand moved away.

I set a delay at the end so that the user gets some moment to see that the letter they want has been selected.

 

Issue #3: There’s no good way to tell if you’re in the ‘border’ between two letters.

If you take a look at the past video or images, you can say it displays a “Distance”. This was meant to serve the above purpose, but it only really works for me because I know roughly where the letters are supposed to land. But even then, it’s not very useful because I don’t know the thresholds memorized of course.

I had all this screen space to work with, so I thought I could put a pretty intuitive indicator of how “centered” you are on the letter! It would work like this:

If you’re currently selected on the letter ‘c’, and perfectly centered, the display would show something like this:

  • b          c          d

Otherwise, if you’re selected on the letter ‘c’ but a little over to the left:

  • b   c                 d

Or if you’re a little over to the right:

  • b                 c   d

Hopefully that would indicate that you should move your hand a little over to the right to get a more precise selection of the letter ‘c’. 

 

And with that, we’re done!

I’ll let the video speak for itself 🙂

 

 

Most of the trial-and-error in this project was really in the programming. Seeing what seems like would intuitively or theoretically work, trying to make it work, and not being sure if my method is bad or if the program is buggy. There was one hour where everything was working fine, but it would inexplicably type “z” no matter what. I was completely sure I was writing the correct letter to the LCD, and then I realized I was just overwriting the correct letter with “z” just a couple milliseconds later because of a bad if statement 🙁

It was also a lot of tinkering with how many samples I should take for a reliable median, many samples I should “remember” for the selection, as well as how much space to give per letter. If these numbers were too big then the system felt sluggish, but too small would lead to more mistakes.

Then, there was the reorganizing and commenting everything, because holy moly the original code I wrote was awful.

When I saw how well it was working in the end, I was genuinely so happy with its consistency and reliability. The typing, the “Ready” notice, as well as the visual guide and feedback for each letter was all exactly how I imagined it to be. (Almost) everything fits together perfectly, and there’s so little about it that feels hacked together or improvised. I really can’t express just how “complete” this project feels, really having made no compromises in terms of quality, accuracy, or usability. 

One thing I considered was laser cutting the letters onto the board, but I thought it would be better to hand-write them on so that I can fiddle with the letter spacing and locations in the code. Next time though!

Continue Reading

Iteration project: Sean White

For my Iteration project I decided to iterate on the game I made with the LCD. I wanted to use a screen that offered more pixels and had an easier interface to work with in Arduino. The main issue with the LCD screen that I originally used was that there were very little pixels and everything was broken into blocks. With this new OLED screen I used, it was 128×64 pixels and it was all located on one area. The coding interface was also much easier since the ADAFRUIT libraries allowed for drawing bitmaps based on x and y coordinates. This made it much easier to code the moving blocks.

A few problems I ran into had to deal with, like last time, making it show the walls would spawn in a way where it was possible to avoid them. I spent a while trying to figure out all of the conditions for the walls, but in the end, I used the same method before which was brute forcing and checking the different options for when a wall spawned. Unfortunately, I wasn’t able to take a picture of this, but this is a image of what it looked like:

I had also originally had each box move 16 pixels at a time. However, the look of it was very choppy. As a result, I decided to increase the amount of times the screen refreshed since this OLED screen could handle a faster refresh rate. This allowed the look of the game to look much smoother compared to the original LCD.

In order to improve upon this, I decided to make a housing for it as well as use a joystick instead, since that is more intuitive to control. I also added a scoring system based on the total time the player survived, and I made it so every five seconds the walls would speed up a little bit. This made it more challenging to overtime.

I at first wanted to design this like an arcade system, but once I received the screen, I realized it was too small to make it something like that. Instead, I created a box using boxes.py in order to hold the arduino and I made cutouts for the screen and the joystick. Overall, I am happy with how it turned out, but If I were to redo it, I would probably make the case more ergonomic to hold. I would do this by using an arduino nano to make the overall form factor smaller and use smaller wires. I would also solder the wires together too.

This was the original lcd project:

This was the new improved project:

Continue Reading

Iteration Project

I decided to re-do the textile assignment for my iteration project. I made the plush owl for the first sewing project. However, I did not really understand how to sew. It was my first sewing project. I also discovered on this project that I did not understand that I needed to combine the different cutouts into one. Therefore, I embroidered a patch that ultimately never made it to my wallet. I received a lot of help from Maxx.the first assignment, with the plush owl.

I had cut out the fabric, but into several different pieces. I ended up having to place those items back and used a giant roll of the shiny, satiny green fabric. I got tripped up a lot on this wallet because I did not really understand the instructions. They were not as well written as the plush owl ones. 

I had to cut out the fabric twice. My first attempt was tripped up by the zipper. I cut the wallet part too much, although in hindsight, I am sure that this could have been salvaged. I just was panicked because I could not come in to finish the sewing until Thursday evening. 

I found the satin to be a much better fabric in terms of hiding how often I poked it with a needle and needed to pull the threads. For instance, when I was trying to put the entire wallet together, I had flipped the sides so that the zipper was on the outside instead of the inside and flipped. 

I do enjoy the sewing. I just need to remember that the template needs to be taped together before I cut the material. Also, I was missing the interfacing. I think it would have helped it not be as lopsided in the end, but I really think I did not a bad job.

Trying to get the folds right by using the template.

This section was the hardest. I had messed up the mountain folds three or four times and had to constantly pull the thread out. I got turned around and kept using the wrong sides to make the folds.

 I lost my contrast band when I sewed the item together. I managed to keep it when I temporarily hand-stitched it, but with the machine, I ended up sewing it all together. 

Temporarily hand-stitched to pIMG_5201 IMG_5199resent in class. 

IMG_5199

IMG_5201

Continue Reading

Iteration Assignment

Designing/Thought Process

I knew I wanted to work on my laser nametag project because it was the project I had the most fun with and put most effort into. I also had a better idea than other projects on how to improve my laser name tag project, so I knew what to choose for my iteration project. My original nametag, I styled it into a GPU name tag using trace bitmap,and using draw lines effectively on inkscape. For my iteration project, I wanted a nametag that was actually 3D, instead of several wooden pieces glued together. I also wanted the several sides to each accurately portray the sides of a GPU. There would also be a red glow coming from the box in a pulsing effect, to reflect the name of my GPU, the Sapphire 5700xt “Pulse.”

The original name tag

Iteration Project Design Process

 

 

 

 

 

 

    

Third time was not the charm…

 

Failures making boxes

At first, what I tried doing was designing my own box following after learning how to make notches using a youtube video. Using the grid lines, and having the nodes attach to the corners automatically, it was rather simple to create the notches for the individual sides of the box. I foolishly thought this was all I needed to do in order for me to create a box. The first printed pieces however, seemed not to match, and some notches were going into the right place. At this point, all I thought was I must have put some notches in the wrong place as the box was not holding it self. I continued to make the same mistake of trying to fix the notches when the problem was that I was not thinking of the extra dimensions needed to the box to be assembled in the place. I repeated these procedures three times more before I realized I am stupid and asked Max for advice.

Improved Box

Max directed me to a box making tool online that I could then download as a svg file easily, which I could then edit on inkscape. Using the improved box, I made different vector images for different sides, and most importantly, instead of rastering my name like my original project, I chose to vector the name. I then put a red tissue paper behind the name so when a light shines through it, it will glow red.

Behind the name is a LED light using arduino circuits. It is using the code set called “pulse” that uses the delay function and a for loop so the light slowly increases intensity and decreases continuously.

Reflection.

Overall, I think there is much more I can improve with this project, if given more time. I could paint the whole wood black before lasering so it looks more realistically like a GPU, which I was in the process of doing before running out of time. I could also find a way to add mini fans to the case. The side designs of the box I could put more on inkscape to be improved. I think my overall idea was good and if given more time, I can find more ways to improve my design.

Continue Reading

Iteration assignment

For my iteration assignment, I decided to combine my name tag with lights to create a light box. My original name tag had a leaf at the centre of it to represent my love for nature and my name tag was in black and brown on an acrylic sheet. I wanted to add colors green and yellow to it so I decided to create a light box with lights in them with my initials and a leaf on top of the clear acrylic sheet as my name tag. The idea was to iterate on the original name tag to add color that was otherwise missing on the original name tag by using lights.

All of the sides of the box were in wood except the top which was in clear acrylic. I started out by creating a smaller box to test that it wouldn’t break under the pressure when put together. For that I got the prototypes from ‘boxes py’ for a small box.

The  wooden sides and acrylic top got put together nicely and so I decided to laser cut the bigger pieces too. I went on to the next step to build a circuit that would light up led’s on an Arduino. 

But I decided to replace these led’s with neopixels as I wanted to create dancing lights and give the lights nicer colors. I soldered the neopixel to jump wires and connected it to my Arduino board. I downloaded the neopixels library from Adafruit and played around with a few examples to get the pixels to light up in a way I wanted. I used green and yellow colors to represent nature. I added green cloth inside the box with some green, yellow and white feathers to represent more of the nature I wanted to portray in my light box. 

Finally I made the neopixels light up by connecting the Arduino board to the source. I initially was going to put the lights very close to the leaf but I realized later that acrylic can disperse light, so I put it lower than the surface of it. I changed the lights to go from one level of brightness to another consecutively and changed the colors from green to yellow one after the other. Here is a video of the light box with the dancing lights. 

On my second iteration, I changed the code further to include different effects on the lights. I added a fast flicker, a simple plain light up without any effects, all in green and yellow and a rainbow effect to include more color. 

CODE

// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter — see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 500 // Time (in milliseconds) to pause between pixels
Adafruit_NeoPixel strip(2, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.

pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
pixels.clear(); // Set all pixel colors to ‘off’

// The first NeoPixel in a strand is #0, second is 1, all the way up
// to the count of pixels minus one.
for(int i=0; i<NUMPIXELS; i++) { // For each pixel…

// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
// Here we’re using a moderately bright green color:

pixels.setPixelColor(i, pixels.Color(0, 250, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 200, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 150, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 100, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(0, 50, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(250, 250, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(250, 250, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(200, 200, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(150, 150, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

pixels.setPixelColor(i, pixels.Color(100, 100, 0));

pixels.show(); // Send the updated pixel colors to the hardware.

delay(DELAYVAL); // Pause before next pass through loop

}


for(int i = 0; i<50; i++){
pixels.setPixelColor(0, pixels.Color(0, 250, 0));
pixels.setPixelColor(1, pixels.Color(250, 250, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(50);

pixels.setPixelColor(0, pixels.Color(0, 200, 0));
pixels.setPixelColor(1, pixels.Color(200, 200, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(20); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 150, 0));
pixels.setPixelColor(1, pixels.Color(150, 150, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(10); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 100, 0));
pixels.setPixelColor(1, pixels.Color(100, 100, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(2); // Pause before next pass through loop

pixels.setPixelColor(0, pixels.Color(0, 50, 0));
pixels.setPixelColor(1, pixels.Color(50, 50, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(1); // Pause before next pass through loop
}

for(int i = 250; i>100; i–){
pixels.setPixelColor(0, pixels.Color(0, 255, 0));
pixels.setPixelColor(1, pixels.Color(255,255, 0));
pixels.show(); // Send the updated pixel colors to the hardware.

delay(50); // Pause before next pass through loop
}

for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256)
{
for (int i = 0; i < strip.numPixels(); i++)
{ // For each pixel in strip…
// Offset pixel hue by an amount to make one full revolution of the
// color wheel (range of 65536) along the length of the strip
// (strip.numPixels() steps):
int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
// strip.ColorHSV() can take 1 or 3 arguments: a hue (0 to 65535) or
// optionally add saturation and value (brightness) (each 0 to 255).
// Here we’re using just the single-argument hue variant. The result
// is passed through strip.gamma32() to provide ‘truer’ colors
// before assigning to each pixel:
strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
}
strip.show(); // Update strip with new contents
delay(15); // Pause for a moment
}


}

Reflection

I was inspired by appreciation for lights in general to make this project. Lighting has a way of changing my mood and it’s my favorite thing in the world. I love different kinds of lights. They are very good mood uplifters so based on some examples of students in the previous semesters, I decided to create a light box. I was excited about using led’s to light up my light box. There are some pitfalls to avoid in the project. The wires are sensitive and the box pieces should be checked to see if they can handle pressure. I was adjusting the position of my neo-pixel after putting green cloth on top of the Arduino when one of my jump wires broke inside my Arduino. So it is important to be very nifty with the wires as the neopixels are soldered to the jump wires and tugging too hard on them can break them. I care about this because I believe lights are beautiful. The natural sunlight is my favorite type of light and I love everything about nature. I wanted to add some color to my name tag as I wanted to make the name tag more representative of nature in all of its colors also. I still need to learn how to write better code to add even more effects to the lights. If I had more time, I would experiment with more examples from Adafruit. My goal was to get the box to light up and I feel satisfied that I was able to make the light box close to what I had expected. I wasn’t expecting the light to dispense from so far but acrylic could do that. I also didn’t expect to use neopixels but they were much better than the simple led’s. The big moment that moved my project forward was when I got the led’s to light up in a dancing way. I knew then my project was going to be a success. Learning to solder was also a lot of fun. Soldering requires precision and concentration. I really liked building the whole thing and combining different techniques to make it happen. I was a little doubtful about my ability to combine the different techniques but now I am hopeful for the final project that I will be able to think up something for that as well. 

 

 

Continue Reading

Arduino Pom-Bot

For the in-class project I used one servo motor to create a simple flower in a pot. I cut a hole through the back of the cup to feed the wire through and created a flower to attach to the motor arm. The trickiest part was making sure the motor stayed put inside the cup while moving, which I ended up resolving by poking two holes through the bottom and fastening a pipe cleaner around the motor. The final result can be viewed here: IMG_0530

Getting the final project off the ground proved much more difficult in comparison. After getting some help from my roommate in ECE, I managed to successfully hook up the two servos. I originally wanted to try making a fish or snake-like robot. My attempt to create the skeleton of it consisted of stringing a pipe-cleaner between two servos, but after doing some further tinkering and research it turned out that more than two motors would be needed, and I have no idea how to easily replicate simple harmonic motion in Arduino code. Therefore I ended up scrapping that idea. 

an example of a failed attempt

I kept trying to come with ideas, but many of them didn’t work. The ideas made were not based on the objects that were actually created, but rather on how I could program the servo to make it move. For some reason I really just couldn’t come up with a way to make the object move, even though I understood that the servo motion could not be symmetric and one motor had to be stronger or have a wider range of motion than the other in order to propel the object in a direction.

I finally just tried going through with a standard toy robot. The image to the right is not particularly descriptive, but basically the idea was to put servomotors into each leg, connect a long bar to the servo motor arm and leg interior, and the motors would simple rotate between 0-45 degrees to move one leg in front of the other. The code for this was pretty simple, just two for loops oscillating between 0 to 45 degrees and writing the angle to the two motors. I used the Arduino online IDE to edit and push my code to the board. 
 I only had brown cardstock lying around at home, so I used that to create each leg; the connecting rod between the motor arm and the cardstock is a pipe-cleaner twisted around the motor head. Overall the idea was pretty simple; however as seen here: IMG_0533 there were some issues getting the leg to move. Throughout the whole project my greatest frustration with the motors was that fact that often they were too weak or light to move the object attached to their arms, but rather the motor bodies themselves would move X degrees relative to the object. So as you can in the video, if the leg was resting on the table it wouldn’t move; the motor would just rotate on the inside of it. Even when I tried connecting both legs, neither of them would move: IMG_0535. I couldn’t think of a way to weigh down the motors such that the object would move relative to them instead of the other way around. 

As you can tell, the last hyperlink is the closest thing I have to a final product and it’s not finished. However considering the large amount of time already taken to get this much done I decided to go ahead and submit what I have. This project was actually pretty frustrating in that I just kept seeing none of my ideas actually work, and working with the servos was tedious as well. Often I had to keep “zero-ing out”, ie. resetting the motor head to zero, in order to make sure I had the correct start and end points for the motor’s range of motion. And as mentioned, I couldn’t figure out a way to get the whole objects to move as I had envisioned them. From this project and the previous Arduino unit I was able to learn how to use the Arduino IDE and work with basic hardware. But it’s convinced me.. I think I should stick to software hahah. 

Continue Reading