This project is a Solar Tracker with live data feed powered by the Windows IoT Core running on the Raspberry Pi 2. It is built up of 2 main parts; The Raspberry Pi running as the main controller and an Arduino which takes care of moving the servos and taking the light measurements. The Raspberry Pi has a prototyping board attached to the top to make the connections neater. On that board is a MCP3008 ADC Chip and a Logic Level Converter. The MCP3008 connects to 2 Voltage dividers (One for solar (Max 30 Volts) and one for Battery (Max 15V)) and the ACS715 Current Board. The Logic Level converter connects to the I2C lines and then to the Arduino. The Arduino has 4 Light Dependant Resistors and 2 Servos.
The Raspberry Pi 'HAT'
The Raspberry Pi side components can be mounted on a prototyping board such as the PiBreak Plus from Freetronics. On this board the Logic Level converter and MCP3008 ADC chip are mounted. There are terminals and headers for connecting to the other components of the project.
To construct the board refer to the schematic above. The components on the left side of the schematic are the parts for the Raspberry Pi (Minus the servos). Start by soldering the 16 Pin IC socket and Logic Level converter (Refer to images) then the headers and terminals. After that solder the wired connections. The PiBreak Plus makes wiring the connections easier by providing a breakout of all the pins. To make the connections refer to the schematics and images above.
The Arduino and Movement System
The Arduino is responsible for controlling the drive gear (2 Servos in this case). It receives commands from the raspberry pi via I2C then translates that information into drive commands for the servos. In this example there are two servos (horizontal and vertical) that move the panel and Light Sensor Board. In a permanent setup, servos may not be practical. A more practical option may to use a bigger motor or a worm drive system. However dependant of the drive system the Arduino side code can be easily changed to suit your setup.
Upon looking in the code you will find several voids towards the bottom. The voids begin with killAll().
killAll() simply disengages the servos so that they are free moving.
systemResume() reengages the servos so that they are ready to receive commands.
homeServos() positions the servos in there neutral position. This occurs before killing the servos.
runTracker() position the servos dependant on the light position.
forceServo() forces the servos into a certainty position (Note: Max input is 180. This can be changed in the Raspberry Pi side code.
Commands Received by Arduino:
- Kill System - 0x00
- Resume System - 0x01
- Home Servos - 0x02
- Force Servo (Any) - 0x0A
- H Servo - 0x0B
- V Servo - 0x0C
- Pos to Send - DEC (variable)
- Run Tracking System - 0x0F
The Voltage dividers and LDRs
Voltage Sensor Board
The Light Sensor Board has 4 Light LDRs with a separator (to block the light) in between them. This is so that a shadow is cast over the LDRs when a light source is not exactly above them. The board once assembled is then attached to the same mount as the solar panel then connect each of the 4 channels (LDRs) to there corresponding pins as follows:
•TOP LEFT - A0
•TOP RIGHT - A1
•BOTTOM LEFT - A2
•BOTTOM RIGHT - A3
Putting it All together
Now its time to wire it up. Start by wiring the solar panel to a regulator and wire the rest as shown in the above image. Remember the battery input has a limit of 15 volts, so if you need higher change the voltage divider (and some code). Have the voltage monitors in parallel to the incoming voltage and have the ACS715 in series to the load. Also remember the ACS715 has a limit of 30 Amps and 30 Volts.
Once power connections have been made connect each input to the channel on the raspberry pi (see schematic) and connect the servos and LDRs to the Arduino then wire the I2C lines in.
You may also want to power the Arduino and Pi by the solar panel so add the correct voltage regulator. Now plug in a monitor to HDMI and connect a mouse and move on to programming.
First things First
Find and open the Arduino software then upload to your Arduino (or compatible) board.
Then find and open the Raspberry Pi software. Open the WindowsIOT_SolarTracker.sln file. Change the platform to ARM and select your remote device (refer to here for help) then press F5 or Deploy to upload the code.
If all is well you may want to set the app to automatically launch on start up. Refer to here for more information on that.
Now your all finished. Enjoy!