Polymythic

Solar-Powered Temperature Sensor

by on May.18, 2009, under technoPHILE

Solar Powered Temperature Sensor

In case you’ve not heard, there is a Green Revolution in progress.  To quote a popular commercial, “The way we use energy now can’t be the way we use it in the future.  It’s not conservation, or wind, or solar.  It’s all of it.”  I have long kept a solar-energy project in the back of my mind, so I ordered a 12v/.2A solar panel power supply from a vendor (note: I erred while filming and said it is a 2A panel.  It is a .2A panel).  As a first step project, I figured I would power up my Arduino, use my shiny new XBee modules, and relay some sort of meaningful data back from this wireless solar-powered microprocessor.

How is the weather outside today?  If I am getting data, its sunny!  And 65 degrees on my deck according to my newly built solar temperature probe.

XBee Communications

I did some first-steps using 2 Arduinos communicating over the default broadcast configurations over a span of about 2 feet.

The Salt and Pepa of the Arduino world.

The Salt and Pepa of the Arduino world.

Arduino 1:  ”Yo.  How you doing?”

Arduino 2:  ”Fine thanks.  Wow, we are talking wirelessly.”

Arduino 1:” These are great days we’re living in, man.”

Arduino 2: “Now, if only I could unhook from this power cable.”

I settled down Arduino 2 after his diatribe likening himself to Pinnochio, and told him that I would take care of it.

Detail of an XBee wireless communication module

Detail of an XBee wireless communication module

XBee Modem off of the adapter board

XBee Modem off of the adapter board

Serial Communications

After getting the Arduino twins talking (and hey, its all serial!) I grabbed my ioBridge and slapped on the Serial Communications smartboard.  In about 1 minute, I had my ioBridge chatting with my Arduino.  Sweet….  Now, on to untethering my Arduino.  ”I got no wires…to hold me down… la-la-la-la”

The Wireless Temperature Probe


I ran out to Radio Shack and picked up the right barrel plug adapter, and added some wires to run into the Arduino.  Note: the jumper must be set on the Arduino to take power from external.  My Solar Panel provides 12v, and the Arduino can take power up to 12v.

XBee hooked up to temperature sensor

XBee hooked up to temperature sensor

Temperature sensor

Temperature sensor

I used the temperature probe that I had from my ioBridge, crafted a quick sketch (see below) on the arduino (the analog scaling factor may be off since its not precisely linear, but c’est la vie) and waited for the sun.  As soon as I plugged it in, the Arduino woke up, lights blinking, and was soon processing and wirelessly communicating!  All this achieved because of energy provided by that flaming ball in the sky.  Now that’s cool.

A quick run upstairs onto the ioBridge dashboard and guess what?  The serial monitor widget was telling me what the temperature is outside.  65.31 degrees Farenheight.  Wirelessly and without another power source…

ioBridge and Serial Smartboard hooked up to XBee module

ioBridge and Serial Smartboard hooked up to XBee module

A nice springlike 65 degrees outside at the moment.

A nice springlike 65 degrees outside at the moment.

Conclusion

Now that I have a solar powered wireless microprocessor at my disposal, I am thinking of giving it some legs, and onboarding some Artifical Intelligence.  Its top priority could be to take over the world.  Take some solace in the fact that the processor is 1KB of RAM, 512 bytes of EEPROM, and runs at a “blazing” 16 MHz.  If that’s not enough, then know that all you need to do to shut down its diabolical scheme is stand over it and block the sun.  Hmm.  Perhaps its better served as  a temperature probe….. for now…

Sketch for Arduino

#include <NewSoftSerial.h>

NewSoftSerial xBeeSerial =  NewSoftSerial(2, 3);

void setup()  {

  // Initialize the on-board LED

  pinMode(13, OUTPUT);

  //Initialize the HW serial port

  Serial.begin(9600);

  Serial.println("Ready to send data:");

  // set the data rate for the SoftwareSerial port

  xBeeSerial.begin(9600);

}

void loop()                     // run over and over again

{

  //Read from the analog input from analog pin 0

  int tempValue = analogRead(0);

  // Send the message to the XBEE Transmitter

  xBeeSerial.print("Time: ");

  xBeeSerial.print(millis());

  xBeeSerial.print(" Value:");

  // Do scaling ~6.875

  float scaledValue = tempValue / 6.875;

  xBeeSerial.print(scaledValue);

  xBeeSerial.print("\n");

 // Update every 2 seconds

 delay(2000);

}
:, , , , , ,
14 comments for this entry:
  1. Jason

    Good stuff… I am thinking of doing something similar for monitoring the temperature of my homebrew beer in the shed over the winter.

    How much current does the Arduino and Xbee draw? Wondering how big of a solar cell I would need. Also thinking of using 4/6 AA NiMh batteries and devising some sort of charging device for it…

    Thanks!

  2. Steve

    Excellent idea, Jason. A Lager-Monitor. I will check into those draw numbers. It’s a very relevant question. I am flirting with making a small solar-powered autonomous vehicle, so all the draws and bursts will need to be worked out. Keep me in the loop on your solar projects and thanks for the comment.

  3. Solar Cells

    This is a useful article though… And you know, John Rogers, professor of science and materials engineering at the University of Illinois and his team have created a new method to produce flexible solar cells, transparent and extremely thin.

  4. Solar-Powered temperature sensor « adafruit industries blog

    [...] Steve writes… In case you’ve not heard, there is a Green Revolution in progress. To quote a popular commercial, “The way we use energy now can’t be the way we use it in the future. It’s not conservation, or wind, or solar. It’s all of it.” I have long kept a solar-energy project in the back of my mind, so I ordered a 12v/2A solar panel power supply from a vendor. As a first step project, I figured I would power up my Arduino, use my shiny new XBee modules, and relay some sort of meaningful data back from this wireless solar-powered microprocessor. Filed under: xbee — by adafruit, posted June 21, 2009 at 12:22 pm [...]

  5. Nate

    Please post a link to the product page for your solar cell or describe the exact model/make.

  6. Steve

    Nate, I ordered off of Ebay. It was a run-of-the-mill Solar Panel rated for 12V/.2A. I believe the most common application is for solar powering little fountain pumps in a garden. It was approx. $20. Sorry I cannot find the exact part.

  7. Jody

    Could you do this with two Arduinos instead of an Arduino at one end and an ioBridge at the other? I already have two Arduinos and would rather not pony up $100 for an ioBridge. I guess maybe I just need a primer on XBee communication :)

  8. Steve

    For me I wanted to be able to access it via the web from anywhere. You could do that same thing with 2 arduinos and having a PC/Web Server reading the serial data (or even the Arduino could stream the data in web format to the PC). I just didn’t want to leave a PC on all the time as a web server. The ioBridge will publish all its data to the web all the time and onto my dashboard. I am sure there are Arduino-only ways to solve this as well. Let me know if you implement one!

  9. Jeff

    If you want to monitor the temperature at night, what added features would you need?

  10. Steve

    Well, you’d have to have a battery or very large capacitor and be charging through the day, then it would be drawn from at night. Or, perhaps a standard battery that you would only draw from at night and replace every once in a while.

  11. Eric

    I want to use the same temp probe with my Arduino. Can you just power the temp probe and hook it directly to the Arduino board? Does the temp probe constantly put out voltage on the analog line that corresponds to the temp? Also why do you scale the temp value by 6.875? Thanks, sorry for all the questions!

    Cool project by the way!

  12. Steve

    Yeah, just hook it up to the arduino analog input and ground. It outputs a voltage, as you describe, in a range 0-255. You need to convert that output via a scaling factor (the 6.875) to get C or F. Mine was F. Its not really perfectly linear, usually, but it was close enough for me. Good luck dude!

  13. Eric

    Two last questions, sorry for the bother. What voltage does the temp probe use? Also did you ever experiment with cable length on the temp probe? In some cases I may need to run 100 ft of communication cable between my Arduino and temp probe!

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...