Arduino Solar Cell Input

Here we go. As I mentioned a few days ago, I’m horsing around with analog input to my Arduino, in the form of input via a solar cell. For the win. It turns out, that I’m getting far better with my casual electronics experimentation…I will chalk this one up as a win.

My basic set-up is this…Radio Shack solar cell, breadboard, florescent light source, Arduino, and a notebook.

Step 1) gauge light source via multimeter.


one point twenty-one gigawatts

1.7 V…no need to toss in a resister, as the Arduino can handle 5V without issue. Good to go.

Step 2) Interface with Arduino via breadboard.


breadless soldierboard

This could have been a direct setup, but for the sake of not soldering a solid lead to my solar cell array, I chose to twist the crap out of the existing + and – leads of the wire outs on the unit, and cram them into the breadboard. USB connected to the Arduino, of course

Step 3) Chop in some code for the Arduino. This was the tricky part…not that tricky, however:

~~code snippet time~~

void setup() {
Serial.begin(9600); }
void loop() {
int v = analogRead(0);
Serial.print(‘ ‘);

~~~end code snippet time~~~



Note the lack of comments? I’m a flipping math dude, so that is wholly optional in my book. Long story short, Wiring is a stripped cousin of C++…I have to void setup and loop here, since I am not concerned with anything once I let ‘er rip. I will touch on the programming specifics at a later date, but inquiring minds can find this info quite easily on the Arduino project’s main page, or on Wikipedia. Knock your socks off. I added the delay for sake of real-time monitoring, and matched the baud rate to which I had configured my USB connection. ttyUSB0 would be that in question…9600 would be the rate.

Step 4) Read input via serial monitor.


those figures average out to 'awesome'

As you can see, it is pretty much constant, with some fluctuation due to my set-up. Noisy, yes. Cheap components, yes.

Step 5) Testing ‘zero’ state. Here, I have employed my box of smokes. American Spirit Lights, to be precise.


Yellow Box of American Spirits...A Labritory Must-Have

Step 6) Gauge system.

Here, I’m altering between ‘on’ and ‘off’ states. I start with the ‘off’ (smokes on solar panel) configuration for a time, remove the box to open the system to ‘max input’ for appx 7 secs, and then place the box to remove the input energy.

for the goddamned win


Most definitely for the win…with the experimental noise, that could be considered effectively zero. For the win.

In summation, I have read in analog, as intended. Lessons learned? Pretty straight forward I suppose. My cheap-o solar cell is rated for a max of 6V, which I was far under. If I was to use this setup with a stronger light source, I would need to take this into consideration. I didn’t perform any data transformation, as I was not concerned with ‘actual voltage input values’ in this case…merely relative. Most importantly, I was able to knock out the task I had set out to do. Hopefully, I can ride my EE high and get cranking on something awesome, like a netbook robot. With some lasers.

4 thoughts on “Arduino Solar Cell Input

  1. Nice implementation of the cigarettes man. Cool project

  2. Tremendous! This particular is all I can think pertaining to a blog post like this excellent. This kind of is literally a notably explanatory article post on the blog. You just need to know a lot about this amazing

  3. I’ve been searching for this kind of information for quite a while now and finally found it. Fantastic stuff you got right here, finally someone who gets it.