Saturday, September 20, 2014

DIY Powerbank 2014

This post is about an easy circuit diagram that can be used as a power bank. It is not ideal for high current operation though as linear regulator will be used in this case. For storage purpose either Sealed Lead Acid or Lithium battery can be used.

With the development of mobile devices like mobile phone or tablet or anything similar their power requirement is also increasing rapidly. Let's look back a few years, that time mobile phones had batteries like 850mAHr to 1200mAHr and with that it could run for days after days and now we have 2000mAHr to 6000mAHr rated batteries on our mobile devices but we can hardly go a day with that. Power consumption is not the only thing either to be honest, now a days huge amount of things can be done on a mobile device hence we use them more.

 So what will happen if you are on the way to someplace or in someplace where it is hard to find a AC wall outlet and your phone's battery is dying? For that purpose many portable charger are available in the market ranging from low capacity to very high capacity. Making such a device is a very easy and fun not to mention very useful too. So why not making one for yourself?

Now before we jump into the diagrams I will highly recommend you to read this post where I tired to explain how these portable chargers work, if you can grasp the idea of that it will be far easier for you to make one.

How does portable chargers work.

We can make this device using many different diagrams and techniques with output targeted for many different devices so there will be multiple diagrams and I will be dividing the whole diagram into blocks so that it can be easily understood. Let's look at the block diagram first.

Block Diagram:

Let's take a right to left approach. The battery that we will be using, which I will talk more on later, might not have the proper voltage that we need to charge our phone or tablet. Most modern phones takes in 5V and it will be really handy to attach an USB port so that we can plug in any cable and charge any device that supports charging from USB. Sadly to keep stuffs simple I won't be going into the fast charging capability in this post. Now let's take a look at 3 different diagrams that can be used as converter circuit.

Converter Circuit:

First one is plain and simple linear type using the good old 7805, that can provide 1A at 5V. Enough for most devices but might waste a lot of power. Also the battery voltage must be 6.5V or higher. Before looking into in let's just take a look at the USB port configuration as we will be wiring the output of it to the USB female port.

USB port Configuration

So now we know where to connect the Ground wire and where to connect the +V wire. So let's check out the first diagram.

This probably is the simplest circuit that will work just fine but the problem is the current output is limited to 1A and the 7805 chip will get a bit hot which means it will waste a good amount of power. Yet it will work, if you give the proper input voltage it will convert it to a steady 5V, even if the input voltage decreases over time and if it is supplied with a battery it will decrease over time but the output will be constant 5V. The indicator will lit up showing that the circuit is in operation.

If you want to learn more about such regulators read this post.
Linear voltage regulation with 7000 series integrated circuits.

Time for the second diagram. This one is similar to the first one in a sense that it will take in a voltage that is slightly larger than 5V and lower it down to a constant 5V. There are some benefits of using this one, which are higher efficiency and higher output current. This small circuit can provide about 3A and can achieve a very respectable 80%+ efficiency. So this one is better suited for using it with battery.

This one is a bit complicated than the previous one. The output 5V will be connected to the USB A just like the previous one with proper polarity.

To better understand this circuit read the post linked below.
5V Multi-purpose SMPS.

Now lets take a look at the third diagram. Probably you have already noticed that in the previous two diagrams you will need an input voltage higher than 5V to operate but what if you are using single cell lithium ion which is a very common practice and we know single cell lithium ion will have a voltage of 4.2V maximum. So the diagrams above won't work with that. So we will be needing this one.




As you can can see very simple diagram with only a few components, I will explain the whole circuit step by step.

Let's start with the input section, a standard female jack is used as input and putting a source of around 11.5V to 26V will be fine for this circuit but keeping the voltage as low as possible will generate less heat during voltage regulation. 

The input is directly fed into a positive voltage regulator, 7809. It will give a constant 9V output. A 470uF electrolytic capacitor is used for smoothing and decreasing voltage ripple. A LED is connected with it in order to indicate charging. Next the 8.4V Lithium Ion batteries are connected via a 4007 diode. This diode performs two very important role, firstly it blocks the DC voltage to flow from the battery to the regulator and secondly it drops around 0.7V thus making the output around 8.3V. Charging a Lithium ion battery is a very complicated procedure but lithium ions need to charged like through that procedure and the voltage needs to be very stable. So here we are charging a 8.4V pack with 8.3V. It's okay actually, we might loose its capacity slightly but we will get more charging cycles out of it.

The next thing is the battery is connected with another regulator via a switch. This regulator is a 5V one, 7805. This chip can provide continuous 1A at 5V. Which is enough for charging most modern mobile phones and tablets.

A LED is connected to the output of the regulator to indicate that the regulator is on. Another 220uF electrolytic capacitor is added to smooth the output of the 7805 regulator. Then the output is connected with the a USB female port.

I have added a few more LEDs through a 0.5W resistor and a switch. This will work as an emergency lamp too. 

Notes on a few topic:

When selecting an input voltage you have to remember that this is a linear voltage regulator so it will waste energy by producing heat. The generation of heat will be Output Current * ( Input Voltage - Output Voltage) so it is clear that the higher the input voltage is more energy will be burnt and more heat will be generated. So, I fitted the both regulators in a heat sink. The Tabs are actually connected to the 2nd pin of the regulator. If you want to learn more about this you can read this post.

7805 on the left and 7809 on the right

Next thing is the battery. Lithium ion is a very sensitive type of battery. Misusing that may cause severe damage to the battery and may cause damage to the user. Lithium ion needs to be charged with a constant current at the first stage then a constant voltage is needed. To keep stuffs simple I'm going to use low current constant voltage. Another thing is lithium ion shouldn't be charged with more than 50% of its current capacity. That means if you have a 2000mAHr pack you should not cross the charging current over 1000mA, higher current will generate more heat and damage valuable battery life. To learn more about how to charge lithium ion battery you can read this post. For my purpose I'm using two 4.2V Cell each rated at about 3300mAHr-3500mAHr, and I'm charging that with a maximum of 1000mA at 4.15V per cell so it should be fine.

Two 4.2V 3.3AHr lithium Ion Cells

Now you need to be very cautious with the polarity of the USB port. A picture of the port diagram is shown here. Make sure you connect the proper pin to the proper polarity. Check the polarity before connecting any device. As this will be a small circuit I used a small piece of board for assembling a few components. 

On the left a USB female jack


As I was saying lithium ion shouldn't be charged with more than 50% of its capacity, mobile 
devices have lithium ion batteries so they shouldn't be charged with more than that. As this device provides about 1A at 5V that means its safe not to charge any cellphone battery that has a capacity of less than 2000mAHr.

Possible Upgrades:

1. Like I said before this diagram incorporate constant voltage charger for the Lithium ion battery, you can surely swap it with a more accurate proper type of charger that will provide constant current at the starting and changes to constant voltage as the current requirement for the battery to charge drops.

2. Next thing that you can do is swap the linear 5V regulator with a switched mode regulator. Switched mode regulator burns less energy so less heat and more efficiency.

3. You can also add a output current controller and maybe a selector for different output currents.

4. I have used bulky lithium ion batteries, you can use the 18650 type battery.

5. Adding a battery voltage meter might come in handy, you can do that too.

6. Multiple USB ports can be added.


1. Lithium Ion batteries are very sensitive and misusing them might cause catastrophe. Don't do something unless you are 100% sure about it. Fire Hazard.

Final Product:

Top View of The final Product.


1. Datasheets.
2. Visit my full blog.

That's pretty much everything, good luck everyone.

Tuesday, September 16, 2014

Build Your Own HTPC - September 2014

Welcome back everyone. Let's build a HTPC or home theater personal computer. This will be a small and cheap build and you will be able to do the following things-

1. Web browsing,
2. Light weight gaming,
3. Game Streaming,
4. Recording TV shows,
5. Seed box,
6. Network Attached Storage.

Lot of potential here so let's look at the parts.

Processor : 

AMD Athlon 5350 Kabini 


1. Very cheap.
2. Support for 1600MHz Memory,
3. Built in AMD 8400 series Graphics,
4. Quad core 2.05GHz,
5. 25W Thermal design power.

The reason for choosing this processor is of-course it's  good price to performance ratio. This is a quad core processor that runs at  2.05GHz  and pretty much enough for everyday computing, entertainment stuffs like music, movies or surfing the internet and also good enough for light weight gaming, different applications and programming. In overall comparison it beats the Intel J1800 CPU which is slightly costlier than this one so indeed a great value. Memory controller of this processor can handle 1600MHz too which is a plus side as we will be using the integrated graphics processing unit.

Speaking of which the graphics processing unit can even handle 4k videos although in 24Hz but still 4k and like I mentioned above you can do light gaming too. 

Another cool thing about this processor is it's thermal design power, which is only 25W and less amount of heat and noise. Not to mention low electricity bill if you plan to keep it on for seed box or network attached storage.


Asus AM1M-A


1. Two RAM slots,
2. SATA 6Gbps port,
3. USB 3.0 port,
4. PCI express x16 slot,
5. HDMI that supports 4k,
6. Gigabit LAN,
7. Very cheap.

Asus is a well known brand for innovation and reliability, this board may be cheap but it has enough features to be a perfect base for a  HTPC. It has two RAM slots enough for the works it is intended to do.

This board has SATA3.0 6Gbps support which means you can use high speed storage. Typical configuration might be one Solid state drive as boot drive and couple mechanical drive to hold the media files. It also has USB 3.0 which will allow user to copy data to USB device faster or just plug in a USB device and watch a high definition movie without any issue. It has built in Gigabit LAN controller so better speed over the LAN. If you plan on using it as network attached storage I will recommend using wired LAN.

It has PCI Express x16 and x1 slots, can be used for adding more peripherals and it's HDMI supports 4k resolution.

Looking at the price This processor might cost around 65US$ and board might cost around 35US$, as of September 2014 and in October 2016 the prices are around 40US$ and 35US$ respectively.



For this purpose a 4GB 1333MHz RAM will be enough but if you want you can add in another 4GB kit.

  Single 4GB one will cost around 20US$

Now comes the Storage:

To keep the system cheap I will be using a Toshiba 1TB Drive.


1. SATA 3.0 drive so should give us about 150MBps consistent speed.
2. 7200rpm so seek time should be good.

This one might cost around 38$.


For computer case it is totally up to you get whatever you want. Make sure it has enough airflow and if you plan on keeping it at the drawing room you might want to look for something small and something that can blend in.

Power Supply:

If you want to keep the system running for 24/7 you will need a good power supply for sure. So let's take a branded one.

Corsair CX430

Corsair is a very well known power supply unit maker, CX series might be their lower end series but it will get the job done pretty nicely. This 430W 42US$ unit can provide around 32A on its 12V rail which is more than enough for the whole system build and have enough headroom for adding more storage or even a lower end video card.

Last Thing the Operating System:

For the operating system I think it will be great if we use Ubuntu. Ubuntu is a free operating system and it can do most stuffs that windows can do except for gaming. And this system is not for gaming so we don't have to worry about that. And the fact being free makes this operating system very appealing.

First Published: September 2014.
Updated: October 2016.

Hope you guys enjoy reading it.

Read my other posts here. Stay great.

Monday, September 8, 2014

Car Audio Using TDA1516

Good evening everyone. Hope everyone is doing great. 

Now I'm going to write something about a circuit that can be used in car and also can be used in anywhere. The very positive thing about this amplifier circuit is, it runs from 12V DC that means you can use it in car, directly powering it from the lead acid battery or you can use it in any outdoor situation using sealed lead acid or lead acid battery or you can use it in your home powering it up from an computer power supply. Most amplifiers require high voltage to run so they can't be powered by the computer power supply but with this diagram you can do that. I have a plan to make this type of amplifier directly in a computer case, one day.

Enough chit-chat let's dive into the project, the integrated circuit that I'm going to use is the TDA1516, cool thing about this chip is you can use it as Bridge Tied Load amplifier or just stereo amplifier and this chip requires very few external components which makes it very simple to work with.

In this particular diagram I will be using the bridge tied load configuration so it will be mono. Obviously you will be needing stereo so just make two of these identical copies. With 12V supply this will deliver around 20W which is enough for most applications.

The IC

A 13 pin SIL(single in line) package IC.



How it works:

A very simple diagram. TDA1516 is an integrated class B amplifier that comes in a 13 lead single in line package. As I mentioned above this is diagram will employ a bridge tied load configuration so it is mono and has only one input. Now to wire it as a BTL(Bridge tied load) we need to give the input to inverting input of one amplifier and non inverting input of other amplifier, main goal of BTL is to increase the voltage swing, this configuration will allow us to do so.

Pin #2 and #13 are two of those input pins. A 1uF or .22uF capacitor can be used as decoupling capacitor.

Pin #1 is actually a non inverting input, as its a BTL amplifier this pin is connected to a reference voltage which is the Pin # 4.

Pin # 3 and #7 are used as signal ground and power ground. Which will be simply tied to the ground reference point or the 0V point or simply the negative terminal of the supply.

Pin #5 and #9 are two outputs from two internal amplifiers and this is where we will connect the loud speaker.

Pin #11 is a stand by switch. 

Pin #10 is for the positive voltage input pin. It will be hooked up to the positive terminal of the power supply.

Pin #6 and #8 are used for bootstrapping. I'm not going to get in depth of what it is, you can learn more about it here. These two pins will be directly connected to the positive supply.

Stereo Application:

Like I said before this IC is great for stereo too, although in stereo mode it will give only 5W per channel on 4ohm speaker and 12V supply voltage. Still That application may come in handy.

To use it as a stereo amplifier all you have to do is to connect the Pin #2 and Pin #4 and stereo input will be given to Pin #1 and Pin #13. These two pins won't be connected anything other than the input. Input capacitors are needed. And stereo output will be given to Pin #5 and Pin #9 respectively. Use output capacitor of about 1000uF. And then it will act as a stereo amplifier.

A few positive things about this diagram:

1. Flexibility in use - either BTL mono or stereo. Wider voltage range of about 6V-18V.

2. High output power even from low voltage.

3. Fixed gain.

4. Short circuit, thermal and reverse polarity protection.

5. Requires very few external components.


Must use a good quality heat sink with the IC and make this on a good quality printed circuit board. 

That's all. Good luck building this. Keep experimenting.

TDA1516 Datasheet.

Read my other posts here.