Showing posts with label Week 4. Show all posts
Showing posts with label Week 4. Show all posts

Tuesday, April 28, 2015

Week 4 (Outside Lab) - Software Experimentation

Figure 1. The brightness of an LED at different values set by a computer GUI.
At this meeting, the experimental graphical user interface (GUI ) and application were finished, and a small dialog box with a slider on the computer was able to control the brightness of a red LED. Figure 1 shows the relative brightness of the LED when the slider is set to values of 0, 26, and 195 (the minimum and maximum values were 0 and 255, respectively).

The code used for this experimental app can now be used as a basis for the actual PlantParent user control app, since it already connects the Arduino with the computer via Qt application. The next step is to create a computer app that can control the wait-time between blinks of an LED, including a termination command, which more directly corresponds to the structure of the code necessary for control of the PlantParent. 

Davina was able to write up an initial version of the Arduino code for this second step, which allowed us to control the blinking of the LED (using the Arduino serial monitor, not Qt yet), but only in a very limited way: either it would only blink on and off once after receiving a command - or, after putting the "blink" part of the code in a loop, it would blink endlessly with no way to break the loop with a serial command. Further research will hopefully mitigate this problem. 

Friday, April 24, 2015

Week 4 (Outside Lab) - Pump Modifications

Figure 1. Modified aquarium pump with plug to redirect water flow.
The team used this time to begin modifying the aquarium pump and better understand the relay system before wiring up the whole electrical system. The pump's original purpose is to create an artificial current by sucking up water through the bottom and pumping it back out through a tube with an output hole and a valve for oxygenating the water. The valve fits our purchased plastic tubing, which will be used to carry water to the plants, so it was necessary to block up the original output hole in order to redirect the water flow through the valve instead. This was accomplished with hot glue, as shown in Figure 1.

In addition, a reference diagram of the relay was created for the purpose of identifying its pins. This can be seen in Figure 2.

Figure 2. Reference diagram of relay's pins. 


Thursday, April 23, 2015

Week 4 (In Lab) - Major Progress!

Figure 1. A schematic showing how the relay-Arduino-pump circuit will work.
This week's lab yielded a lot of progress for the team on all fronts, as listed below:

  • Dr. Boettcher pointed out that the solution to our electrical problem (the conflicting 5V DC and 120V AC output/input for the Arduino and aquarium pump) could be greatly simplified by using the relay that was included in the purchased breadboard starter kit, as laid out in the schematic in Figure 1. The team had previously not realized that the relay could be used for this switch, and this new solution eliminates the need for a separate power source or a custom AC outlet, plus all the complicated wiring involved with that process. 
    • During this lab and under Dr. Boettcher's guidance, Parm and Le were able to cut the aquarium pump's power cord and strip one of the wires in preparation for soldering. The stripped wire and power cord can be seen in Figure 2. 
Figure 2. Severed power cord for the aquarium pump, with one wire stripped. 
  • Michelle tested the aquarium pump and determined the level to which it needs to be submerged in order to work. The team also acquired two gallon-size clear plastic containers from the lab's resources that can be used to prototype and eventually build the actual PlantParent's water reservoir. These containers are fairly shallow relative to the pump and will require the team to make several new modifications, such as cutting off the bottom of the pump in order to let it sit lower in the container. 
  • Davina continued to work on the Arduino and GUI coding and was able to make a sketch that controlled the brightness of an LED through serial commands sent to an analog pin. This is not yet integrated with the GUI, though the GUI can now search the computer's serial ports and find the Arduino. Once the two are fully connected and it is verified that the whole system works, the team will be able to modify the code slightly so that it controls the timing of the pump rather than LED brightness.