Overview of Final Design
Figure 1. Schematic of overall design solution
Figure 2. CAD drawing of final design solution
Figure 3. CAD drawing of the Chamber Assembly
Hardware Setup
The Chamber Assembly consisted of five components, which were Chamber, Chamber Case, Chamber Cap, Peltier and CPU Cooler. The Chamber Cap was transparent. The chamber was 3D printed by Project 3510 HD using material VisiJet M3 Crystal and the cap made of clear acrylic and cut by LaserCamm. There was one 0.4mm diameter hole on the side of the wall, which allow air flow to keep the fruit fly alive. The cap was placed on the top of the chamber body, and they were fastened together with the Chamber Base by screws. The gap between the Chamber and the CPU Cooler allowed some space for the Peltier. Fig.3 showed the CAD figure of the Chamber Assembly. The Stage Assembly consisted of five components, which were Aluminum Base, Webcam Stand, CPU fan, Webcam and Webcam Holder. The CPU Fan was adhered on the aluminum base by 3M Scotch Mounting Tape. The Webcam Stand was mounted by screws on the Aluminum Base and held the webcam in a fixed height. Fig.4 showed the overview of final design.
Electronic Components
Arduino Uno Microprocessor board was used to control the temperature. Proportional integral and derivative (PID) controller was used to achieve a rise time within 1 second. A high current H-bridge was used to connect the 12V power supply and Arduino board. A PWM signal could be sent to the Peltier both in forward and reverse direction for the purpose of heating up and cooling down respectively. Furthermore, Arduino was receiving a binary signal from the serial port that was connected to a laptop, which indicated the position of the fruit fly. When a signal was received, the LED light bulb connected to one of the digital pins of Arduino was turned on to indicate one successful signal transfer. A thermistor was used as a temperature sensor for the purpose of feedback. It was connected in series with an 8.25kΩ resistor as suggested in thermistor spec sheet. The voltage between the thermistor and the 8.25 kΩ resistor was amplified through a designed circuitry so that a wide range of bit number could be used to achieve a higher precision.
Figure 4. Schematic of the electronic components
Software Components
Image processing algorithm was written in Matlab. The temperature control algorithm was written in Arduino IDE. Matlab processed each image to determine the position of the fruit fly and output a binary signal to Arduino through serial port. Arduino Uno received the binary signal and determined the temperature set point, either 23oC or 38oC.
System Performance
A real fruit fly was put into the chamber, and the system was allowed to run for 10 minutes. A LED was connected in the circuitry to indicate the status of the system. When the LED was on, the temperature of the Peltier was increasing. When it was off, the temperature was decreasing. The output of the system was a plot of position vs time, with a middle line added to the plot to indicate the center of the chamber. Predictions was that the fruit fly would explore the chamber for the first 3 to 5 minutes, and it would stay at the comfort zone. For the first experiment, the left side of the chamber was assigned as the punishment zone and the right side as the comfort zone. An additional experiment was done to verify that the fruit fly did not have a side preference. By switching the punishment and comfort zones, the experiment was repeated with the same fruit fly. Figure 5 and 6 showed the two output plots.
Figure 5. Position vs time plot (left side hot) Figure 6. Position vs time plot (right side hot)