Introduction: Telemetry With Solar Cell

Telemetry - Solar Cells

Our project is using Arduino with the ZigBee to transmit and receive data from the solar cell. Data will be shown in the LCD and the software called “X-CTU”.

Components used:
1 Arduino Uno
1 ZigBee Shield (Transmitter)
1 ZigBee (Receiver)
1 LCD Monitor
1 Solar Cell
1Resistor (Value may change)

Instructions:
1. Test for Solar Panel
2. LCD Pins
3. Code Used
4. ZigBee Dual Communication Setup
5. Solar Cell and LCD Shield
6. Mounting all the Parts Together
7. Results

Test for Solar Panel
1. Check the reading of the Open Circuit Voltage and Short Circuit Current at the back of the solar panel.

2. Clip the positive lead from the multimeter to the positive output from the solar panel, and the negative lead to the negative solar panel output.

3. Place the solar panel directly to a bright and consistent light source, such as a desk lamp

4. Turn on the multimeter and set to detect volts. The resulting value should be close to, if not exactly the same as the Open Circuit Voltage reading. As the solar panel is tilt away from the light source, the reading should drop gradually.

5. Configure the mutlimeter to read current by moving the positive lead. Turn on the multimeter and set to detect currents. The resulting value should be close to, if not exactly the same as the Short Circuit Current reading. As the solar panel is tilt away from the light source, the reading should drop gradually.

Step 1:

LCD Pins
1. Connect the following LCD pins to the respective pins on the Arduino
- LCD RS pin to digital pin 7
- LCD Enable pin to digital pin 6
- LCD D4 pin to digital pin 5
- LCD D5 pin to digital pin 4
- LCD D6 pin to digital pin 3
- LCD D7 pin to digital pin 2
- LCD D1, D3, D5, D16 pins to Ground
- LCD D2, D15 pins to Vcc

Step 2:

ZigBee Dual Communication Setup


We are going to use 2 ZigBees to communicate with each other, the left ZigBee is used as a transmitter, which is plug into its ZigBee shield and connect to Arduino. The right ZigBee is used as a receiver which is plug into the board with FTDI USB port to connect to the PC.

Firstly, we will need the software called ‘X-CTU’ to do the modem configuration of ZigBee.
Free download available here: http://www.digi.com/support/productdetl.jsp?pid=3352&osvid=57&s=316&tp=5&tp2=0

Step 3:

When we first plug the ZigBee with USB to PC, the PC will install the driver and new COM port itself and X-CTU will also be able to detect the respective COM port of the ZigBee.
There will be no problem with the receiver ZigBee, we can straight plug in and use. But as for the transmitter ZigBee, there are a few things to take note.

- Change the Jumper


There are 3 pins jumper at the corner of the ZigBee shield labeled as XBEE/USB. If we want to configure the ZigBee modem we need to put the jumper at the USB pair, and change back to XBEE pair after configuration.



Jumper Settings
There are two jumper settings, the ZigBee setting and USB setting.

With the jumpers in the Xbee position (i.e. on the two pins towards the interior of the board), the DOUT pin of the Xbee module is connected to the RX pin of the microcontroller; and DIN is connected to TX. Note that the RX and TX pins of the microcontroller are still connected to the TX and RX pins (respectively) of the FTDI chip - data sent from the microcontroller will be transmitted to the computer via USB as well as being sent wirelessly by the Xbee module. The microcontroller, however, will only be able to receive data from the Xbee module, not over USB from the computer.

With the jumpers in the USB position (i.e. on the two pins nearest the edge of the board), the DOUT pin the Xbee module is connected to the RX pin of the FTDI chip, and DIN on the Xbee module is connected to the TX pin of the FTDI chip. This means that the Xbee module can communicate directly with the computer - however, this only works if the microcontroller has been removed from the Arduino board. If the microcontroller is left in the Arduino board, it will be able to talk to the computer normally via USB, but neither the computer nor the microcontroller will be able to talk to the Xbee module.

Step 4:

- Reset the Arduino


To avoid the USB communicating with both Arduino and ZigBee, we will need to reset the Arduino, so that there will be no conflict with configuration. Resetting Arduino can simply be done by connecting a wire from RESET pin to GND pin on the Arduino.

We can now put the XBee with shield on to the Arduino.


When we open the X-CTU program with the ZigBee connected to PC through USB, it will detect the COM port of respective XBEE.  Select the respective COM port and press ‘Test / Quarry’ before doing anything.

If the ZigBee is in working condition, the Communication with modem will be OK.
After that go to the ‘Terminal’ tab to test the connection, if you type something on the window with blue colour the other side widow will show the same thing with red colour. This means they are communicating successfully.

We need to change the jumper back to XBEE pair after successful configuration. And remove the reset wire from Arduino.

-> Most importantly, when we are going to upload the code to Arduino, the XBEE shield should be take out from Arduino. Otherwise we will get a compile / uploading errors. Connect the XBee shield to the Arduino only after uploading the code.

Step 5:

When we open the X-CTU program with the ZigBee connected to PC through USB, it will detect the COM port of respective XBEE.  Select the respective COM port and press ‘Test / Quarry’ before doing anything.

If the ZigBee is in working condition, the Communication with modem will be OK.
After that go to the ‘Terminal’ tab to test the connection, if you type something on the window with blue colour the other side widow will show the same thing with red colour. This means they are communicating successfully.

We need to change the jumper back to XBEE pair after successful configuration. And remove the reset wire from Arduino.

-> Most importantly, when we are going to upload the code to Arduino, the XBEE shield should be take out from Arduino. Otherwise we will get a compile / uploading errors. Connect the XBee shield to the Arduino only after uploading the code.

Step 6:

CODE USED

#include <LiquidCrystal.h>

// These constants won't change.  They're used to give names
// to the pins used:
const int analogInPin = A0; 
const int analogOutPin = 9;

int sensorValue = 0;      
int outputValue = 0;     
LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
  // initialize serial communications at 115200 bps:
  Serial.begin(115200);
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
}

void loop() {
  delay(200);
  // read the analog in value:
  sensorValue = analogRead(analogInPin);           
  // map it to the range of the analog out:
  outputValue = map(sensorValue, 0, 1023, 0, 255); 
  // change the analog out value:
  analogWrite(analogOutPin, outputValue);  
    // set the cursor to column 0, line 0
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 0);

  // print the results to the LCD monitor:
  lcd.print("sensor = " );                      
lcd.print(sensorValue);
lcd.print("  " ); 
  // set the cursor to column 0, line 1
  // (note: line 1 is the second row, since counting begins with 0):
  lcd.setCursor(0, 1);
  lcd.print("output = ");     
  lcd.print(outputValue);  
  lcd.print("  " ); 
  // Send the data to the serial port
  Serial.print(sensorValue);
Serial.print("  ")
  // wait 10 milliseconds before the next loop
  // for the analog-to-digital converter to settle
  // after the last reading:
  delay(10);                    
}

Step 7:

Solar Cell and LCD Shield
We need to create our own Solar Cell and LCD Shield in order for us to mount it on top of the ZigBee Shield.

Step 8:

Mounting All the Parts Together
After uploading the code to the Arduino, you can mount the ZigBee Shield (Transmitter) on top of the Arduino.
Next, mount the Solar Cell and LCD Shield on top of the ZigBee Shield.
Connect up a 5V wire and a GND wire up from the Arduino to the Solar Cell and LCD Shield.

Step 9:

Insert the LCD into the digital pins and the solar cell to analog pin 2 and GND.

Step 10:

Results

This is the results of our project. Using the software X-CTU to look at the data collected from the solar cell. The left side shows the data captured by the receiving XBee and right side shows the data transmitted by the transmitting XBee. The values displayed in the picture is scaled from 0v~5v to 0~1023 so that the difference will be more obvious. The lower numbers indicate that the solar cell is not exposed to sunlight. The higher numbers indicate that the solar cell is exposed to sunlight.

Step 11: Video

Arduino Challenge

Participated in the
Arduino Challenge