Saturday, June 29, 2013

Energía del Sol es Divertido

So a quick note about ultra cheap solar panels. So far I've gotten them all for free but they're "broken" yard lights from the Dollar Store given to me as a gift.

In actual fact they aren't broken at all... but the circuit is pretty pathetic for capturing and storing power.

Here are 3 of them in series though--with indoor lighting!

Yup--4V. Outside I got over 5V

The capacity is enough to power a 3V LED (from a flashlight in this case:


For those of you who are curious:

All circuits that are electrically active have voltage and amperage. This is talked about in terms of watts of power (you'll see that on your light bulbs).

Watts = Volts x Amps

Basically, volts is a given amount of electricity and amps is how much of that you can move through your circuit.

I've got these solar panels+nicads in series. With series the voltage supplied by each solar-circuit is added together. In this case we're seeing something like:

1.5V + 1.5V + 1V = 4V

In fact each one is slightly different. Measuring each one in this lighting I got 1.36V, 1.7V and 0.98V = 4.04V.

In series means that you string together all your power sources plus-to-minus. At the end of the string is a single + and a single -.



Because a series circuit is basically just a line the current in a circuit is approximately the same as for any given piece of the circuit:


The current through this circuit is pretty low but is enough to drive the little lights or even a small motor.

The disadvantages of series:

Amps is how fast electricity can travel by "volume" through a circuit--in other words how many things can pull volts from the circuit without overloading it. For this reason a lot of people call amps the circuits "load capacity". In general you don't want to "load" your circuit more than 80%. So, if you know your power source safely provides 2 amps all the things in your circuit shouldn't demand more than 1.6A.

Since our circuit provides a bigger amount of voltage but the same amount of amperage of a single panel/battery the actual load on the circuit will have to be pretty small. Things like bright lights and motors are amp hungry--they want to pull their allotment of voltage very quickly. So, with a series of these panels we still can't power much.

The flipside is that if we put them in parallel it's the exact opposite. The voltage stays the same (or really, because each one is slightly different, it averages) so this circuit would give us just about 1V. The amperage would add up, though, so we could put several things pulling 1V as long as they don't exceed 80% of Amps x 3.

For my purposes we'll keep these guys in series. What we need to power is low amperage but needs the voltage.

-------------------------

Friday, June 28, 2013

Cheap Solar Panels

So today I discovered that they're selling yard lights (the little LED lights with solar panels on them) at the dollar store!

My friend had two that had broken... but only the light element seems to have issues. They have a little ~1.5V nicad in them, too!

The output isn't super stable but the nicad helps. Basically you can count on something like 1.2 to 1.3 volts.

1.369V, basically for FREE!

So, for a few bucks I can easily add some handy power generating fun. I plan to put a few in series to get additive voltage (but rather low milliamps). But probably enough for powering this:

In case this is mysterious--it's a tiny solar panel car

My friend got me this solar panel car kit. Basically it's designed so if it's in the sun it'll run. Sadly the panel itself generates about 0.5 volts--not nearly enough to run the motor.

Also of interest here, though, is that I'm planning on adding a tiny microcontroller (and cheap!) so we can program how it turns the motor on or off. In case you didn't follow the link, it's an ATtiny85!


Temperature Guage and ?

Well, one thing I can say is that being busy with all manner of other stuff (see Figure 1) leaves me little time to blog about it. I guess that's fine but I'd like to keep a history of at least some of the junk I'm doing and learning about electronics. So here goes an update!

Figure 1: Kerbal Space Program: It takes time to run a multi-world space program!

So, the temperature guage bit is done. I need to purchase additional sensors (next is humidity and air-pressure).

Part of what I'm doing at the moment with the thermostat/thermometer is playing with showing some trends. Nothing very fancy but it's interesting enough to do.

Currently I display Celsius and Fahrenheit with either an up-arrow, down-arrow or weird-character next to that. Up means temperatures have been rising (over a certain timeframe). Down... you know. The weird character means the temperature really hasn't strayed out of a certain range so I consider the temperature to not be changing.


Also (as you can see in the photo) I change the background color of the display depending on how warm it is. Anything below 65 is a light teal, between 65-68 is a nice violet and above 68 is an ANGRY RED!

Trends for getting warmer or cooler are currently calculated over 5 minute periods. The error threshold is set to 1 degree so the arrows do change pretty often. By trend I mean a least-squares regression.

So basically in the code there is a counter that is read. It's the Arduino millis() function that gives me the number of milliseconds since the Arduino was reset. Five minutes is a nice neat 300,000 milliseconds so that's why I pick that number.

Once I get the value from millis() I add 300,000 to it and store it in my float timeCheck variable. Once millis() returns timeCheck I calculate my trend. I'm not fitting a curve here--just a simple slope calculation:


My tolerance to determine if the slope is to be considered an actual up/down change is 2 degrees. So basically in the code (I'll dump that out in a later post) I store the value of the temperature, then 300,000 milliseconds later I calculate the slope. If it's greater than |2| then I'll display an up-arrow or down-arrow based on the actual sign (+/-) of m.

Nothing special... and really just a slow-changing indicator of what the previous "5-minute bucket" was trending. Really for the future I'll probably look at holding some data on an SD card and providing slopes over the course of different timeframes (various hours I guess). Plus then we could also do a nice graph from that data using least squares regression or something.

I suppose I'll be adding a humidity sensor next!

-~-~-~-~-~-~-

Tuesday, June 18, 2013

Temperature Guage, Part 3 (A quick glance)

So, because I'm slow and am otherwise working on lots of other things, here is what the temperature display looks like currently.


Also on the lower board are 3 MOSFETs for switching things. I'll be tweaking a few things for the next post so we can play with that. For starters I'll use the buttons on the i2C controller board (under the display) to navigate a short menu. From that menu I'll trigger 3 different events at 3 different temperatures.

MOSFETs
(the red, yellow and black wires go to the TMP36 sensor)

I've got to get some 90 degree headers so I can cable in other sensors, too.

The code for the above display is easy. Basically I'm using the LCD library functions. I'll post the code in a bit and probably link it [HERE].

Just a quick update. Some time I gotta sit down and make this into a much slicker how-to.


Sunday, June 16, 2013

Project Log 2013 - Temperature to Thermostat Part 2

For this post I'm going to show the display that I added for the temperature guage project. Also, I decided to turn this project into a more generic sensor system--attach the sensor I want and activate the appropriate code.

As I mentioned previously, for the prototype I used a shift-register to turn on/off LEDs. Now I'll be displaying the data on an i2C RGB LCD display "shield" (meaning it fits on top of my boarduino), because that's much cooler than a plan-old-LCD.

If you missed it in the previous post, here's the code for the prototype: Temperature Guage 1 @ codebender.

This post will be short because I've been very busy but I want to share. In future posts I'll continue to go over this stuff in much deeper detail.

Here are a few pictures of the display and it's i2C controller board.

The i2C controlled  RGB LCD 16x2 character display (is so dope)

Above is the display and i2C board mounted on my boarduino. Not to mention: 5 buttons + reset button just waiting to be used.

A clearer shot of the display and it's i2C board

Holding the RGB shield (in my hand) so you can see the header 
pins that snuggly fit into my boarduino on the right

The test code is basically the example that came with the Adafruit library (I changed the text). The buttons are currently programmed to change the display's color. It has some pretty colors!


I can snap this display on my Arduino Uno or my boarduino. This'll be my display for all my sensor projects.

I've already starting writing new code for displaying information and also for a menu. My current thoughts are  to load several of my sensor functions onto the microcontroller and then pick what sensor I'm going to use from a menu (it won't be completely user friendly or failsafe, but that's OK). Depending on what I pick the program will try to use the appropriate function to interpret the data it gets.

I'm specing out small PCB boards for holding my sensors. I'll use some "ribbon" cabling to attach the sensor unit to headers on boarduino's project space (look above, you can see all the open silver holes ready for electronics!). Also, at least 2 MOSFETS are going on that board so I can use my data to turn things on and off (peltier generator may be the first cool thing I use that with).

The next few posts will be simplistic like this. I'll cover a little detail of each bit of the project. None of this is really written as a how-to... just a journal of what I'm messing with at the moment.