Initial interaction: distance sensors & motor
So far the most complicated aspect of our project has been determining the mechanism to turn the plant! We’ve experimented a lot at the advice of our peers, Making Things Move, and Ben Light.
First, we tested with a lazy susan, some gears, and a 360 servo motor. We figured to get the precision we needed we should use a stepper motor, which we got to work with an EZ driver (as opposed to an H bridge). The EZ driver has pins for power (it needs 5V), direction, speed, and the stepper motor itself. Once we got our proximity sensors, we tested a very initial sketch that controls the speed and direction of the turn based on where the sensor detect something.
We spent some time figuring out how to connect the gears to the bottom of the lazy susan, and considered whether we needed a slip ring for the wires that will be connected to the plant with the arduino that will be in the base. After meeting with Ben Light, we think that by using a rubber stopper on our motor and placing this next to we can control the lazy susan directly, but we still need to build this to see if it works.
Sensor data to node.js
My goal is to save sensor data to a database so the first piece of this was getting the serial lab related to this to work. I successfully got the moisture and microphone data into the browser! Now I just need to write the code that sends the data to an MongoDB database (I’m using an MLab account), and serve it as an API.
CO2 sensor calibration
We’re working with this MG-811 sensor module, since this seemed to be one of the least expensive CO2 sensors available, and since we were able to find some sample code to go along with it. To figure out how to calibrate it, we’ve referenced documentation here and for a similar sensor module. From our understanding, this sensor works by outputting a voltage, and as the CO2 concentration increases the voltage output decreases. The code that goes along with it sets a voltage equal to 400ppm as a sort of baseline, and then does math to express changing voltage as CO2 concentration.
We have tapped Marina, George, and former ITP-er Nick Johnson (currently at CUSP) to help us think through how we can calibrate the sensor and connect us to people that might have helpful equipment. After a very helpful e-mail exchange with Nick, who directed us here, here, and here, we think that one solution could be to leave the sensor running at ITP to get baseline voltage readings, and assume this is 400ppm. We should definitely set this up this week!
Box diagram for initial interaction
Aaron Parsekian helped us think through all of the elements we have discussed including the project and where they should go for the distance-sensing and plant movement interaction:
Wireless?
The lowest priority piece right now, and the part I’m least sure will work, is sending the data wirelessly to node rather than having wires. We thought we might be able to use a huzzah wifi module, but to test it on the floor we need to get the mac address from the device, and I’ve already run into trouble. **UPDATE: Was able to read the mac address by printing it in loop instead of setup.
Once we can connect the device to the sandbox network on the floor, I’m still not sure how we will send the data from multiple environment sensors, especially since this works at a higher baud rate.
Updated Project Timeline
We are behind on some things we intended to have complete by now, and ‘/’ indicates these are in progress!
Dates | Tasks | Complete? |
11/16/2016-11/22/2015 | Adafruit order (motor, sensors) | x |
Experiment with sensors (infrared, CO2) | / | |
Buy & weigh plant | ||
Sensor data to node.js | x | |
Node.js to p5 | x | |
Buy motor with right amount of torque | ||
Plan construction of plant holder | x | |
11/23/2016-11/29/2015 | Make first interaction work: approach plant and it turns | / |
Create visualization in P5 based on what we learn about sensor output | ||
Write Node.js code to read sensor data & set up database | / | |
11/30/2016-12/6/2015 | Connect sensors to node to p5 | |
Build coin box (scrap wood and copper tape) | ||
12/7/2016-12/13/2015 | Make second interaction work: add reaction for coin drop | |
Build stand alone website | ||
12/14/2016 | Project Due! |
Updated BOM