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.
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 | https://swantron.com // 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 http://arduino.cc 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.
In all honesty, that thing is sweet. I really dig black and silver…cite my SS as evidence. Clean, subtle, and sophisticated. Not to mention the whole sub-aqua thing. Pretty much can’t kill this thing. So, if I am to make a move to be on time, where should I look to buy my beloved Invicta subaqua? Easy. Blue Dial. Check out this price.
Two hundred, sixty seven…down from nearly nine hundo. Beat that, I dare you. Hit that link, see for yourself. Great watches at greater prices…while you do that, I’m going to put my Droid 2 back on the flipping charger. It has been three hours.
There are a few different routes you could take with something like this. You could buy a stylish watch, or a watch that will serve a purpose of some sort. Or, you could grab something like this: (my new favorite, FWIW)
I am digging
It was a son-of-a-bitch. Plus, I had a snaffu with the IR emitters, which are more than likely the same price as the microcontroller that is involved with this kit. Good President’s Day? You better believe it…so much fun horsing around with new connections, crappy directions, and a semi-success. Off to The Shack (Radio Shack’s awesome new advert front) to complete the project tomorrow at lunch, if all goes well. My motors are working, and all three emitters are pushing power, which indicates a solid-ass project as far as connectivity is concerned. Close, but no cigar. Maybe I’ll show off that cigar tomorrow.
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.
I packed a solar cell and a little breadboard to work today…put together a little sketch together over my lunch break to control LED brightness with solar cell analog readings. I shot a little vid that I will toss on YouTube. Expect a full write-up soon. You suckers might even get a snippet…
As with pretty much anything tech-based, the only practical way to buy
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 Pledge, courtesy of Katie. For what it is worth, I found a few commands that don’t seem to work on the command line…
I think I will pack this thing to work and tackle it on my lunch breaks. Enough is enough.
I could take and save footage all day, but then what? I’ll assume that everyone has seen advertisements for ADT…they have the missing piece in the puzzle I laid out. Monitored alarm system…I can throw together a system to capture, but do not have the time to do the monitoring. I think I would sleep better, having someone on the other end of the line. ADT is, without a doubt, the best to have on the other end. I would love to spend some time with one of their systems…they have a lot going on. Pet insensitive sensors? Yep. How do they do that? Must be one hell of an algorithm that goes into that infra-red sensor. Positioning and triggering would be very cool to tear into. Wireless keypads…ditto. Not sure how they keep that secure. I’ll wrap this up. Check into home security, for sure, and more specifically into ADT. Go with the best.