Ryan Courtney Senior Design II Advisor: Junkun Ma
Design Dual-Axis Solar Tracking System o Feedback Control Light Intensity Sensor Microcontroller (Arduino) Dual-Motor Setup o Wireless Communication XBee Radio
Position a solar panel to receive maximum light intensity Integrate wireless communication Achieve positioning using two axis of freedom as opposed to one
Software o Arduino Programming Environment o Algorithm Hardware o Light Sensor o Frame o Microcontroller o Wireless Modules o Motors and H-bridges PWM to Analog Low-Pass Filter Design
Arduino Programming Environment o Based on language known as Processing o Processing based on C++ o Allows for composition and troubleshooting of Arduino code known as “sketches” o
Algorithm o Broken into two major pieces Sender Receiver
VariableValueDescription top0Top sensor pin bottom1Bottom sensor pin left2Left sensor pin right3Right sensor pin linearPot5Potentiometer pin for linear actuator control tol_v10Tolerance for vertical sensors tol_h10Tolerance for horizontal sensors dark20Darkness threshold wait5000Delay interval (5 seconds) vMotor9Vertical motor PWM pin up40Vertical motor speed up down200Vertical motor speed down cease127Value to stop vertical motor MAX950Maximum distance to allow actuator to extend (obtained from linearPot) MID500Point at which linear actuator has system at 45º angle (obtained from linearPot) MIN200Minimum distance to allow actuator to extend (obtained from linearPot)
Startup Position at 45º angle Initial Check Average Sensors Wireless Sender (Horizontal Motor) Control Vertical Control Horizontal Check Dark (not for use indoors) Delay (when balanced)
Sends numeric codes to wireless module for horizontal motor control
CodeNameDescription 0StopStops horizontal motor 1hRIGHTSignals horizontal motor to turn right 2hLEFTSignals horizontal motor to turn left 3vUPSignals that vertical motor is moving system up 4vDOWNSignals that vertical motor is moving system down 5balancedSignals that system is balanced 6startSignals that startup function has begun 7finishSignals that startup function is complete
VariableValueDescription Hpwm9Horizontal motor PWM pin left0Horizontal motor speed left right255Horizontal motor speed right cease127Value to stop horizontal motor
Error Check Main loop Stop Horizontal Motor
Keeps motor at halt if no data is available Ensures code sent is within the correct range Returns code when correct
Light Sensor Frame Microcontroller Wireless Modules Motors and H-bridges o PWM to Analog o Low-Pass Filter Design
Use property of photoresistors Layout in grid pattern Use comparisons of resistors Balance sensors on most intense light
Use plywood for structure Two degrees of freedom Maximum vertical adjustment is 63º Minimum vertical adjustment is 23º Horizontal adjustment is 360º
MicrocontrollerATmega328 Operating Voltage5V Input Voltage (recommended) 7-12V Input Voltage (limits)6-20V Digital I/O Pins 14 (of which 6 provide PWM output) Analog Input Pins6 DC Current per I/O Pin40 mA DC Current for 3.3V Pin50 mA Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader SRAM2 KB (ATmega328) EEPROM1 KB (ATmega328) Clock Speed16 MHz Arduino Uno/Duemilanove (x2)
Use Wireless Shield to snap to Arduino (top) Use XBee radios snapped to wireless shields (bottom) Wireless communication via serial commands
24 VDC Slewing Drive motor for horizontal motion (top) 12 VDC Linear Actuator with potentiometer feedback for vertical motion (bottom)
Sabertooth 2x25 (top) and 2x12 (bottom) used as H-Bridges 0-5V input from microcontroller 0-2.5V input signal for reverse 2.5V for stop 2.5-5V input signal for forward
Pulse Width Modulation (PWM) is digital representation of analog signal in square wave form Sabertooth H-Bridge cannot accept digital/PWM signal Sabertooth H-Bridge can accept analog signal Use low-pass filter to condition PWM signal to smooth analog signal
1 KΩ resistor 1 uF capacitor F = 1/2πRC to calculate Frequency of filter Filter frequency is 15.9 Hz Frequency is sufficient for the rate of change of the project
Wireless communication between Arduinos Dual-Axis movement Tracks light intensity Balance on most intense light
Light Sensor (Single Component) Control of Two Individual Motors Wireless Communication Single System Source Code Block Diagram
Date (Week of)Task 2/6/2012 Amend Proposal 2/13/2012 Select and Test Method of Motor Control 3/5/2012 Research/Implement Wireless Communication and Begin Assembly of Final System 3/12/2012 Assemble Light Sensor into Single Component and Continue Assembly 3/19/2012 Continue Assembly 4/2/2012 Complete Assembly and Begin Tests 5/4/2012 Final Presentation