Oct 27, 2011

Keeping Circuits Up When the Sun Goes Down

Temperature is one of the most often overlooked specifications in electronic design. We spend most of our time in controlled climates and it’s easy to forget that the products we create might not. The problem is that most component suppliers know this and either don’t include any data about their product over temperature or only give you their ratings at the peak conditions, i.e. the ideal temperature, voltage, light, etc. The casual electronics person/lifetime tinkerer might not even consider designing for environmental conditions because in their case they just need something that works in one specific instance. In fact, the reason I chose to write briefly on this subject is because I have been caught by temperature restrictions in the past, and I was almost caught again with my pumpkin animation project.

Last Halloween, I attempted a lamer, less thought out version of this project that involved some kludge of LEDs, resistors, batteries, and switches. It didn’t go well in part because I used Lithium coin cells as the power source. To this day I have not confirmed my suspicions, but Lithium-ion batteries are notoriously sensitive to temperature variations, and I think because of the low temperatures outside the battery voltage dropped and the LEDs did not stay lit for very long. There are of course many other reasons to explain why my first attempts were failures – one being that I have little skill designing stuff – but I am inclined to think it was the temperature that did me in. My main reason for thinking that is because once I brought the circuit back inside and it returned to room temperature, the LEDs started to become bright again.

To avoid being screwed over by lame batteries again this year I decided to pick up some 9V Alkaline Enercell batteries from our local RadioShack. The idea here is that I will step down the voltage from 9V to 5V to power the PICs that control the lighting sequence using a linear regulator (currently on its way from Digi-Key). To make sure that I wouldn’t lose any battery voltage when the temperature drops at night, I tested one of the Enercells at varying environmental conditions. The first test (pictured below) was conducted at around room temperature. The second was done after I left the battery out in the night air for a few hours. The last was after I left the battery in the freezer overnight. 


Figure 1. Battery voltage across various temperatures (From Left to Right: room, fall night, below freezing)

As you can see, there shouldn’t be any voltage drop on the terminals at all based on any realistic temperature conditions on Halloween. I expected this given the battery chemistry, but RadioShack is infamous for not providing datasheets for any of their parts so I had to be sure before I relied on them. As long as Halloween night stays above absolute zero everything should work fine as far as the batteries are concerned. Current projections have the nighttime low set a 42° F.

Unfortunately, 42° F could be problematic for another aspect of my design. In trying to find a workaround for my oscillator timing problem I came across Figure 2 in the datasheet for the PIC 16F690 (lazily colorized for your enjoyment).

Figure 2. HFINTOSC frequency accuracy over supply voltage and temperature

What this graph is showing is the high frequency internal oscillator (HFINTOSC) accuracy over temperature and voltage. Remember how I stated in my last post that the accuracy of the internal oscillator is only quoted at 1%? And remember how I said earlier that datasheets often quote the best metrics up front without qualifying the conditions for their execution? Well according to their own chart I can only get 1% accuracy if I run the PIC on 3.5V at room temperature, plus or minus about 10° C. Running the PIC on 5V alone is enough to push the accuracy to 2%, and when you consider that temperatures could get as low as 40° F (4° C) I am trending dangerously close to pushing that accuracy to a horrendous 5%. While all this sounds really bad I am not in panic mode just yet. Based on some reading I have been doing I think I can work around this by shortening up the animation times, which will limit the amount of time the four oscillators in the chips have to drift away from each other. I am also working with putting the PICs to sleep when they don’t need to turn on LEDs and then waking them back up using the Watchdog timer (WDT). From what I can gather the watchdog timer triggers a processor reset when it overflows so I think I can use that to re-sync the clocks after each light sequence. With only four days left to work, getting this project up and running could come down to the wire.

Oct 24, 2011

Oscillator Fail

Well, as it turns out even the simple things have to be difficult when you don't know what you are doing. In my first attempt to code a test animation into my four pumpkins, I was able to get them to light up in sequence...for about 20 seconds. The idea was to have each one light up from left to right and then repeat the cycle. Everything seemed to be working great until I walked away and came back about 5 minutes later. Eventually, each pumpkin started to light up out of sequence or with a noticeable delay. As time went on, things only got worse. My first instinct was that it had to do with the inaccuracy of the internal oscillator, which is running at 4 MHz. Based on the data sheet values for the PIC 16F690, the internal oscillator is rated at 1% accuracy, which I know sounds good, but it is actually very poor for a timing device. For reference, that means if you wanted to make a simple clock project where the microcontroller just keeps track of time, your clock would be 15 minutes off the actual time by the end of the day.

I posted my results and my thoughts to the EEVblog forum yesterday afternoon, and the responses have enforced what I believe to be the problem. As you can see in the video below, the initial sequence actually functions very well.



Unfortunately, this is what it looks like about 4 minutes in...............



I have started to think of ways to work around this issue without a lot of extra effort. This problem is by no means insurmountable, but given the time I have and my knowledge of the chip it will be difficult to come up a robust solution before Halloween. My latest thought is to speed up the light triggers and finish the entire show before the oscillators get too far out of sync with each other. After the entire loop has run through once, I think I can enable the chip's reset and start it over with the clocks synced like they are when you first apply power to the circuits. If worse comes to worst, I will let the light show run free and generate what looks like random sequences. Given my high hopes for the project starting out, I really don't want to dumb it down to that level.

Oct 18, 2011

Pumpkin Quartet

As promised, this is a short update on the progress of my Halloween display project. So far, I have managed to get one chip programmed using Microchip’s new MPLABX IDE, the HI-TECH C compiler, and a PicKit 2. I haven’t ever actually programmed a microcontroller with C before and MPLABX is still in beta so it took some time to get familiar with setting up even a basic LED flash program (mostly due to the fact that I don’t entirely know what I am doing). At the moment I am only running simple timing loops to control the animations, but I hope to get more functionality in the next couple weeks. My plan is to hardcode an animation sequence into the micros as a backup  in case I can’t get my additional features built in before Halloween. We will see how things go.

Now for some pictures. Below are three pictures of the pumpkins as they look right now. I found four faces online (since no one gave me any suggestions) that I more or less copied for my own use. The pumpkins themselves are hollow, but the foam walls were actually about half an inch thick in certain areas so getting a decent pattern out of them takes some effort. I am pretty happy with the way they turned out though.

 
My color choices below aren’t final yet. I am still experimenting with colors and suggestions from friends so leave comments if you have suggestions. The colors are kind of hard to make out in the photos, but they look much better in person. From left to right they are: green, red, white, and blue.













Since these will be outside in the dark I took a night shot too. One thing I am pretty proud of is how even the light looks inside the pumpkins. I found some diffusers at our local Michaels that I think will really work well in the final project. There will be more to come on these in my final bill of materials.













That’s all that I’ve got for this update. I am going to start working out some lighting patterns and planning out their timing with an Excel spreadsheet for event scheduling. In the interest of open source, I will post all the materials I used to create the final project once I wrap things up.

Oct 16, 2011

September Power News

I’m back today for the third installment of my “Power in the News” series. This month I am sticking with the format I used earlier, but I will try to trim things down even more. I have been investing more time on my projects recently so my posting frequency has decreased pretty significantly. Hence, I am posting on September’s power news in the middle of October.

IMPORTANT

The US Energy Information Administration (EIA) has reported that global energy consumption will increase by 53% from 2008 to 2035. Contributions from renewable energy sources will continue to rise each year, and by 2035 renewables will be responsible for 15% of world’s power demand. Carbon emissions are also expected to rise from 30.2 billion metric tons in 2008 to 43.2 billion tons in 2035 due in large part to increasing industrialization in developing countries throughout Asia and Africa.

Thoughts:
I will never understand the concept of projecting 30 years into the future. Life is too variable and most of the time these estimates don’t get anywhere near reality. I chose to include this story though because I think the study shows how our need for reliable energy sources is only going to get bigger. The EIA stated that we will still be largely dependent on fossil fuels by 2035, but I hope they are wrong. Don’t misunderstand what I am saying. I don’t have any grand delusions about the implementation of renewable resources, but, given their potential for energy production and the funds that are rolling into renewable research, I am almost positive that we will do better than 15 percent.


FRIVOLOUS
A 2009 article in The Sunday Times called out Google for emitting 7 grams of CO2 per internet search, and wrote that “Google is secretive about its energy consumption and carbon footprint”. Google responded this week by releasing its energy consumption numbers based on figures from the last few years. As it turns out, Google consumes about 2.3 billion kilowatt-hours of energy per year while generating carbon emissions 35 times fewer than the article originally stated. For perspective, 2.3 billion kWhs would power around 207,000 homes or 41 Empire State buildings for a year.

Thoughts:
This is largely a non-story. Google has been one of the most active companies on the planet when it comes to investing in new energy resources. They have also been involved in CO2 reductions that offset their own production. From the numbers I have seen, The Sunday Times was way off base in their estimates and should’ve done their research ahead of time. Trying to drag a company as big as Google with their slogan of “Don’t be evil” through the mud doesn’t look like it will end well for the British periodical.


NOBLE
Korea just activated their new superconducting cable manufactured by American Superconductor (AMSC). With copper prices on the rise, new cables like these are becoming cost-effective options for utility companies because they can carry 10 times the amount of power compared to standard transmission lines. This new version replaces several current superconducting cables, making it the longest of its kind in the world.

Thoughts:
I wanted to bring up this story because I believe it’s a step in the right direction for power distribution systems. Most grids around the world are woefully out of date, with the US being the prime example. We need to be smarter about power distribution across the globe. Without a smart and efficient way to distribute power, it will not matter how efficient we make the end use products. Like lighting, we rely far too heavily today on distribution technologies that were developed over a century ago. We are wasting power, wasting resources, and, given our efforts to upgrade, wasting time.


IDIOTIC
 Eleven wind farms in Britain were shut down following higher than average wind speeds as a result of Hurricane Katia in the middle of September. The National Grid actually paid the farms 2.6 million euros (title refers to the 1.2 million that went to just one farm) to shut down production for eight hours amid fears that the grid would be overloaded by excess electricity. For context, that is roughly 10 times what the farms would have received for actually selling electricity to the grid during that time period. The National grid made up the payments by tacking on additional charges to consumers electricity bills. Payments to cap electricity production are not uncommon and are increasing as more and more wind farms come online.

Thoughts:
You can probably tell from the description why this wins September’s idiotic category. First, The National Grid isn’t prepared to handle excess electricity from wind farms yet they encourage more and more to come online. People are starting to question the long term sustainability of wind farms because of human incompetence. As if wind energy didn’t have enough problems getting over human complaints about bird fatalities, noise, and aesthetics, inept implementations are now adding fuel to the fire. On top of that, because of their own failure The National Grid is passing on their costs to consumers, which isn’t fair. Wind farms should be an amazing source of energy when the winds pick up, but instead they have become a hazard due to mismanagement. Granted, wind turbines need a cut in speed and have a max rated speed, but from what I can tell the turbines could’ve handled the wind speeds. The National Grid not only lost out on capturing the excess energy, but spent millions to prevent its generation and screwed over consumers in the process. Someone please regulate this thing.

Sep 30, 2011

Power Your Next Project

I explained an idea I had for a Halloween animation using pumpkins, LEDs, microcontrollers, and a PIR sensor in my last post. Making all these items work with each other sounds all well and good, but none of them will even turn on without a stable power supply. Being a power electronics guy I am all about power supplies and efficiency, which is why I am dedicating this post to telling you how to get a power solution for your next project that just works…as all power supplies should. I will show you an example using my Halloween animation project.

First, you need to identify all the necessary voltages and currents that your circuit elements are likely to require. The microcontrollers I am using operate on 5Vdc, the LEDs use anywhere from 2Vdc to 4.5Vdc, and the PIR sensor can accept any voltage from 5-12Vdc (a higher voltage gives you more range). To narrow this down I am going to choose 5Vdc for all my elements. The LEDs can be driven directly off the microcontroller output pins, which will output the supply voltage on any pin I set high in the code.

But there is a problem with this approach. Each microcontroller will require its own 5V supply rail and there are four of them. Running four 5 volt power supplies off some extension cord is really impractical and a mess aesthetically. Instead, the simple solution is to use batteries to power each of the devices. Go do a Google search for “5V battery” and see what you can find for me. I will be here when you get back.

*****************************************************************

Well that was fun. I’m guessing your search turned up nothing and now you have come back here looking for answers. Suckers. The truth is batteries do not come in all types of voltages because their performance is directly related to their cell chemistries.

But let’s say you were able to find a 5 volt battery. Would that be good to use to power all these devices? In short, no. Even if you were able to find a viable 5V battery, it would likely discharge below a useable voltage before too long. Batteries do not maintain their nominal voltage and then just suddenly plummet to zero at the end of their life. Instead, what tends to happen is that you will get a gradual decay in the voltage present on the battery terminals over time like in the picture on the right, but the exact curve is largely dependent on cell chemistry. Just because the system cannot run off the battery at a certain point does not necessarily mean the battery is dead. If you did try to use a 5V battery for these modules you would end up throwing away lots of energy capacity because the voltage fell too low for the circuits.

Now is about the time I tell you that if you try to use a higher voltage and count on the voltage dropping over a usable range then you will likely blow up your device. So how is it possible then to get to voltage to stay at 5V despite battery discharge when dropping too low shuts everything down and going too high blows everything up? While there are many answers to this question, the one I must shamefully recommend is the voltage regulator.

Why am I ashamed to tell you to use a voltage regulator? Well, for reasons I will go into in my entry on voltage regulators, they are very inefficient. Using a DC-DC converter like a SEPIC or a Buck would be far more efficient, but at the cost of design time, price, and complexity. Voltage regulators will provide a constant output regardless of the input voltage, though there are caveats. First, voltage regulators need the input voltage to be higher than the output voltage. If I apply this concept to my Halloween project I find that I need to apply a higher voltage to the input of the regulator than the 5Vdc I need out of it. A 9V battery should do nicely.

Secondly, voltage regulators have what’s called a “dropout voltage” rating, which tells you the minimum input voltage above your desired output. For instance, the LM7805 pictured above is one of the most famous and widely used regulators on the planet (look into the LM317 for another). It provides a stable 5Vdc output with input voltages up to 40Vdc and a typical dropout voltage of about 2 volts (for future reference, this figure can vary with loading conditions). That means that if you want an output of 5 volts, your input voltage must be at LEAST 7 volts. Certain regulators can operate down to a dropout voltage of 300mV or lower. We creatively call these regulators “Low-dropout” regulators, or LDOs for short.

Since most voltage regulators rely on feedback loops to control the output voltage, you will likely need to add some bypass capacitors on the output. This can sometimes be a hidden cost associated with voltage regulators, but they are usually not a big problem. Make sure to check out the datasheet for the regulator in question because often times it will tell you what size capacitor you need. The image below shows the sample circuit configuration for getting a stable 5 volt output from the LM7805, and you can see that they recommend using capacitors on both the input and output pins.
I will show you how I chose the regulator I am going to use in my Halloween project in another post. This entry was meant to be a high level look at how to get common voltages for your next project (3.3V, 5V, 9V, 12V). If you need something other than 5V, never fear because lots of regulators are adjustable so you can configure components around it to get the output voltage you want. Again, the part's datasheet should give you some information on how it can be done. Datasheets are an engineer’s best friend.

Sep 28, 2011

Halloween Preparations

Now that we are rolling into October it’s time to kick off the holiday projects. I really enjoy these types of projects because it gives me a chance to come up with ideas that wouldn’t make sense at any other time of the year. Plus the holidays give me a fixed deadline for getting stuff done, which make me actually put in effort. Granted, this isn’t the coolest or most complex project on the planet, but it does give me a chance to get back into microcontrollers and work with some different enclosures (e.g. pumpkins).

There are a few elements to this undertaking that, implemented individually, are not hard do, but it can be tricky to make them all work well together. I made an attempt to illustrate how the system should operate in the graphic below. Follow along if you can.


First, I am going to use a Passive Infrared (PIR) sensor to detect motion outside my door on Halloween. When kids come to the door for candy, the sensor will detect their motion via infrared radiation and output a voltage. If the sensor doesn’t detect motion it pulls the voltage down to zero. I am planning on using these triggers to enable microcontrollers in four pumpkins. At this point, I am still trying to come up with ideas on how I can relay the trigger from the sensor to the four micros in the pumpkins. My first instinct was to use RF transmission, but I am also considering Zigbee and additional IR channels. Either way I want to go wireless to clean up the presentation and avoid kids tripping over excessively long lines of hook-up wire.

Once the PIR sensor sends out the “enable” signal to the four microcontrollers they will start an LED animation. By animation I mean that the pumpkins will flash at different times and in different patterns to create a small light show. The key to making this all work will be the timing between all four microcontrollers. In the worst case, I can hardcode the timing into all four controllers by basically guessing and checking until everything works correctly. However, to make things more dynamic and harder on myself I want to find a way to set the timing using the analog-to-digital converters (ADC) in the micros. By using a potentiometer to vary the voltage I feed into the ADC, I can control the delay used in executing the code. If I do it correctly, I think I should be able to let the code run and adjust the timing on the fly without having to reprogram the chips constantly.

So far all that I have managed to do is gather up some fake foam pumpkins from Oriental Trading for the aesthetics (see the picture). I found similar items in Michaels for slightly more money ($1/pumpkin) if anyone out there is interested but doesn’t feel like waiting for shipping. I also picked up a pair of artificial pumpkin carving tools from Michaels for about $3, which I have already found very useful.

I will be using the PIC16F690 microcontroller from Microchip because I happen to have four of them in my parts bin, but given the simplicity of this project just about any micro will do – PIC, AVR, MSP430, etc. I have also started looking at LED diffusers to spread the light across the inside of the pumpkin evenly. I tried something like this last year and the LEDs created hotspots with poor light dispersion.

My goal is to get some audience participation on this one. I am looking for any feedback on how best to put this all together. Give me your opinions on faces to carve in the pumpkins (leave links if you can), LED colors to use, animations to try out (no fire, please), ways to communicate between the various pieces, extra features to tack on, and anything else you want to share.

I will of course post more on this project as Halloween approaches. Those entries will likely be short update posts to discuss any issues I am having or to show my progress.

Sep 15, 2011

Atmel STK600 Unboxing

In an effort to keep things fresh here on To the Rails, I wanted to shoot an unboxing video of my new STK600 AVR development kit from Atmel. Unfortunately, I have neither the voice nor the patience to pull it off. At some point I will post the outtakes video so we can all celebrate my ineptitude, because, unlike the bum over at Sculptor by Day (see link below), I believe failure is worth showing off. I will be incorporating more video demonstrations into posts as time goes on so look for those in the future – though I probably won’t be saying anything.

Let me also take this time to give a shout out to Amelia Dalton over at EEJournal (see my Electronics Links tab). I was lucky enough to win this kit as part of her “Nerdy giveaway” that she does each week on her Fish Fry podcast. I highly recommend tuning in if you are interested in the latest and greatest electronics news. She also does interviews with the higher ups of various electronics companies, often discussing their latest technology and where the company is headed. So thanks Amelia for giving me the chance to hack around with this kit for free (Retail: $200).

The AVR architecture was developed by two students in Norway, and the first AVR microcontroller was manufactured in a Norwegian ASIC house in 1996. I know I haven’t talked about microcontrollers in this blog before, but believe me there will be an in depth discussion coming at some point. For now, just know that a microcontroller is essentially a chip that is capable of being programmed to perform various I/O functions (i.e. read signals, output signals, perform mathematical operations, etc.). AVR is Atmel’s family of microcontrollers that competes with the MSP430 series from TI and the PIC line from Microchip, among several others.

Anyway, back to the board. The STK600 is an 8-bit and 32-bit development board and starter kit for the entire line of AVR microcontrollers. Near as I can tell it came out some time back in late 2007 as a replacement to the STK500. Notable upgrades include a 20MHz system clock, USB connectivity for programming, and more I/O functionality. It was actually released simultaneously with several other development boards, all of which were codenamed after Norse mythology. The STK600 is codenamed Odin.


I have embedded the YouTube video above where Atmel introduces the line of AVR development tools that includes the STK600, and I think it’s worth checking out if for no other reason than the concept art they use for the first two minutes or so of the video.


What makes this board unique is the routing system Atmel has implemented to make it compatible with their entire line of 8-bit and 32-bit micros. It works using a sort of programming sandwich. The top layer consists of a microcontroller loaded onto a “socket card”, which is a card that holds certain packages (shapes) of microcontrollers. The middle layer is called a “routing card”, which takes the pins of the microcontroller you are trying to program from the socket card and routes them to the correct places on the main board. This is often necessary because not all chips use the same programming or I/O pins. The bottom layer is the main board, where all the hardware for interfacing with the microcontroller resides. You can secure the sandwich together using plastic screws that are provided in the kit (pictured).

The STK600 kit also includes a USB 2.0 A/B cable, two 10-wire cables for programming with the JTAG header, one 2-wire cable for shorting jumpers, and an ATmega2560 microcontroller (8 bits, 40 pins) pre-soldered onto a board for testing/introduction purposes. You can see a picture of what comes in the kit above.

While the sandwich system makes this board very versatile, it also creates a huge burden on developers because you need to purchase a new routing card and possibly a new socket card each time you have to program a different type of microcontroller. In the hobbyist realm where I operate, Dual-Inline Packages, or DIPs, are the most popular because you don’t have to deal with getting a custom PCB for surface mounting. The DIP socket card is $49 and the subsequent routing cards for various micros go for $17 on Atmel's online store. While I am not particularly happy about having to drop $66 plus shipping on this board just to make it useful, I look at this as an opportunity to experiment with AVRs so I am willing to make the investment. Actually, I have found kits that sell the DIP socket card with 7 routing cards for around $110, so I may go that route.



One of the links below will take you to the technical specs for the STK600 on Atmel’s website if you are interested in taking a look. I will be sure to update on my progress working with this unit in the future.

Links
Routing Cards on Atmel’s Store: http://store.atmel.com/PartDetail.aspx?q=p:10500155

Sep 11, 2011

Volts Kill

I hear people say all the time, “voltage is not as dangerous as current”. If you are like me, when you hear this you immediately think “shouldn’t natural selection have taken care of these weak minded dregs by now?”, but later come to find that, alas, they still exist by the thousands. So to any of my normal readers and those who may have stumbled upon this blog by happenstance let me say this once and for all: voltage creates current flow! Do not ever assume that because something is “low-voltage” that is cannot deal you any significant damage. For the record, most industry products are considered “low-voltage” if they run off of less than 48 volts, which is enough to cause you discomfort. It also depends heavily on the voltage source of interest. Constant voltage sources will deliver a current according to Ohm’s law. Capacitors or other energy storage devices, on the other hand, are capable of delivering massive amounts of current quickly despite a “low voltage” on the capacitor.

Figure 1. Capacitor Discharge into a CD, Courtesy of Ben at Buxtronix
So how does a statement like this become so widely accepted? Well, like many scientific myths there is a grain of truth embedded in the nonsense. The truth is that human skin is generally quite tolerant of certain voltages because its resistance is high enough that the voltage source cannot provide, or drive, enough current through us to cause physical harm. The amount of current passing through your body is what will ultimately kill you so in that sense it’s true that current is the most dangerous aspect of working with electricity. However, there can be no current flow without a voltage source to push the current through a channel. That’s the end of the argument if there ever was one. But just to prove my point, let’s attempt some science.

Ohm’s law applies to humans as well as electronic components, but humans are not purely resistive. We are capable of building up charge like a capacitor and then discharging that energy through our skin. For instance, when you rub your socks along the carpet or a balloon against your hair you are building up charges in your body. To release the charges, you need to touch a grounded piece of metal, creating a static shock.  In order to model this effect in humans, researchers usually use what’s called an RC circuit. I will cover capacitors and RC circuits more in future blogs so don’t get weighed down in how these circuits operate. I will give you the highlights.

The human charge equivalent circuit is pretty simple: a 100pF capacitor and a 1.5kohm resistor in series like in Figure 2. The capacitor is capable of charging up to the source voltage, but it is only 100 picofarads meaning it stores very little energy at low voltages. In fact, we can figure out exactly how much energy is stored in this capacitor with a simple formula: E = 0.5*C*V2.
 Figure 2. Human static charge model

Let’s assume that you have charged yourself up to 10,000 volts (10 kV) by building up static charges on your body – and, yes, this voltage is typical of a strong static shock. Using the formula we get a total energy of 5 millijoules. For reference, you have radiated about 500 joules away as heat since you started reading that last sentence. I have also taken a picture of a low voltage 100pF capacitor so you can see exactly what sort of charge tank we are dealing with here.

Figure 3. Scale of a low-voltage 100pF capacitor

*****WORD OF WARNING*******
Here is where it is important to make the distinction between voltage and charge in a capacitor. The amount of energy that a capacitor can hold will increase with capacitance and it is critical that you understand this if you ever plan on handling larger capacitors. For example, let’s assume that a 100 farad capacitor is charged to 2 volts. Noobs may think, “only 2 volts, pfff, what’s the big deal?”. Here’s the big deal: its 100 farads of capacitance. Using the same equation as above, we find that this capacitor when fully charged will hold 200 joules, which is 40,000 times more energy than humans store in our bodies during a decent static shock. THIS AMOUNT OF CHARGE CAN KILL YOU!!!! If you were to discharge this capacitor through your body it would be equivalent to getting a shock from a defibrillator, which would mean game over noob.
*****BACK TO THE SCIENCE*****

How is it possible then that 5mJ of energy could be responsible for the sparks we see when we get a static shock? Hey, why do you ask so many freaking questions? (Sigh)… If I must explain… it has to do with air’s dielectric field strength. All you really need to remember is that voltage is like an electrical pressure, and with enough pressure you can knock down damn near anything. In the electrical sense, this means that with a high enough voltage you can get just about any material to conduct electricity, including air. Air’s dielectric field strength is rated anywhere from 10 – 30kV/cm depending on atmospheric conditions. That means if you had a 10kV voltage source (like your charged body) and a conductor (like a grounded piece of metal) 1 centimeter apart you would be able to ionize the air between the two and create a conductive path for electrons. This dielectric field strength is why you don’t get static shocks from across the room.

But there is another factor in this equation that we haven’t really considered:  time. The length of time you are exposed to a certain voltage has a huge impact on whether you survive or not. When you discharge yourself into a ground, there is a large initial current that flows through your body. Fortunately for lovers of shag this surge of current lasts only a fraction of a second and decays rapidly in magnitude (such is the nature of RC circuits). I have illustrated the expected current flow of our example static shock in Figure 4.





Figure 4. Example static shock discharge curve

You can see that at the very first instant a current path is created between you and ground, a current in excess of 6.5 amps is flowing out of your body. However, just 150 nanoseconds later the current drops to less than 2.5 amps. After just 1.5 microseconds, the current will drop below 300 microamps and you won’t feel anything anymore. While the initial current drain was large, the overall energy dissipated was small and it was dissipated quickly so no harm was done to the individual.

This may be the case in with static shocks and voltage, but what about electric circuitry? In electric circuits there generally isn’t a finite amount of charge stored somewhere that will dissipate once you touch it. Instead, a continuous current will flow through your body causing severe pain, cardiac arrest, muscle paralysis, and eventually death assuming the current is large enough. Again, though we are worried about continuous current flow and its magnitude, the voltage is ultimately what will push the current through your body.

Just to show some stuff blowing up, check out the video below. Ben Buxton of Buxtronix works with high voltages and large capacitances on a fairly regular basis. In the video, he uses a 0.25 microfarad capacitor charged to 23kV, which is about 150 joules according to our earlier equation. Check out the best way to blank a CD.


That ended up being a lot more information than I wanted to give in this post. For clarity, let’s review the important notes again:
  1. Voltage, charge, and current are all tied together. Saying one is more deadly than another is ridiculous.
  2. Energy storage devices like capacitors differ from generic electric circuitry because they are capable of delivering a massive amount of energy into a load (like you) very quickly.
  3. The amount of energy a capacitor can hold is dictated by the capacitance and the voltage. A 100 picofarad capacitor at 10kV has much less energy than a 100 farad capacitor at 2 volts.
I will never discourage someone from starting to work with electronics and high current applications. However, the hobbyists out there need to understand the nature of charge before you get into anything serious or you could up severely hurting yourself and/or someone else. Mistakes will happen, but make sure you have taken the precautions to be able to play another day noobs.

Sep 7, 2011

Series-Parallel Quiz Solution #2

Once again, one reply was all it took to get the right answer. I posted the circuit in Figure 1 just over a week ago after my second EE Fundamentals entry on the differences between series and parallel connections. The question asked you to find the total power dissipation in the circuit. You needed to apply concepts from all the previous EE Fundamentals segments to solve the problem.  

The correct answer: 3.6 watts.
 Figure 1. Quiz circuit from the last EE Fundamentals Post

Similar to my first quiz, the easiest way to solve this problem is to reduce the circuit to its simplest equivalent model. Step 1 is to look into the circuit from the perspective of the source, which is a voltage source in this case. Looking into the circuit from the left, we note that the source sees two 10 ohm resistors in series with a 20 ohm resistor on the far side. Adding up these values according to the rules of series connections we find that these three resistors can be reduced to a 40 ohm resistor. We now have a circuit that looks like Figure 2 below.
Figure 2. The circuit from Figure 1 after reducing the far right side

We want to keep reducing the circuit from right to left. After combing the first three resistors, we now have two 40 ohm resistors in parallel with each other. When two resistors of the same value are in parallel with each other, their equivalent resistance is half their nominal value. In this example, that means we can model them with a 20 ohm resistor like in Figure 3. If these resistances were different values, you would need to use the parallel resistance rules from my first series-parallel post.
Figure 3. Equivalent circuit after series and parallel resistance reductions

At this point, it looks just like what we started with in Figure 1 before reducing the circuit. I would hope that by now you could finish this up since you just do the same thing over and over until there is only one resistance left. When you are finished, you should end up with the circuit in Figure 4.
 Figure 4. Final equivalent model of the circuit in Figure 1

Cool. So we found the equivalent circuit….but that wasn’t the question I asked. To find the power dissipation you will have to make use of the hints I gave you in the quiz question. The power loss in a circuit is found by summing the power losses of all its elements. Power dissipation in a circuit element is equal to the voltage across the element multiplied by the current through the element. If we look at our circuit, we only have one element to worry about assuming the wires connecting the resistor to the source are ideal conductors.

So here is what we know:
  • Supply Voltage: 12 volts
  • Equivalent circuit resistance: 40 ohms
  • Power Loss = V * I in the resistor
To get the current, use ohms law (I = V/R) and divide the voltage across the resistor by its resistance. You should find that the current is equal to 300 milliamps. Therefore,

Power = V*I = 12 volts * 0.3 amps = 3.6 watts.

It is possible to go branch by branch and sum the various voltages, currents, and power losses, but that should not change the answer. Equivalent circuit models like the one we used in Figure 4 are great for looking at this type of circuit because they break it down to its simplest form while keeping the analysis completely valid. Next time, we solve RC circuits.