Power Inverter

I have a terrible habit of thinking of projects that would be neat, starting to work on them, then forgetting about them or otherwise leaving them until some point in the future at which I remember them, and then the cycle repeats.  Well, I’ve been mulling one particular project over in my head for a couple years, and now I’m going to declare my intention to start it and hopefully share it with the world: I am planning to build a power inverter.

Now, the truth is I have started on this project a little bit, mostly by sketches on paper and in LTspice, an excellent,  free (but not open source) circuit simulator.  For those unaware (and who didn’t feel like reading the Wikipedia entry), a power inverter (I’ll probably just refer to it as an ‘inverter’) is a device that converts direct current (DC) to alternating current (AC).  There are a number of applications for this…

  • Running household appliances in your car (shave while you drive!)
  • Backing up servers, medical equipment, or whatever else you want to keep running when the power goes out (UPS)
  • Running normal household appliances on a small renewable energy system
  • Connecting your small renewable energy system to the grid

And so on.  Inverters range from small ones you get at a hardware store, to big ones that can run small villages.  I’m not trying to run a village with this project, nor am I trying to power a significant portion of my apartment.  I would, however, like a small, high-quality inverter, and to really learn how it works.  And, I would like to publish instructions for this online, so that hopefully they will be useful to other people and the design can possibly evolve.

Here are my objectives for this project:

  • Output of 120 VAC, 60 Hz (nominal), 300 watts
  • Input of 12 VDC (nominal)
  • Sine wave output
  • Bidirectional: can also function as a battery charger with a transfer relay, similar to an uninterruptible power supply (UPS)

Now, this isn’t really anything novel.  As I mentioned, there are smaller inverters around, and you might be wondering why this would be worthwhile compared to say buying a small inverter at the hardware store for less than $100.  Well, as I mentioned, I’d like to learn, but that’s not all.  Note the ‘Sine wave output’ requirement.  Most of those cheap inverters won’t have this and will thus produce dirtier power.  Also, I haven’t really found a smaller unit that can act as an inverter/charger, which is something that would come in handy for me – while I do have a largish battery with some solar, it would be nice to be able to charge from the grid with this unit and essentially have a UPS.  Of course, I could get a UPS too, but they’re not really designed for continuous usage, they tend to have dirty outputs, and are designed for charging smaller batteries (usually big enough to allow you to shutdown your equipment, or start up generators or whatever).  Also, for safety reasons, I will NOT being setting this up as a grid tie inverter, meaning it won’t sell power back to the power company.

Now, I would also like to point out that I am not sure how well the design I’m considering will scale.  By this, I mean that were I to build a bigger unit (>1kw), I might approach it differently – this is kind of an experiment.  So, if you’re thinking of building something that you can use to power a chunk of your house when the power’s out in the next hurricane, I’d advise pursuing other options at this point.  (Hey, hopefully this can evolve…)  There are actually several commercial manufacturers that make products (inverter/chargers) that are similar to what I’m building, but work at higher power levels.  I have not used any of those companies’ products, but they do have decent reputations.  Also, if your power doesn’t go out very often, and you just want some quick, cheap backup, a normal gas-powered generator isn’t a bad idea.

I should note that I would not consider this the ideal beginning electronics project; while not impossible it will be somewhat challenging, and will involve high (lethal) voltages.  If you’re unsure of things, feel free to ask here (I’ll try to answer as best I can), and go brush up on power electronics (there are plenty of books on this subject, as well as college classes).  I’ll be saying this again, but whatever you try must be at your own risk.  I’ll try to keep up with this and post more as I go, so stay tuned.  It should be fun.

Projects

I’ve mentioned before that I’m into solar power, and that there are a couple projects I’m getting into.  Well, I’ve been thinking about a couple things for a long time, but I’m just now starting to get into serious development.  There are two things: a maximum powerpoint tracking (MPPT) charge controller, and a sine wave inverter/charger.  The first of these is a good tool for extracting extra power out of solar panels, while the second is instrumental in interfacing the DC and AC sides of a power system.  That is, the inverter/charger will allow you to get clean AC from your batteries, or charge them from a source already available.  Think computer UPS, but designed for a slightly different purpose.

There are various homebrew projects like these floating around the Internet, and I hope to contribute something.  By posting about these here, I hope that I remain focused on them :).  This should be interesting, and maybe even useful to someone.  I’ll try to give an update here and there as I come up with more of a solid design for both.

Ubuntu Directory

Right now I am on vacation, as my last post may indicate.  It is beautiful here, the beaches are nice, and the fresh air is a much welcomed diversion.  However, I still think about random projects and things, and hence I take a few minutes here and there to right them down or even make up a neat little blog post.

The subject of this post is something I have kicked around for a little while, but have recently resolved to try to take on.  Basically, the situation is this: if you haven’t figured it out, I am a GNU/Linux user (though I do use OpenBSD and occasionally FreeBSD for some things as well).  At home I have a few different machines that run Linux, including a small server, a desktop, and a laptop.  There are several others as well, but these are the ones I use mainly.  The thing is, I would love an easy way to manage users and permissions across them.  Basically, I’m thinking of something similar to a domain, like you might see in a Microsoft-based network.

Now, yes, of course you can join *nix machines to a Windows domain (or have one be a domain controller via Samba).  I don’t really have any Windows machines, though, nor do I want to buy/pirate a server version of Windows.  I could also use Kerberos and LDAP, and in fact I do use them.  They work well for me for the most part, but I said in the last paragraph that I wanted an easy way to admin the network.  If you follow one of the various online tutorials about getting the two going the process of setting this up isn’t actually that bad, but adding and removing users can be a bit of a pain.  I mean, it’s not really complicated, but you’d need to add the user to Kerberos, then to LDAP.  Then I guess you can use an LDAP browser to manage the rest.  But, it seemed to me like there should be some sort of GUI tool that would manage both, IE let you create a user and add them to some networked groups and whatnot.  I was thinking of the name while considering a networked version on Ubuntu’s user and groups tool, hence the name.  (In other words, it wouldn’t have to be Ubuntu-specific by any means.)

Now, yes, there are other projects that aim to accomplish this kind of thing, like FreeIPA.  And I won’t lie, that one looks pretty neat.  But it just seemed to me that just having a frontend to take care of some basic user/group stuff would help out a lot.  Especially if you already have a Kerberos/LDAP setup.  So, at some point in the future I am going to see what I can do with my idea, and maybe whip something up in Python and GTK.  I can’t make any guarantees right now, nor say when I will get to working on it, but we shall see.

As a final disclaimer, I am not what you would call an “IT professional”.  I program, and I’ve done quite a bit of work with *nix and networking, but this isn’t my normal gig.  I haven’t extensively used Active Directory, and so I’m not trying to clone it.  I just want an easier way to manage some users across my home networks (for a couple friends, the cats, etc.), but to have the option of still getting at the guts if I want.  Hell, maybe the best way to go about this is just a nice shell script anyway.

Fun with Solar Power

I normally charge an 18 AH sealed lead-acid battery to run small things like lights, and to charge my cell phone, radio, etc.  Well a couple months ago this battery died.  It was old, and sulfation had set in. I decided to upgrade to an AGM battery (the old one was a gel cell), and picked out the 49 AH version.  Since I am away at school most of the time, and don’t have the space to take the battery and set up a solar panel I had to wait until this week to go and start solar charging it.  So, here is my temporary setup:

This is just temporary.  I eventually want to get the panel mounted somewhere, and the battery inside.  But this is great for the time being.  The battery does well in cold temperatures (I’ll bring it in at night, of course), and should be able to hold enough that I can rely on the system a little more heavily once it’s more permanent.  This is just one 32 watt panel too, with the other one added it will be even better.

The Flicker Circuit

A while back I posted about a circuit I had devised that would make a lightbulb flicker such that the light it cast would resemble a candle flame. You see, last Halloween I was living in my apartment on RIT, where fire is not permitted. So I began to comb around a look for a circuit online that would make a normal light bulb flicker in this way. There are some floating around, but after a while I decided I wanted to build my own. I did, and it works pretty well. I was going to post a schematic, but it was something I kind of put together on a breadboard, and didn’t have a diagram handy. I was going to make one and post it, but I forgot about it. For a while. Well, now I do indeed have a schematic, having just thrown one together. I am posting it here, and you may use it for personal or educational, non-commercial use. Here it is:

The Pseudorandom Flicker Circuit

The circuit is meant to run on 12 volts; if you’ve checked out some other posts you’ll find I’m a bit of a solar power nut.   I figured low voltage is relatively safe for this sort of thing, and I had 12 volts handy anyway from a gel cell, so it works out.  (A wall cube supply would also be great.)  The light also must be 12 volts; I’m just using a small 1/4 amp bayonette bulb I found at an electronics store (it works well in a Jack ‘O Lantern).  The bulb is driven by MOSFET Q1, an IRF720.  It can handle a lot more, probably a couple amps, but you’ll need a heatsink for it.  The bulb I use doesn’t make it heat up all that much. Basically this circuit is kind of like a light dimmer.  You’ll notice it uses three 555 timers, that tried-and-true timer IC that’s been around since forever (the 1970s).  These have lots of pages associated with them scattered around the Internet, so check Google for the fine details.  But basically timer U1 is a PWM light dimmer – we use it to turn Q1 on and off really, really, fast (around 1 kHz), and we change the duty cycle (the percentage of the time it’s on) according to how bright or dim we want the light.

To control the dimmer, we use two other 555 timer driver circuits.  These control it via Q2 and Q3, which add resistance and thus change the brightness.  Q2 and Q3 are controlled by U2 and U3, which turn them on and off.  By doing this at much slower rates (they must not be exactly the same, but close), different levels of brightness are acheived.  Because the rates are different the light cycles through the pattern.  It’s not truely random, but it looks close enough to the casual observer, making it pseudorandom.

Now, you could play with R5, R6, R7, and R8 to get different rates, and maybe make it a little more realistic.  You could even stick potentiometers in there if you wanted to adjust it.  But you’ll probably be fine with just experimenting with different values until you find something you like.  (Again, I won’t go into it too much, as plenty of info is available on the Web.  Also, it’s late, I’m tired, and I don’t feel like thinking about it too hard.)  I suppose you could also build upon this concept and use it to drive something like a thyristor and control an AC bulb.  (Be careful when working with high voltages; you do it at your own risk.)  If the one bulb’s not bright enough, you could also add more in parallel.  They would all flash the same, so it would work.  You could add more dimmers and more driver circuits for different combinations, if you wanted to drive a bunch of pumpkins and not have them all mysteriously flicker in unison.

Or, you could just use a real candle.