Saturday, August 10, 2013

Lame Update. still lame but not on time!

So yeah... when you're lazy like me just dump some crap onto a blog. The parts for my PC air conditioner are still laying on the workbench:
 
The white square is the peltier element (hot side hot, cold side cold)
The silverish thing is a heat sink with a liquid line and a fan attached (featured in a previous post)

A thermal effect plate (shown above) takes advantage of the thermoelectric effect of the material. What this means is the material responds to a differential in heat between one side and the other. When the heat is different a voltage is generated. That's basically what is called the Seedbeck Effect which is described by:


That equation just says that an "electromotive force" (which is a measure of induction, Faraday's Law) can occur when there is a difference in temperature (T). The -S is the Seedbeck coefficient which is a property of the material generating the EMF--in other words different materials can be checked empiracally to see what their coefficient is. The units for S are V/K (volts per kelvin) because it's a measure of electric potential per unit temperature.

So, if I explained that horribly basically if you have a material that makes electricity when you heat it--there you go. Read about the smart girl who made a body-heat-powered flashlight for Google Science Fair.

The "reverse" of the Seedbeck Effect is the Peltier Effect. All that means is instead of making electricity with a heat gradient you can make a heat gradient with electricity!

You can figure out how much heat differential (hot side hot / cold side cold) you're going to get by:


Again, confusing Greek letters notwithstanding, this means that the heat for the junction (inside the material, more on that in a sec) is the peltier coefficients of that material multiplied by the current.

There's more to it than that but I'm not a physicist or materials engineer so this'll have to do!

Thermoelectric (sometimes called thermopower) materials are often semiconductors because you naturally have electric potential due to the materials. Semiconductors are N-type and P-type materials. N-type have extra electrons and P-type have fewer electrons. As you know this sets up an easy to exploit electric potential!

Thermoelectric semiconductors have a grid of N-type and P-type materials sandwhiched together. Current is applied on the "hot" side and inductance on the cold side drives positive and negative potentials toward the hot side. Here's a pretty picture (I splorked this one out real quick, there are better ones online I suppose):


So, I figured I'd geek out a bit and try to explain it. In any case this stuff will all be coming together... possibly this weekend. Then I'll have an A/C unit for my computer! Or whatever.



Thursday, July 11, 2013

Pathetic Update--Cool that Action!

So I'm too busy to write about what I'm doing. And I'm going to remedy that in as lame a way as possible.

One of the projects I'm working on uses a peltier generator (thermo-electric cooler).

Two things about that:

1) If you electrically charge a thermo-electric cooler and it forces heat out in one direction. It's a diode for heat (of sorts). One side gets cold and the other hot. Thus why the thermo-electric cooler is used for mini-fridges.

2) If you heat one side of the peltier generator you can generate current. But it's crap for efficiency. But, if you have waste heat anyway... why not?

So, first thing is to pump some heat and generate some electricity. A 15-year old girl is currently mastering that process to create a flashlight that is powered by body heat. So, who knows, maybe it can power my thermometer project. I have no idea--I just need to try it out.

For the first bit, though... I'm thinking I'll build a cooler for my PC. The hot periods of summer make things hard on game playing.

In this vein today I scavenged this:



That is a "convection" cooling heat sink + fan. This'll be part of my tiny A/C unit.

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.



Saturday, May 18, 2013

Project Log 2013 - Temperature to Thermostat Part 1

It's finally time to start my little electronics log. Unlike a fancy blog this is just a way for me to jot down a bit about each project I work on. Honestly I have no idea what to expect--in fact because life was so busy I gave up on blogging anything at all (it's really just for me and some friends anyway).

This blog is all about learning curve. I'm a decent programmer but I'm just getting a handle on assembling electronics. Fortunately there are now wonderful toys, er, tools to make my life easier!

We've gone from this:
 [Source: 1977 Radioshack Catalog, Page 154]


To this:
[Source: Adafruit, Arduino Uno R3]

[Source: Adafruit, Raspberry Pi]

Now, I don't mean that the fundamentals are all that different--but now very advanced computing tools are cheap and incredibly small. And also, they're getting pretty easy (lego-like) for both professionals and hobbyists to play with.

So, when I was a kid I played with electronics. Today I'm relearning some old stuff but also lots of new stuff. I have at more appreciation of the technical details today since I've been working with technology most of my career now. It's very exciting to actually hands-on with the physical stuff that uses electricity and spits out both raw electricity and data.

One of the things I have for my test projects is an Arduino Uno R3. My second ever project was to build a thermometer with the Uno microcontroller, a 74HC595 shift register, a TMP36 analog temperature sensor and some LEDs.

The thermometer was super easy to put together for prototyping. To get an nearly instant start I used the Adafruit tutorials "TMP36 Temperature Sensor" and "Arduino Lesson 4. Eight LEDs and a Shift Register". The fun really came in writing the code for it... I was now writing code for something I'd "built" myself (even if by "built" I meant assembled kind of like Legos).

My second project with the Uno
Everybody actually got a kick out of having the project on display--especially because we all love arguing about how hot or cold it is in the house. The LEDs range from about 62°F to 76°F. Note that since I like it cool in the house the first red LED represents ~70°F. Heh.

Here's the circuit diagram. Ridiculously simple but I was very excited at the time!



I'm not going to go over the prototype more now. I have no doubt I'll show breadboarded circuits with my Uno in the future. Also, I'll show you the code for the thermometer project later on or you can check it out [here].

Right away I knew I wanted to use thermometers for a few things. First was just to have my own home-made thermometer I could set around the house. The next was I'm about to build a peltier cooler for my computer and I want to be able to turn it off and on with either a switch or a thermostat (which of course requires a thermometer). I'm also interested in creating wireless data collecting devices--more on that later, too.

Of course it's one thing to have a breadboard soft-wired to an Arduino. It's even more something else cooler to have a more compact microcontroller and all the circuitry soldered. Something I could attach everything to and mount in a project case.

Enter the Menta [got it at Adafruit]:

My Menta, after soldering all the pieces onto the board
The Menta was fun to put together. You get a PCB board and you solder everything onto it. Plenty of room for stuff on the Arduino-style headers (the Menta uses a standard Arduino ATMega328P chip with a custom bootloader written by Adafruit).

Here's some of my rustic assembly and soldering skills at play (scary):


Pro-Tip (this took me a few minutes to figure out):
When programming for the Menta using the Arduino IDE (as of when I'm writing version 1.0.5) you need to set the board settings (under the Tools menu) to "Arduino Duemilanove /w ATMega328".

Now that I have the Menta assembled and tested out (I lived in constant fear of whether I'd soldered everything) it's time to make the thermometer.

Actually, I'm leaving a little room on this project board to both display the temperature and switch a relay to turn other things on/off depending on temperature. I plan on using the headers so I can maybe modify what I do with this board... but basically this Menta is all about temperature. I may add a SD card board later so I can data log the temperature.

For Part 2 I'll discuss a bit more about the actual project and go into a bit about the display I'm going to use.