Polymythic

Tag: arduino

Solar-Powered Temperature Sensor

by Steve 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);

}
8 Comments :, , , , , , more...

Arduino/ioBridge Airsoft Target Range

by Steve on Jan.20, 2009, under technoPHILE

Indoor Airsoft Shooting Range

A friend of mine who is something of an avid shooter had mentioned the lack of affordable “action” type targets.  After some discussion, we determined it would be fun to build such a contraption for some indoor airsoft practice.  The Arduino Diecimilia was a great choice for the “programming side” of things (I have 2 of them, he has one as well).  

As a shooter, you would want to be up-range from the targets, so having something portable with a web interface was a great solution so nobody would have to be “in the line of fire”.  The iPod Touch and the ioBridge module I used in another recent project.  Of course, why build a custom target enclosure when I could snap one together with my Construx.  

Victory!  Let the fun start!

Victory! Let the fun start!

I used 3 of my hobby servos to turn the target faces. I am tightening the Construx frame to the hobby servo mount.

Building the target faces

Building the target faces

Arduino Pin-Outs:

  • Pin 13 -- Debug LED
  • Pin 12- Ready for Command
  • Pin 11 -- PWM for Servo 1
  • Pin 10 -- PWM for Servo 2
  • Pin 9- PWM for Servo 3
  • Pin 8- Incoming Command Pin (PWM from IOBridge)
  • Pin 7- Command Waiting from IOBridge
  • Pin 2- Peizo Speaker Control

Not to mention the ioBridge wiring, and the Servo wiring. Yeah I have a diagram or I would STILL be working on it. 

A rats nest of wires for the first pass

A rats nest of wires for the first pass

Debugging the system 

Debugging the system

It looks a monstrosity, but once the target face is on it, I cut up some cloth as the Airsoft BB trap, it will look just fine. 

All done, ready to rock!

All done, ready to rock!

System debugged, targets turning!  Now I can call out the programs remotely using the web browser in the iTouch and let the IOBrige tell the Arduino to do my bidding.

 

How the Airsoft Target Range Was Built


 

Arduino Source Code: Arduino-ioBridge-Airsoft-Source-Code.txt

I would say this was a fun, interesting, and rewarding project.  I have also made it future-proof enough to scale up the number of targets for even more options.  For those of you airsofters who don’t want your skills to dull over the winter, turn your basement into a range!  

Now, should I put hay-bales on a servo platform for an indoor archery range?

Happy tinkering!

 

Full Video Version (Combined Demo + Instructions)

34 Comments :, , , , , more...

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...