Difference between revisions of "Team:Newcastle/Circuitry"

Line 170: Line 170:
 
<p style="font-size:100%">Stage two of the build was to be able to control the day and night cycle (16-8 hours) to allow proper plant growth. One method to implement this would be to break the circuit from the ‘Vdd’ line (power line). We decided to pursue this method as it would reduce the power consumption when the night cycle was in effect.</p>
 
<p style="font-size:100%">Stage two of the build was to be able to control the day and night cycle (16-8 hours) to allow proper plant growth. One method to implement this would be to break the circuit from the ‘Vdd’ line (power line). We decided to pursue this method as it would reduce the power consumption when the night cycle was in effect.</p>
 
                     <p style="font-size:100%">In order to break the power line there needs to be two pin outs, pin 11 for the data line and 12 for the switching circuit. 11 determines the light intensity and function of the lights. After a 16 hour cycle pin 12 is written to ‘LOW’ (logic zero), which turns a N channel power MOSFET off for 6 hours. This sequence would repeat every day.
 
                     <p style="font-size:100%">In order to break the power line there needs to be two pin outs, pin 11 for the data line and 12 for the switching circuit. 11 determines the light intensity and function of the lights. After a 16 hour cycle pin 12 is written to ‘LOW’ (logic zero), which turns a N channel power MOSFET off for 6 hours. This sequence would repeat every day.
                     <p style="font-size:100%">We encountered  some issues when implementing this design, which appeared to be caused by the Arduino’s pin out voltage of 3.3V. Despite the MOSFET’s threshold voltage being between 1-2V [1], it should be adequate, however, the voltage at the source (MOSFET output) was measured to be 3V,  and the LED’s need at least 4.2V.</p>
+
                     <p style="font-size:100%">We encountered  some issues when implementing this design, which appeared to be caused by the Arduino’s pin out voltage of 3.3V. Despite the MOSFET’s threshold voltage being between 1-2V [2], it should be adequate, however, the voltage at the source (MOSFET output) was measured to be 3V,  and the LED’s need at least 4.2V.</p>
 
                   <p style="font-size:100%">This meant that we had to go back to the drawing board. Our second iteration was based on a NAND gate; the truth table shown below illustrates the function of the gate .</p>
 
                   <p style="font-size:100%">This meant that we had to go back to the drawing board. Our second iteration was based on a NAND gate; the truth table shown below illustrates the function of the gate .</p>
  
Line 305: Line 305:
  
  
                   <p><font size="3">1. Ada Fruit, "icharging", 5 Aug 2010; https://learn.adafruit.com/minty-boost/icharging, 5 Aug 2010.</p>
+
                   <p><font size="3">1. Ada Fruit, "icharging", 5 Aug 2010; 'https://learn.adafruit.com/minty-boost/icharging', 5 Aug 2010.</p>
 +
 
 +
<p><font size="3">Rapid; 'https://www.rapidonline.com/pdf/162663_da_en_01.pdf' </p>
  
  

Revision as of 12:35, 16 October 2018

Alternative Roots/Circuitry

Stage One

Powering

Two options are available for powering the device: mains, or battery. To increase the flexibility of the system it was designed to be able to use both power sources; however, we recommend the use of mains power due to the limited capacity of batteries. The Arduino and LED lights draw a constant 5 V, therefore the system requires at least four 1.5V AA batteries, giving a nominal 6 V. To protect the circuit this would require a voltage regulator, which can get hot with a sustained 1.5 A current draw from the lights. Given the constant drain on the batteries, the system does not perform well when the battery voltage drope below 3.5V. To address this problem, we adapted a regular USB phone charger, which safely steps down mains voltage to 5V. We do not recommend building your own version of this!

In a phone charger cable there are live (Vdd), ground (GND), and two data lines (-D, +D) the latter two are not necessary for our application due to their voltage rating, shown in Figure 1.0 (2.76V, 2.06V). Therefore, these wires can be either trimmed shorter than Vdd and GND or taped up, to avoid a short circuit in the system. For the example shown in Figure 1.1; red is power, black is ground, and the white and green wires are the data lines, however we recommend confirming this is by checking the voltage from Vdd, D+ or D- to ground with a multi-meter.

When powering the Arduino, a capacitor is needed in parallel to protect it from surges in voltage, which could otherwise damage it. In order to protect the LED lights, there needs to be small 330 Ω resistor on the data line. A circuit diagram can be found in Figure 1.2, which details the correct set up.

The LEDs used also took a 5V DC power supply, which was one of the justifications for using this particular product, as it means that they can be powered from the same source as the Arduino.


Figure 1.0; Schematic of a standard USB cable. [1]


Figure 1.1: Above is 4 exposed wires. Red is power, black is ground,white and green are the data lines. [1]


Figure 1.2: Schematic demonstrating how to power the Arduino and the LED's, made on fritzing.

ROUGHLY
2
AMPS ARE PULLED
FOR THE WHOLE SYSTEM
APPROXIMATELY
70
KWH OF POWER ANNUALLY
USED TO POWER SYSTEM
PROVIDES UP TO
1700
LUX OF LIGHT
TO GROW SEEDS
CONTAINS
120
INDIVIDUALLY ADDRESSABLE
LOW-POWER LED'S
================================================== -->

Stage Two

Control

Stage two of the build was to be able to control the day and night cycle (16-8 hours) to allow proper plant growth. One method to implement this would be to break the circuit from the ‘Vdd’ line (power line). We decided to pursue this method as it would reduce the power consumption when the night cycle was in effect.

In order to break the power line there needs to be two pin outs, pin 11 for the data line and 12 for the switching circuit. 11 determines the light intensity and function of the lights. After a 16 hour cycle pin 12 is written to ‘LOW’ (logic zero), which turns a N channel power MOSFET off for 6 hours. This sequence would repeat every day.

We encountered some issues when implementing this design, which appeared to be caused by the Arduino’s pin out voltage of 3.3V. Despite the MOSFET’s threshold voltage being between 1-2V [2], it should be adequate, however, the voltage at the source (MOSFET output) was measured to be 3V, and the LED’s need at least 4.2V.

This meant that we had to go back to the drawing board. Our second iteration was based on a NAND gate; the truth table shown below illustrates the function of the gate .

Vdd Pin 12 Output
0 0 1
0 1 1
1 0 1
1 1 1

Highlighted in red are the two functions we are interested in. Since ‘Vdd’ will always be read as ‘high’, 5V, we can eliminate the first two states and ‘Vdd’ making the logic straightforward. The basic operation is inverting P12 logic. When implemented in our device, the logic worked as predicted; however, the 2A current demand of the LEDs caused the gate to heat up and become unstable in its operation. Iteration three involved the implementation of a relay switch; however, this was also limited in terms of the current draw and heating of the system. In our final iteration we discovered we could achieve the desired result through the code. Changing the brightness from a defined integer, to an 8 bit integer, allowing a range between 0-255. Setting the brightness to ‘0’ would turn the LEDs off. The code can be seenhere.


Figure 2.0; The engineers, hard at work trying to troubleshoot issues with the system.


Figure 2.1; The finished product, set to a rainbow function that cycles through various wavelengths of light

================================================== -->

Stage Three

LED Wiring

The final device has 5 LED strips spaced equally across the lid to give a constant light level for the seeds. These strips are connected in parallel to one another, which means they all cycle through the same colours at the same time. Meaning from the point of view of the LED the data line (pin 11) appears the same. In order to allow the lid to be removable we fed the wires through a hole on the side of the lid, which was soldered onto a vero-board where a crimp housing was connected, allowing us to unplug the lid and remove it when the hydroponic solution was added. This reduces the potential for water damage to the lid. As an extra precaution, we insulated the exposed metal contacts on the LEDs and vero-boards, with a hot glue gun which also adds structural security.


Figure 3.0; Image of parallel wiring layout and insulated contacts





REFERENCES & Attributions

1. Ada Fruit, "icharging", 5 Aug 2010; 'https://learn.adafruit.com/minty-boost/icharging', 5 Aug 2010.

Rapid; 'https://www.rapidonline.com/pdf/162663_da_en_01.pdf'

Attributions: Luke Waller, Umar Farooq