This post is a follow-up to the fabrication post about the same project. Still a work in progress.
Lamp: Mkr1000 + Hue + Neopixels
The lamp is a combination of a Mkr1000, Neopixels, and Philips Hue. The Mkr1000 acts as a server, listening for http requests from the user-interfacing web-client, requesting time data from the WiFi router, and sending http requests to the Hue Bridge.
Very bare bones at the moment, the web interface allows for users to select various functions for the light (for example, Candle Mode or Timing Mode).
The interface is made in p5.js. Once a button is clicked an http requests is formed and sent. I was having trouble/errors with the response, so the sketch ignores any responses.
Similar to original Long Distance Reading Lamp, this bedside light is intended in its final form to connect people over distances. For this first iteration, however, my goal is to create a solid 24hr response cycle – a ‘default’ state, so that the lamp can work well as a standalone bedside light.
After experimenting with a few form factors (I really wanted to make a nice cylinder, inspired by Casper’s Glow Light), given the time constraints of this assignment (and the wallet-constraints of being a student), I settled on a cheap ($9), off the shelf diffuser. This allows me to focus more time on the interaction and progression, and less on fabrication and (potentially expensive) materials.
Hacking the light fixture to accommodate my extra circuitry wasn’t too complex, though I took care to make sure that the AC circuit was safe.
As part of the final for Energy, Rashida and I are dealing with 555 timer circuits and intermittently power cycling a rover. For this class I’d like to create a modular 555 timer circuit that is A) adjustable in its cycle, and B) modular in its use.
I plan to sacrifice some of the adjustability in favour of a mostly SMD (and thus smaller) board. To allow for a bit of flexibility I will use a potentiometer as R2, and include two selectable capacitors.
R2: As seen here, R2 affects the time off in relation to R1 (time on). Unfortunately with the basic setup the time off can never be more that 50% of the duty cycle. Rashida’s solution is to us an ‘improved’ 555 timer circuit, my solution is to use a logic inverter in front of the relay.
Video games are framed by the computer screen. The world of the game exists within that rectangle, and the ‘real’ world exists around it. What if we use connected lighting systems to extend the environment of the game beyond the screen?
For this project I have created a simple game of pong in which how well you are doing in the game is reflected by the world around you. Using a Philips Hue Bloom (or any “hue”, “sat”, and/or “bri” capable light), your progress in the game affects the brightness and colour of the room you are playing in.
Very simply, the longer you play, the more pleasantly cool and desaturated the light around you becomes. Whenever you ‘lose’ the light progresses some increment back towards a glaring, saturated red.
This week’s Homemade Hardware assignment is to do something interesting with an ATtiny. I have decided to make a useless light toy thing.
Uploading code to an ATTiny is slightly more involved than to something like an Uno. Fortunately we can use an Uno as an uploading interface (as described on the class site). You can do this with a breadboard and jumpers, but it’s helpful and repeatable to use a programming jig. Here’s mine:
I scrounged the junk shelf for some inspiration and found a film container. It looks like a nice diffuse material and is small enough to offer a challenge to put something interesting inside. It fits just enough PCB for an ATTiny plus a Sparkfun accelerometer breakout.
With the component parts in place I got to work figuring out what this useless toy thing would do. With an accelerometer I can know which direction is down. The film can has a natural ‘rollability’ to it, so I figured the fun little playful characteristic of this thing could be that its lights always point one way when you’re rolling it.
Tom Igoe told me specifically that I’d fail Light and Interactivity if I brought in a rainbow LED project, so I’ve chosen to get all my rainbow LED kicks in this class.
Two accelerometer axes (x and y) with some throwbacks to highschool geometry (arctan2), and a little bit of filtering (SimpleKalman) provided the code necessary to calculate down. Here’s a graph of the sensor readings.
After getting the interaction right okayish, the rest was simply a matter of soldering it on to small enough a through-hole board to fit into the canister. I enjoy this part as it feels like a puzzle.
Next steps will be to add a switch so that I can turn it off. As it currently stands there is a USB charging port for the LiPo, but to turn it off you must unplug the battery. This is not ideal.
I’d also like to refine the look, perhaps add a more thoughtful colour scheme, and work on making the change of colour more definite. I do like the subtle shift in colour, but I worry that the slow change is not very noticeable. I would like to try a few other outputs, such as having each colour ‘tick’ over to the next slot if a certain threshold is met.