Thursday, December 8, 2011

Prototypical Stuff


So I'm actually to a point on this thermostat that I'm ready to actually start building the PC board that contains controller and accompanying components (the smarts of the innards).  I've actually spent a few hours placing, soldering and wiring the parts on the prototype board.  This is tedious work to say the least, you are working with tiny parts and a soldering iron (which is essentially a pen shaped, skin searing device that rests at 700 degrees F).  Burned skin, strained eyes and fingers are consistently a by-product of this process.

Here is a front/back pic of the progress I've made so far; I'm at about 40% complete:

So at this point in the soldering process, already sick of it and looking for alternatives, I visited a few PCB (Printed Circuit Board) websites and found an awesome (fairly) new website and service setup for people making prototype PCBs.(Hey wait, I'm a people wanting to make protoype PCBs)  Making PCBs aren't very expensive, as long as you are getting hundreds of them made at a time, to make small one, it's quite expensive. 
The service that I found essentially takes dozens of submissions for boards from multiple customers and places them together like a puzzle on one big board.  Then it sends this large, completed puzzle off to get it printed.  When it gets this large board, it slices up all the pieces to distribute to everyone.  This way, the price is divided up among the dozens of people building boards.  BRILLIANT!!

So for about $15 I can design my own PCB and have it printed for me.  Screw all this start-from-scratch fabrication crap!  The downside is that there is a 3 week delay before I get the board back, but that's acceptable.

So, the last couple night's I downloaded the software used to design and route the board, read a few tutorials and got to work.  Within a few short hours, I'm almost ready to send off my first PCB!  Sweetness!! 

Here's a screenshot of the layout of the PCB:

I'll keep you posted when this baby shows up.  Stay tuned!

Sunday, December 4, 2011

Parts is parts

OK, so I've given you an inkling of what the thermostat is supposed to do and what it may or may not look like (if you're not up to speed, check out some of my earlier posts.)  I'm just SURE you guys are out there wondering, "What sort of black magic makes this thingy work??" Well, this magician is here to reveal his secrets...  (about the thermostat... don't get greedy.)

Well, the brains of this operation comes from a microcontroller, more specifically a PIC18F microcontroller.  Essentially, it's a small processor, think of an Intel Processor from a computer, circa 1985. However, if the Intel 8086 processor is your average pocket knife (it isn't), the PIC is a super utility Swiss Army knife (still an analogy folks, please don't try to open a can of ravioli with this.)  The 'micro' in microcontroller only refers to the size of the device, functionally, it should probably be referred to as a macrocontroller... or possibly a ginormo-controller.

The microcontroller (or ginormo-controller, if you prefer) keeps track of everything within the thermostat.  It reads the temperature of the thermocouple (a device that converts temperature to a voltage for the PIC to read), it controls the relay (an electrically controlled switch) that turns on and off the electricity to the freezer, it reads the inputs from the push buttons on the front panel, keeps track of time, stores the heating and cooling program sequences, and most ostensibly, controls the LCD screen on the front panel. And YES, it will indeed open up a can of ravioli, but only once, and other tools are probably required...

Much like the processor that's in your computer, the microcontroller runs a program.  To the microcontroller, this is just a list of binary numbers that are interpreted as instructions, it reads each instruction, one at a time, completes the instruction, then goes to the next instruction in the list.  To us, this same program is a list of instructions written in a programming language, in my case, the c programming language, which is a universal and very versatile programming language that has been around for a long time (it was developed in the early 70s).

Once I write the program using my desktop PC, I have to run it through a software program that compiles the c program into binary for the controller to understand and interpret. The binary program is then loaded and stored on some flash memory (same flash memory that's in a USB memory stick) embedded within the controller (did I tell you how cool this thing is??).   Once loaded and running, my particular program runs a repetitive loop that, essentially, reads the current temperature, updates the time, updates the relay outputs in response to the new temperature, then performs any screen updates if necessary.  Of course it goes into a different section of the program to create the user interface, menus and setup pages, but the majority of the time, the microcontroller is in a repetitive loop, repeating the same things over and over again.  Which is something I'm sure we can all relate to from time to time...

Summary for the skimmers:  Microcontrollers are very versatile, very useful and impressive, but a poor choice for a survival tool.

**Disclaimer:  I apologize for any extra geekiness that may have slipped out during this post...  I usually do my best to conceal that as much as possible.

Tuesday, November 29, 2011

Happy Belated Thanksgiving

Happy Thanksgiving everyone! 

I apologize for the lack of posts lately.  It seems that life has been going on behind the scenes here.  However, for that, I am very thankful!

I've got a post in the works that I plan to get out very soon and hope to have a few more posts despite the fury of the holiday season being upon us.

I hope your Thanksgiving weekend was full of excessive amounts of fowl-ness.

Tuesday, November 1, 2011

Geeks and Beer

So beer and electronics DO go hand-in-hand.  Looks like a fun project! 

Check it out:
Beer Automated Dispensing Machine

Monday, October 31, 2011

Happy Halloween

Happy Halloween everyone!

I've decided to send out a post from here at work so that I will have to make up the work-time I've wasted blogging.  And I can't think of a better time to reimburse this wasted time than tonight when half of my neighborhood (and several others) will be knocking on my door looking for free handouts.  I've been looking for good excuses to be away from my house during this time ever since the casually dressed high school kids stopped by my house for the second time in one night looking for candy.... (which also happened to be the first year I extended by gracious, candy-giving hand.)

I'm not saying Halloween is all bad, there ARE some good things about it, but none of those reasons ever show up on my door on Halloween night, so I'll try not to be home.

Anyway, so I'm not posting this to complain about the rising costs of Halloween candy, or greedy kids, or even a cool costume idea I have, but I thought I'd send you a quick pic of the "costume" that my thermostat project is going to dress as.  This is just a concept idea at this point, but I have a project case for it already, so the relative dimensions should be close.

The three black dots are the buttons to control the menus and such. There is a blue and a red LED to indicate when either the cooling or heating element is enabled.  Then the main LCD screen (blue rectangle) will show some relevant (I use this term loosely...) information.  The text on the front panel (outside of the LCD screen) will hopefully come from a printable stick on label that will cover the entire plate.   Hmmm.... In the case of a full label, I guess I could add some sort of graphic or label (please re-read the last sentence if you didn't see the word 'OR' included.).  Let me know if you have any cool ideas!

That's all folks.  No summary today as the picture should eliminate the need...

I hope you all enjoy the gift of giving this hollowed evening!

Thursday, October 27, 2011

So, what would you say... ya do here?

Well, title bar, thanks for asking!  The best projects are ones that create solutions for real problems.  This gives you real, hard requirements to work towards.  Then anything on top of the requirements is just gravy!  And I do love gravy! Plus we all know that gravy is the best thing you can add to any food product that doesn't contain bacon. (BTW...don't even get me STARTED on bacon gravy!)

OK, whew, where were we?  Oh yes, problems and solutions.  So, my problem (well, one of them anyway) stems from one of my hobbies: brewing beer.  The fermentation process of brewing beer requires that the wort (unfermented beer) be at a fairly specific and constant temperature.  Many ales require approximately 72 degrees for the magic to happen.  My home, which calls it's home Texas, fairly consistently exceeds the 72 degree mark from May to November. And this unfortunate fact prevents me from brewing quality beers during this time period (now you see the magnitude of this problem!)

One solution to this problem is to set your thermostat to at cool and constant 72 degrees.Which sounds like such a simple solution except that when the average summertime high temperatures this year were well over 100 degrees, it gets quite expensive.  In fact, when you factor in the utility prices in for this particular solution, it easily quadruples the price of each batch. Pass.

So the next solution is to create a sort of "fermentation chamber" to ferment the beer.  This consists of a device that allow you to keep the the wort at a constant temperature.  Many people will use a converted fridge or freezer with a modified thermostat, which is the solution I'm currently working on. More specifically, the 'modified thermostat' aspect of it. There are a few thermostats out there that will do the job, but nothing out there that will do exactly what I wanted.  So I decided that I would create my own.

The device I'm creating will essentially drive a power outlet that (in my case) a small chest freezer will plug in to.  When the temperature gets too warm inside the freezer, a relay will kick on to allow power to the outlet, which will in turn kick on the freezer.  Neat-O huh?  Well, not really (sorry to set you up like that).  This is nothing that can't be purchased from the cloud.     The device that I am creating will allow for you to create programs.  For example, the first stage of the program will set the temperature to a certain level while fermenting, which will take about 2 weeks, then it will gradually lower the temperature to 34 degrees over a week's time to allow it to lager (which is a German word for 'to store') for a few weeks or months.

I plan on keeping my "fermentation chamber" in my garage, and since we have especially harsh winters here in Texas, it is possible that sometimes the chamber will need to be heated to keep it's requested temperature.  So to remedy this, I came up with this nifty idea to add a second outlet on the thermostat to control a light bulb within the freezer.  The bulb can then be used as a heater to warm up the chamber (man I was on a roll that day!).  Plus, with a simple magnetic switch input into the thermostat, the light bulb can turn on when the door is opened up. Why can't you just use the one provided with the fridge you ask??  Great question! Post the answer in the comments below and you will receive a free Attaboy (**please allow 5-7 days for shipping and handling... or however long it will take for you to forget you're getting one).

So this is my overall goal for my thermostat.  I've gotten off to a decent head-start on this project and it seems to be going fairly well.  I'll give you some of the greasy details in another post.

Summary for the Skimmers:  Can't brew in heat.  Make a chamber. Control temperature with electronic toys.  (Oh, NOW you go read it more carefully.)

Thursday, October 20, 2011


So I've decided to create a blog to showcase all the potentially wonderful projects that I have in-progress from time to time. The thought here is that if I think someone is keeping up with the status of what I am working on, it will motivate me to keep up a decent pace and maybe, just maybe, allow me to actually follow through with one of these projects.   Please note, the important thing is if I think people are reading this... so if you want to give a boost to my morale, just open up the blog and gaze over it a bit. This will do wonders for my motivation. 

I must warn you, however, make sure you've recently either had a good night's sleep, plenty of caffeine, be experiencing some sort of physical pain, be in a loud room, etc (possibly all of the above), because some of the subjects covered here will have a strong propensity to cause dazing.   (Are you, or someone you know experiencing from insomnia?  Well stop on by this blog for the cure!  We all win!)

Seriously though, I will try to keep a lid on the majority of the engineering vernacular (nerd lingo).  Although, of course, I've got to throw some of that in from time to time because, well, that's those are the exciting parts!  (OK, who's still with me after THAT statement.) I'll also try to keep it lighthearted most of the time.

The majority of my projects have to do with electronics. Hence the punny name. *chuckle*   However,  I also have many other hobbies and interests, so it's possible that other topics will crop up as well.

So come along with me on this exciting and educational journey of the wonderful things that can happen in an ordinary workshop!    **(Uh, OK, the theme song was supposed to start before this statement was read.  No? Dammit! OK, read it again and imagine a theme song playing...  I'll wait.)**

Summary for the Skimmers:    Welcome. New blog. Nerdy projects. Much detail. Hope you enjoy!

P.S. I also brew (and sometimes drink) beer.  Which makes the title of this blog even punnier... *chuckle*  There's a good chance that this "beer" topic will be presented again.