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

Wednesday, May 20, 2015

Week 7 (Outside Lab) - Insulation & Electrical Box

The team used this time to complete insulation of the relay with electrical tape, which is shown in Figure 1.

Figure 1. Relay completely insulated with electrical tape. 
The team also began construction of the box that will house all electrical components. This is basically a small cardboard box with three holes in it for cords that need to connect to external components. The box used, unmodified, is shown in Figure 2.

Figure 2. Cardboard box to be used for electrical component housing.
On Side 1 (shown in Figure 3), there is one hole for the power cord to plug into the wall outlet. On Side 2 (also in Figure 3), there are two holes: one for the USB cord from the Arduino to a computer, and one for the power cord running to the pump and water container. All holes have a slit running from the hole to the top of the cardboard, which allows insertion of the cords without threading everything through the holes.

Figure 3. Sides 1 and 2 of box after holes and slits have been cut for power cords. 


Friday, May 15, 2015

Week 7 (Outside Lab) - Fixing Software & Modifications

During this time, the team was able to figure out the likely source of the coding error, and also encountered an unexpected mechanical problem with the pump. The details of each operation are laid out below:
  • To figure out what was going wrong, Davina hooked the Arduino back up to a simple LED circuit and used the LED as a visual indicator of code function. This works directly with the PlantParent control application because the application is functionally identical to an application that controls blink-time of an LED. Previously, some cursory tests with an LED had revealed that it behaved in accordance to the actual settings on the computer; this made no sense, because due to the electrical system's wiring error, the programming should have been set up to make the LED behave in reverse of the settings. 
    • The problem that Davina identified was that the on, off, and corresponding delay statements were mixed up and used the wrong integers sent from the computer application. This resulted in the on-times and off-times being switched. The error is highlighted in Figure 1 below. 
Figure 1. Mixup of on ("LOW") and off ("HIGH") statements in Arduino code, and subsequent solution.
    • This was also probably the source of the inability to terminate the program - which is what had been happening. Since the termination command simply breaks the on-off loop, the program reverts back to the first setting of the output pin. While it was mixed up, the first setting was on, so clicking "Cancel" made the pump run indefinitely instead of turning it off. 
    • There had also been a mix-up of the variable names in the Qt application, which Davina had fixed on Wednesday, but had previously been compensating for the error above. This was something like a triple-negative sort of logic that got reduced to a double-negative, and is now down to one negative as it should be. 
  • The team found that while at least partially immersed in water, the pump would continue to deliver water through the plastic tubing even when unplugged. This was very confusing at first, but eventually Michelle realized that in blocking one hole and using the other as the single output, the team had essentially created a vacuum inside the pump, which allowed the water to flow through without any mechanical impetus other than air pressure. 

Thursday, May 14, 2015

Week 7 (In Lab) - Soldering Relay System

Figure 1. Relay with soldered wires. Black tubing: hot wire on pump side. Yellow tubing: 5V input from Arduino. Green tubing: ground on Arduino. Uninsulated connection: hot wire on plug side.
In lab this week, the team was able to solder all wires directly to the relay, eliminating the need for alligator clips. This was advantageous to the project for two reasons: 1) soldering provides more secure connections all around (the team was having some trouble with electrical tape coming off and some connections coming undone), and 2) soldering decreases the overall system length by about two feet of cords, making it much easier to fit inside a single container. 

Three of the connections were partially insulated with heat shrink tubing. Additional insulation with electrical tape (as well as complete insulation for the fourth connection) is needed. The lack of heat shrink tubing on the fourth connection was not intentional and should not be purposely replicated if this project were to be repeated. Figure 1 shows the relay with all soldered wires.