2. Method and Experimental Design

2.1 Equipment:  
The following shows the list of equipment that we will use.

  • Waterproof Temperature Sensor (DIY) [x1]
    • LM-35/TMP-36 temperature sensor [x1]
    • USB cables (cut open) [x1]
    • Aquarium-safe Silicone Gel [x1]
    • Pen Case (Hollow Tube) [Approximate Length: 10cm]
    • Black duct Tape [x1]
  • Arduino® Uno Set (Including Books, Device, Tool box etc.) [x1]
  • Jumper Wires [x29]
  • Standard Solderless Breadboard (half-length) [x1]
  • 10 kΩ variable resistor potentiometer [x1]
  • TC1602A LCD Display [x1]
  • 1x16 Standard Pin-header [x1]
  • Vanson® Universal Regulated AC/DC Adapter [x1]
  • Standard Solderless Breadboard (full-length) [x1]
  • Crocodile (spring) clips [x3]
  • W612 - 2 Channel HI/LO Relay Board[x1]
  • 1N4148 Diode [x1]
  • 330Ω Resistor [x1]

(Used for the substitution of the chiller)
  • 1.5V ‘D’ Batteries [x4]
  • 5V DC Motor [x1]

2.2 Diagram

Fig. 1.1. Setup of the Temperature Control System

2.3 Procedures

Procedures Part A - Construction of Temperature Sensor
  1. Acquire materials for temperature sensor construction
    1. TMP-36 sensor or LM-35 sensor
    2. Pen casing (Hollow tube)
    3. USB cable
    4. Aquarium-safe silicone gel sealant
    5. Duct tape
  2. Cut off the Type B USB plug at one end of the cable.
  3. Remove 2.5 cm of cable jacket at where the Type B plug was removed and strip the ground (black), data(white) and positive (red) wires from their individual jackets.
  4. Solder each of the three pins of the LM-35 Sensor/TMP-36 to each wire, ensuring that the colour-coded wires are attached to the respective pins on the temperature sensor. The main temperature sensor we would use is theLM-35 sensor (Fig. 2.1.)
  5. Wrap black duct tape around the ground and positive wires of the TMP-36 Sensor to ensure that each pin does not interfere with each other.
  6. Slide the sensor into the pen casing and place the nozzle of the aquarium-safe silicone gel sealant over the pen casing. (Fig. 2.2.)
  7. Start squeezing the silicone sealant through the pen casing and ensure that the whole pen casing is filled with silicone.
  8. Slide the sensor out so that it sticks out of the pen casing by about 2mm.
  9. Wipe excess silicone from the head of the sensor.
  10. Leave the temperature sensor to dry for 48 hours.
  11. Remove the Type A USB plug at the other end of the sensor and solder jumper wires of the differing colours to each individual colour-coded wire to allow easier and a more stable connection to the Breadboard. (Fig. 2.3.)

Fig. 2.1. Soldered LM-35 Temp Sensor              Fig. 2.2. Temperature sensor prior to
      being filled with silicone gel

Fig. 2.3. Completed Waterproof Temperature Sensor

Procedures Part B - System Setup
  1. Solder the 16x1 pin header to the 16 contacts of the LCD display. After that, use jumper wires to connect the 16 pins from the LCD display to the half-length breadboard that is directly linked to Arduino.
  2. Connect the temperature sensor's three pins to the half-length breadboard according to the connection diagrams given on the temperature sensor's data sheet. The diagram will show which pin is the +Vs (for power supply), Vout (signal pin), or the GND (Ground pin). Use jumper wires to connect the +Vs and the GND pins of the sensor to the breadboard’s positive rails and negative rails respectively. Following that, connect the temperature sensor’s signal pin to the analog outputs.
  3. Connect the relay to the Arduino breadboard using jumper wires. For the relay, a full-length breadboard is used. Connect the GND (ground) on the negative rail of the breadboard to the Arduino’s GND pin. After that, connect the Common (C) contact to a 330Ω resistor, which connects to the positive end of the four connected 1.5V batteries. Secondly, connect the negative end of the batteries to the GND wire of the DC motor. After that, ensure that the positive wire of the DC motor is connected to the Normally Open (NO) contact. Then, create a parallel circuit that leads between the DC motor’s GND wire & the negative end of the batteries, and the DC motor’s positive wire & the Normally Open. After that, connect the Signal contact on the relay board to Pin 6 (digital pin) on the Arduino, and the Common GND contact on the relay board to the GND rail on the full-length breadboard. Finally, ensure that a 12V power source is connected to the ‘DC IN’ contacts on the relay board.

Fig. 3.1. Circuit Diagram of the Relay

Fig. 3.2. Relay Wiring Sketch

Procedures Part C - System Programming
  1. In the IDE sketch, declare the variables “sensor” and “relay” with a number that represents the respective digital/analog input pins they are connected to. This command specifies that the variable is connected to a particular pin on the Arduino’s digital or analog pins. See Fig. 4.1 and Fig. 4.2. for such examples.
  2. Inside “void setup”, which is the setup function of the code, use the “lcd.begin” command to specify how many columns and rows the LCD display has. Then, use the “pinMode” function to set the variable “sensor” as an INPUT and the variable “relay” as an OUTPUT. This will specify the type of pin that each variable is using.
  3. Start a serial connection from the Arduino to the computer so as to send back the data to the computer (via a USB cable). Set the baud rate (number of pulses per second) to 9600.
  4. Inside “void loop”, which is the where the main behavior of the device is specified, program the Arduino such that it processes the raw voltage values from the temperature sensor and turn it into a degree Celsius value.
  5. Add the “lcd.print” command on the sketch to allow the LCD display to display the temperature sensed by the temperature sensor in degree Celsius.
  6. Add in the code that will switch on the relay upon reaching 27ºC and switch off the relay when the temperature is less than 27ºC. For this section of the code, it will use “digitalWrite(6, HIGH)” command to turn on the relay and “digitalWrite(6, LOW)” to switch off the relay. The ‘6’ in the commands can be replaced with the number of the pin that the relay is connected to.
  7. Set a delay of 1 second using “delay(1000)”. This will prevent the relay from spoiling prematurely due to the speed it has to turn the switch on or off and will ensure the the data is sent by the temperature sensor every 1 second.
  8. Close the “void loop”.

Fig. 4.1. Arduino IDE sketch for the full system with the LM-35 temperature sensor

Fig. 4.2. Arduino IDE sketch for the full system with the TMP-36 temperature

Procedures Part D (Calibrate System)
  1. Calibrate the programming prior to finalising the code such that the values given by the sensor in Volts are converted to degrees Celsius so that it can be shown on the 1602A LCD Display, and are consistent across all temperatures. See Fig. 5.1. and Fig. 5.2. for the exact calibration for each temperature sensor.
  2. Configure the jumper on the relay to set the relay activation on an “active high”, where only a voltage pertaining to a particular temperature range > 27ºC can switch on the relay. Conversely, a voltage pertaining to a range of ≤ 27ºC will switch off a relay.

Fig. 5.1. Calibration of the LM-35 sensor

Fig. 5.2. Calibration of the TMP36 sensor

2.4 Risk Assessment and Management
  • List: Handling electricity is always risky. It is a necessity to be careful when handling electronics, not just to prevent unwanted electrocutions due to its current, but also to ensure that the Arduino device or other electrical components does not get damaged. The soldering iron and the silicone gel also poses a risk when we have to use it. The list of sensors, procedures or devices at risk or posing a risk are as follows.
    • Temperature Sensor
    • Arduino Data Logger, LCD display and other electrical components
    • Soldering Iron
    • Silicone gel
  • Assess: There might be a possible risk in handling the temperature sensor and the Arduino data logger as there might be a significant amount of voltage. Secondly, handling the Arduino or any other electrical components with wet hands might cause expensive damage to the Arduino or the electrical component, which we cannot afford to repay. At the same time, that will cause a major inconvenience while trying to locate where to buy the hardware. The waste of time will be detrimental to the progress of the project.  Thirdly, the soldering iron poses a risk, with the fact that if the soldering iron touches the skin, may cause third-degree burns and serious flesh damage. Fourthly, the silicone gel, when uncured, may cause irritation when exposed to the naked eyes, and pose a danger to the eyes when in contact. It may also irritate skin and stick onto skin. Lastly, if the pins of the temperature is aligned incorrectly, the temperature sensor spoil and overheat, making the sensing surface extremely hot and posing a risk of scalding.
  • Safety Measures: Firstly, to deal with the risks, the temperature sensor had been waterproofed with 100% silicone gel sealant. At the same time, steps must be taken to ensure that the area around the Arduino is dry and there are no frayed wires. A towel should be kept constantly near to wipe away any water near the Arduino or other electronics. Secondly, when using the soldering iron, it must be done so under supervision and instructions of the laboratory technician or the teacher. Thirdly, when applying silicone gel, ensure that gloves are worn on both hands, and that goggles are worn. Fourthly, when connecting the pins of the temperature sensor to the circuit, ensure that the correct pins are connected to the circuit as the temperature sensor will be damaged and will overheat, which would scald us when we are trying to remove it. If the sensor overheats, switch off the circuit and remove the sensor carefully only when it cools down.
  • Proper Disposal: When turning off the soldering iron, it must should be cleaned by dipping the iron into the tip cleaner before being placed back on its stand properly. The tip of silicone gel tube should be cleaned off after usage, and any spillage should be cleaned and removed to avoid hazard to other people. The waste tissue used to clean off the gel should then placed in a wrapped plastic bag and disposed in the bin to prevent the fumes from irritating the eyes of other lab users.

2.5 Data Analysis

Sensor Testing
  1. After the setup of the Arduino, temperature sensor and the LCD display, switch on the Arduino and check that the temperature displayed on the LCD display is of a logically acceptable range with regards to the surrounding environment (roughly around room temperature of 25ºC to 27ºC).
  2. Firstly, to verify the temperature sensor is working, we would use a separate temperature sensor, the TMP-36, to verify the temperature of the room for 1 minute. Deploy the LM-35 temperature sensor at the same location and record down data from both sources. Data should come in at a rate of one reading per second.
  3. Secondly, place the separate TMP-36 sensor and the temperature sensor on a heated object, which for convenience we will use a MacBook. The MacBook must have been running for 30 mins continuously, before the sensors are placed side-by-side on its edge. Record the data for 1 min. Gather the data from the LM-35 sensor and compare with the data of the separate TMP-36 sensor.
  4. Tabulate the data and plot a graph of the temperature against time for each temperature sensor device.
  5. The graph of readings from the LM-35 temperature sensor when compared against the TMP-36 temperature  sensor should be showing a similar increase/decrease of the readings, and the reading should be the same when rounded off to the nearest degree Celsius. When both temperature vs. time graphs of the two temperature sensors show a similar increase/decrease in the readings, it will verify that the temperature sensor is working accordingly.

Temperature Control System Testing

  • The Arduino will log and record the temperature once per second, which is displayed in the serial port of the Arduino. The temperature data in degrees Celsius is displayed on the LCD display, as part of our design to ensure that aquarium owners easily view the temperature of their aquarium. We will compare the data gathered from the temperature sensor with the advised levels of the temperature that is appropriate for fishes to live in, i.e. 24ºC - 27ºC.
  • The optimal temperature of an aquarium lies within 24ºC to 27ºC. The Arduino in this case is programmed such that any temperature value rising above 27ºC will turn on the relay, while a value that is equals to or less than 27ºC will turn off the relay. The relay is a switch that is wired such that it can control the connection of the power source to the chiller substitute (i.e., DC motor).
  • The relay is switched on on only when the temperature reading rises above the threshold temperature of 27ºC, thus allowing current to flow to the DC motor and start powering it. Test the system on 4 different occasions for 1 minute each, while recording down the temperature values, the status of the relay switch mechanism, and the status of the motor every second.
  • Compile a table based on the data such that it shows the temperature with the motor status. For every temperature reading below 27ºC, the status of the motor should be read as ‘off’. Only when the temperature reading is above 27ºC should the motor status be ‘on’. Such results will confirm that our preliminary temperature control system is working.

No comments:

Post a Comment