Enter a new space (sight, sound, smell) – For this interaction I just connected some lights to the Arduino Nano. I'm hoping to figure out what other pieces I am going to add to this one when I come to class this week.
Week 3 Reflection
This week I started writing code for the micro controllers I am using in each interaction. I got off to a little bit of a rough start because the micro controller did not want to connect to my computer. After trying several times to upload code to the micro controller, installing different libraries and drivers and a whole lot of internet research troubleshooting, I tried using a different micro controller of the same type and had better results. Once the micro controller and my computer were connecting, I started working on the plant interaction. I built a circuit that involved two strips of lights that can both be turned on and off with switches and wrote code to start testing it out. I will later replace the switches with a capacitive touch sensor and a soil moisture sensor to control the lights.
This week I also started doing some research on the real time clock chip that I will need for the light and sound interaction. It has a battery attached so that it will keep accurate time even when not connected to another power source. This is perfect for keeping track of the time for sunrise and sunset even when the lamp is not powered on. To write code for it, I will need to install the RTCLib library. It does look like it will take a lot more code and calculations to use this chip than I initially thought, so I will have to budget time for that.
For the breathing interaction I started experimenting with capacitive touch controlling a neopixel strip. I think in the final interaction I will probably use a large LED instead, because I do not like the way the neopixels transitions in discrete steps. I would prefer the fluid transition of the LED. I started using the ADCTouch library but quickly realized that it is not set up to run on the Adafruit Trinket M0 micro controller I am using. I transitioned to using the Adafruit FreeTouch library. After doing some research, I was able to write some code to turn neopixels on and off with capacitive touch.
At this point, I would say the project is about 30% done. I have most of the computing components and I have done a good amount of research and experimentation with writing code for them. I hope to finalize the computing components of at least one interaction by next week and be very close on the other two. Once the code is written and the computing elements are finalized on the breadboards, I can begin soldering elements together and building enclosures. I hope to be at a point where I can start work on enclosures within the the next two weeks.
Week 4 Reflection
This week I am trying to finalize the code and circuit set ups for my interactions. I think this will be the most complex part of the project, so it is important that I take time to do research, experiment and really find the best way to make my interactions work.
I started with the breathing interaction. Last week I got the basics of the interaction down with the neopixel lights turning on and off in response to capacitive touch. This week I was able to mostly finalize the interaction. I am using an LED rather than a strip of neopixels this time. I have written code to take the value fed in from the capacitive touch sensor and effect the LED. If the sensor is being touched, the LED will begin to fade brighter and then dimmer in time with deep breathing. As soon as the sensor is no longer being touched, the LED will turn off. The final part of this interaction will be attaching a battery for power. I do not have the parts to attach a battery yet, but I have done some research on how it will work so as soon as I get the parts I can add it in. The battery will allow the user to interact with the breathing interaction and not have to be connected to a wall outlet. I plan on using a rechargeable battery that the user will be able to charge when they are not using the interaction.
I also soldered pins onto another micro controller so I could work on more than one interaction at a time.
Next I started working on the circuit and coding for the plant interaction. I attached the soil moisture sensor and it was picking up readings, but the readings didn't make a lot of sense. I was getting high numbers (400-700) when the sensor was dry and low numbers (0-200) when the sensor was wet. I also got a lot of sporadic numbers in between with no obvious reason. From the research I have done, I should be getting 0 when the sensor was dry and up to about 500 when the sensor is wet. I tried to do some more research to if I could recalibrate somehow, but it didn't go very will. I think its a problem with the sensor itself, so I'll have to get a new one. I went ahead and attached the other components and started writing the code for this interaction even with the sensor giving weird values. When I get the new sensor I should be able to replace the bad one and have the code for the whole interaction working well.
In the picture above, you can see the plant interaction with the touch sensor at the top left, the moisture sensor at the top right, the lights that will be controlled by the moisture sensor at the bottom left and the lights that will be controlled by the touch sensor at the bottom right. I was able to get the lights working again, but the touch sensor was only returning a small range of values (span of 10-15). I think this might be a problem, so I need to do a little more research on how to fix that with either minor changes to the code I have, or redoing the code for that part with a different library. I am also thinking I will need a different sensor for each part of the plant. This means there will probably not be enough pins on the microcontroller to fit everything. I may have to put two microcontrollers in this project, one for the plant touch sensing and lights, and another for the soil moisture sensing and lights. I have faced a few setbacks this week, but I have adjusted my plan accordingly. Over the next week I will acquire all thee parts I need, and I will need to do a lot more research and testing with the electronics. Now that I have worked out the major issues, I should be able to move forward with finalizing the electronics of the interactions pretty quickly (end of next week hopefully) and start building enclosures soon after.
Week 5 Reflection
I did a lot of work on the coding of my interactions this week. The breathing interaction code was done as of last week, but this week I attached a battery to it so it could be used without being plugged in. In the picture you can see a piece in the middle of the wire that connects to the battery, this is a micro USB port that can be used to charge the battery.
Next I spent a lot of time working on the plant interaction. Instead of using the Adafruit Trinket M0 as my microcontroller for this project, I decided to switch to the Arduino Nano. This new board has enough pins for both parts of the interaction. Since this board has ARV architecture rather than SAMD like the Trinket, I was able to use the ADCTouch library that I am more familiar with for capacitive touch. Using this library, I was able to get a much larger range of values for the capacitive touch part of it. With more pins available on this board, I was also able to attach three separate capacitive touch wires. I was also miraculously getting better values from the soil moisture sensor this time. I think it has a lot to do with using 5V power on this board as apposed to the 3V power I was getting from the Trinket. As you can see below, I rigged up a strip of Neopixels for the moisture sensor to control. I also have three LEDs as well as a string of Neopixels. I will use one of these two set ups for the capacitive touch to control. I wanted to experiment with both to see which would look better with the plant and be able to transition their brightness most accurately to the capacitive touch sensor values. I think I am leaning toward the string of Neopixels right now, but I want to do some more testing before I decide for sure. Now that I have all the elements attached and code for each input and output running, I can focus on fine tuning the code that allows them all to interact.
A: Three capacitive touch wires
B: Soil Moisture Sensor
C: Neopixel Strip
D: Three LEDs
E: String of Neopixels
I worked on the light interaction as well. I soldered pins onto my Adafruit Real Time Clock Chip. I then downloaded the RTClib library and began running some basic code to track the date and time. When I initially ran the code I got the correct date and time, but the values I got weren't changing as time moved forward so I will have to figure out why that is happening. I also found some resources on how to code sunrise and sunset times. It looks like I will need the latitude and longitude to tell the location of the interaction piece. I may have to find a way for the users to enter their location or make it only for use in specific areas (maybe grouped by state?). As I do some more research I should be able to determine the best way to account for location as it relates to sunrise and sunset times. Based on the usability testing I conducted a couple weeks ago, I found that most people preferred a soft transition from the day setting to the night setting and vice versa that is slow and gradual, potentially taking about 20 minutes. I will have to determine if LEDs or Neopixel strips will be better for this task. I have attached both options to my circuit so I can test both.
This week I was able to make significant progress on the circuitry of all three interactions. The basic functionality at this point is pretty much finished. Going forward, I will be fine tuning the code, building enclosures, and soldering the circuits together so they can be integrated into the enclosures to complete the interactions.
Week 6 Reflection
This week I am continuing to fine tune code and circuits, but I am also beginning the fabrication of the enclosures for the electronics and the main bodies of the interactions. After talking to an expert in materials for industrial design I have decided that the best enclosure for my breathing interaction will probably be some kind of pre fabricated plastic sphere. I found a six inch polycarbonate globe that is meant to be attached to a lamp post or ceiling light fixture that should work really well. I ordered that online along with five more LEDs to put inside the interaction to make sure the light fills the globe really nicely.
This sketch shows my plan for the fabrication of this interaction:
Next, I spent way too much time trying to figure out how to calculate the sunrise and sunset times without having to use a microcontroller that has connectivity capabilities. I did a lot of research, wrote a lot of code, did a lot of math, tried several different libraries, and finally cracked it! I ended up using an Arduino library called sunset along with the Arduino Time library. The sunset library is able to return sunrise and sunset times in minutes since midnight. I then wrote a function that converts that into the time in normal hours and minutes. Adjusting for daylight savings was my biggest issue because the dates that it starts and ends are not consistent every year (must be on Sundays). I manually made revisions for this in the code that will work through March 2026. I now have the interaction working so that one set of lights will turn on during the day and then they will switch to another set at night. Right now it s just a binary on and off transition, but my next step will be to implement a light fade for about 10 minutes. In the picture below you can see one LED and half of a neopixel strip lit up signaling daytime. At sunset, the other half of the neopixel strip and the other LED will light up.