Arduino Solar Cell Night Light Concept

So, I’ve formalized the solar cell project I have been poking at for a while. I managed to clean up my code and mess with some initial conditions, etc., and now have a fairly solid proof of concept for a solar cell-centered night light.

you may want to ramp up that LED a bit

As was the case in my first few runs, my sketch incorporates a five second initialization phase. This acts to set both relative minimum and maximum values which act to provide “full light on” and “full light off” values, respectively. The generated power from the solar cell is read in to the Arduino via analog input, and the LEDs are driven via digital outs. The rest is some simple math that transforms the range of the analog signal into a digital range of zero to two hundo fifty five.

It’s giant-ass-text-having snippet time!

// Solar LED IO
// Joseph Swanson |
// 2011

// Define constants
const int sensorPin = A3; // Solar cell Pin
const int ledPin = 5; // varuiable LED Pin

// Define variables
int sensorValue = 0; // wipe read value
int sensorMin = 0; // set initial min
int sensorMax = 1023; // set initial max

void setup() {

// turn on Pin 11 LED…indicates calibration period begin
pinMode(11, OUTPUT);
digitalWrite(11, HIGH);

// stay lit for five seconds
while (millis() < 5000) { sensorValue = analogRead(sensorPin); // adjust for real max if (sensorValue < sensorMax) { sensorMax = sensorValue; } // adjust for real min if (sensorValue > sensorMin) {
sensorMin = sensorValue;

// end Pin 11… calibration period finito
digitalWrite(11, LOW);

void loop() {
// read the solar cell analog
sensorValue = analogRead(sensorPin);

// apply a little calibration to the sensor reading
// bit from example sketch at
sensorValue = map(sensorValue, sensorMin, sensorMax, 0, 255);

// set constraint for outliers with respect to min/max
sensorValue = constrain(sensorValue, 0, 255);

// fade the LED from one to 255
analogWrite(ledPin, sensorValue);

Pretty straight forward. On to the vid…

It’s web2.0-too-many-script-ass-calling embedded video time!

Not too bad. Again, I used an Arduino Duemilanove and a Solar World panel. I might try to further this concept by incorporating my 120V switch and getting a lamp up in here. Stay tuned, as always.

Arduino Solar Cell-Based Detector

*Proof of Concept Warning*-*Proof of Concept Warning*-*Proof of Concept Warning*

Mission: Utilize a solar cell to vary the intensity of an LED

Supplies: Arduino Duemilanove <--> USB <--> Notebook (Linux, por supuesto)
Breadboard, Jumper Wires, Make-shift Jumper Wires (spare resisters), LEDs, Solar Cell

Setup: Here it is

work at work
I herd you like to work, I set you up so you can work at work

The setup is pretty straight forward: Read analog, write digital. The primary hurdle was figuring out the initialization step. Basically, I needed to provide a time-frame where you can read in minimum / maximum values from the cell. The LEDs in the awesome video below show the results… v

This project is full of take-off ideas. Reverse the range on the LED outputs, and you have a setup that powers up a light as the ambient light levels fall. Motion detector…you bet. You could implement a setup to run the initialization cycle at intervals, to provide a real-time average light level, and check for a delta of some size. Boom. There you go.

I’ll clean up the code, use some real jumpers, horse around with things in general, and throw up a post. With a snippet. Check back.


Nuked that LED from space…

blown led
and boom goes the dynamite

In my ongoing fight with my Ethernet Shield, I had a bright idea that the sucker might have some bad jumpers. Welp, I put together a little blinking LED code and let it rip…which worked. I then tried to run the LED through the 3V lead…but…plugged the bastard into the 5V slot.

Fire and brimstone. Long story short, the board is getting power, the jumpers are fine, and that sweet clear LED is toast.

Bonus LED Action

Aftermath of my last Arduino session in my garage/workshop? Bonus LED action.

bonus LED action is bonusy

It turns out my florescent lamp was pretty weak…the 7 O’Clock sun put it to shame, in the day-after mess of my ‘lab.’

Indirectly awesome.


See if you can spot the following

* Netbook
* Notebook
* Zoot Badge
* Solar Panel
* USB cord
* Table
* Cardboard Box
* Other Random Electronics Crap

Good Luck!

32×32 Arduino Awesome-ness

I wish I had done this…unfortunately, I have my hands full with a handfull of LEDs. 1024 LEDs…give me a break.

Osgeld (a man amongst boys) over at the arduino forums showed off his 32×32 dot matrix panel proof of concept.


Take a peak at his wiring:


How he managed to get that sucker up and running without smoking the shit out of his components is beyond me. Prost, sir. Well played.

Arduino Tri-Colored LED

Tri-Colored LED Arduino control. Check.

I’m bringing sexy back.

them other boys don't know how to act

Sadly enough, it is basically a ground coupled with a Red, Green, and Blue lead. Nonetheless, I’m pumped.

Arduino Button Implementation

LED. Check
Breadboard. Check
Bunch of wires. Check.
C++. Check.

Not Pictured: Button

What is that under my finger? A BAD ASSED BUTTON!

I’m going to have this robot up and rolling in no time. Everyone knows that every robot needs at least one button…the fricking kill switch. For, in case, said robot gains sentience and tries to kill the creator. And I’m not going down by robot death. Skin cancer, maybe, but no death by robot.

Gangster 101: LED Taillights

I can speak with some gusto here. Gangster 101: LED Taillights. Break that down…Gangster, 3 digit number, (coincidentally, binary…for the math win) electrical engineering, and automotive. Step up! Better yet, Step Up 2, to the Streets! We’re getting all sorts of math gangster whip on this mamma jamma…

ghost-ride the whip | ghost-ride the whip

Silverados are sick…Silverados with led tail lights are far sicker. Far, far sicker.

I would know. As an owner of two GMC/Chevy vehicles, I know a thing of two about ill rides. My SS…ill as a polio victim. My Yukon…ill as a malaria victim.

Poor analogies, but required to get my point across.

It seems like only yesterday that I bought the Silverado SS. Twenty inch rims, before twenty inch rims were cool. Well, maybe not before they were cool, but most definately before twenties were common. Oh…the good ol’ days. On a side note, also the days of car loans. Don’t miss those days at all.

In a round about way, let me say that I started rocking the second gangster whip after rolling around in a whip with some gangster potential. Some gangter potential, to say the very least. The Yukon became very, very gangster after buying new rims and tires on craigslist, for less cost than tires themselves. Gangser, a la ballin on a mamma jammin budget!

Once I magaged to get the rim situation squared away, lights were the next to go. Why go bulb, incandescent stee-lo? Nope. LED is the way to go.

Light emitting diode. Like the Arduino. For what it is worth, LEDs are the only thing I have mastered on the Arduino…save that thought for a different post, however. LEDs suck far less juice, look far better, and last far longer. Pretty much a win win win situation.

That would be FTWWW, if anyone is keeping count.

PS3 To Support 3D

Who doesn’t like 3D? This ol’ gal certainly does. Or did.

lol-ing the shit out of some 3D

I don’t get the last joke, but Engadget reported the following:

Get your active shutter glasses ready: your PS3 is going to go 3D this Summer. In conjunction with the release of its 3D BRAVIA LCD sets, Sony is planning to release updates to turn the PS3 both into a stereoscopic 3D gaming platform, in addition to a 3D Blu-ray compatible movie player. Sure, we knew Sony was planning to give us 3D sometime this year, but now that we’ve got a summer time frame we can plan our wardrobe decisions according — jean cut-offs, here we come!

I’ll gladly wait for Visio to come out with a 3D LCD/LED, and kindly pay less than half of the price of a Bravia, thanks. Regardless, this is pretty sweet news.

2010 Tech Wishlist…the ‘what if’ edition

So, I didn’t win the Montana Millionaire grand prize, $100,000 prize, $10,000 prize, or even the consolation slap-in-the-face-fifty-dollar-instant-win prize. Really had my hopes up for that guy. Turns out, I’m still spending 45 hours a week in my cubical, with my dual monitors and hot sauce. I switched from my plastic coffee cup to a glass one (pickle jar) which is nice. Aside from that…it is business as usual.

Needless to say, ample day-dreaming time in conjunction with a crack at a cool million got me thinking…what the hell would I actually blow some loot on, if it was there. That has led me to this…pondering getting an emergency loan and doing some awesome stuff with it. Buckle up, because this list is all over the fricking place.

1 ) Trade the Viseo LCD in on a Samsung LED. Embrace the future! LEDs look great and are energy efficient…for the hippies.

LED is the new LCD, which was the new Plasma

2 ) Check out Japan. Sea food and robots…PEWPEWPEW. Tokyo has a giant Gundam statue, for christ-sake.

I think I'd do well in Japan

3 ) Get my ass back into robotics. My last project (solar following flower) did not succeed. Boo. I think I could do better with…

4 ) Arduino…

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

Plus, it is Linux compatable, and you can do sweet stuff like this…DIY GameBoy

Tetris on an analog stick...

5 ) Destination wedding…and
6 ) Honeymoon: Bahamas with Kate. Since the engagement ring wiped out the ol’ savings account, I loan would make for a nice honeymoon.

fruity drinks
sun+fruity drinks = awesome

7 ) Truckload of Advil. Those fruity drinks ^ give me headaches. Pretty sure I’d need a truckload.

8 ) 5+3. I have a problem. I pretty much cannot see a Netbook without wanting to buy it. Same goes for bad-ass notebooks, like the Alienware M17x. So sweet…especially once you wipe the sucker clean and install Linux. FTW!

gaming laptop
alienware...more like robotware

9 ) Trip to Mesa…might be the last Cubs Spring Ball in Arizona. Spring ball is third, only to fall/summer ball…which leads me to…

10 ) Trip to Wrigley. Especially during October.

Old Style, cheap.

I also would need a truckload of Advil after Wrigley…they practically give away those Old Styles.