Saturday, November 6, 2010

Battery Powered ICs

All integrated circuits (ICs) that I have come across run off a specific voltage. Powering these with a power supply is as easy as choosing the correct voltage and plugging it in. But what if you want to use ICs with batteries?  How are you supposed to supply 5 V using a 9 V battery? Will 4 x AA batteries be able to run an IC specified to work at 5 V?


The first thing you want to do is look at the datasheet for your IC. These can be found online by simply typing in the IC code, for example a low-powered NOT gate is 74LS04, then the word "datasheet". There will be a section of maximum and minimum voltages. If you're lucky your batteries will be within this range, but most of the time it will fall outside. A pretty common operating range is 4.5 - 5.5 V. Whilst you can go ahead and put in 3 x AA batteries, to make 4.5 V, that would only power the circuit for a short time before it falls out of the threshold range (remember, batteries lose voltage as they are used). It is much better to go over the threshold range and use a voltage divider or clamp diodes to keep the voltage within the operating range.


Voltage dividers consist of two resistors. The voltage in to the IC is taken from the middle connection of the two resistors and the ground is, well, the ground. This means that the IC is in parallel to the second resistor, meaning that its voltage has to be the same as the voltage on that resistor. 
Because the voltage over series components is divided up (similar to currents in parallel), only a certain fraction of the total voltage exists at R2. This voltage can be calculated by Vs * R2/(R1+R2), or the supply voltage multiplied by R2 over the total resistance. In the circuit above, Vout would be equal to half of Vs.


So, if you had a 9 V battery and a IC which ran at 5 V, you could have R1 as 4k and R2 as 5k. 


5/9 * 9 = 5 V

Simple enough, but there is one major issue. What happens when the voltage of the battery drops? Say, down to 8 V...

5/9 * 8 = 4.44 V

After a drop of 1 V, this voltage divider cannot be used. Seems a waste of a perfectly good battery, no? This is where the magic of zener diodes come in. Simply replace R2 with a zener diode with a voltage within the operating range in reverse bias, and the circuit will work until the voltage of the battery drops below the zener diode's operating voltage. So, if you have a 5.1 V zener diode, your IC will run until the battery loses 3.9 V. Much better. R1 can be any value  you wish but it has to be there to drop the left over voltage. It does help limit the current, so chose a value that suits your needs.

Thursday, November 4, 2010

AND Gate Attempt

So, after designing a NOT Gate, I thought it'd be fun trying other gates, so this next attempt is for an AND Gate. AND Gates are only on if both inputs are on. This gave me the idea of using one of the transistors as a switch, and using that output to drive the base of the second transistor.
It does work. If either input is grounded the output is low. There is a problem though. Unless input 2 is actually grounded it gives a high result. TTL inputs are natural high though, but it is the inconsistency I am concerned about. Sure, this circuit works, but it isn't the best it could be. There's no doubt another way I could design this that would work exactly to my expectations. 


EDIT: This circuit was drawn incorrectly. Instead of ground, the emitter of Q1 should be connected to Vs. I will redraw this circuit at some point.

Improved NOT Gate

So after taking a break by drawing up flowcharts for my lab report, I was drawn back to the NOT Gate problem. I realised I could probably isolate the power supply by using another transistor, with the supply connected to the base and the emitter of the transistor. The collector would be connected to the output and to the collector of the second transistor. 


It works essentially the same way as the previous NOT gate, but it doesn't short the whole power supply. 


There you have it. A working NOT Gate. And it does actually work. I did test it.

Simple NOT Gate

So, I was ordering parts off eBay for a Binary Clock I am planning to make, and I completely forgot that the clear for the flip flops I ordered are triggered with a low input. Unfortunately, that means I did not order any NOT gates, and I do not actually own any. Not wanting to wait for the three weeks or so it'd take to get the NOT gates, I thought I'd have a go at making my own from transistors.

The circuit above was what I came up with. All it does is use a transistor as a switch. If the input to the base is high, the output is low. If the input is low, the output is high. 

There's a problem though. This circuit would also ground Vs, so it is no good in applications unless  Vs is on a separate power supply to everything else, or separated somehow.

Back to the drawing board. (Actually, back to doing real uni work.)

FIRST!!!1!!one!

Right, so, this is Raeden Makes Stuff, a blog dedicated to all of the random stuff I make, or attempt to make, and the thinking behind it all.


This is mainly to give people a rest on facebook from my spam about electronics stuff and collect all of the information into one neat basket.


I tend to try to sometimes work out things that already have solutions, and I know Google would be quicker, but you don't fully understand something until you work it out yourself.