Monday, December 22, 2014

4W Amplifier With LM383

This post is about an amplifier with wide voltage range and moderate power output.

Where to use?

1. With a desktop computer as a cheap speaker, you can just hook up the speaker directly with your computer power supply unit saving you the cost of making a power supply unit.

2. Where bass is not much of a concern.

3. Can be used with Sealed lead acid battery or lithium battery so portable.

4. Can be used in automobile. 

What's good about the design?

1. Requires only a few external component.

2. Can be operated from a wide voltage range of 5V to 20V. Although at 5V it will only produce about 1W which is not that practical but at 12V it produces around 4W on 4‎Ω load which I think is the sweet spot.

3. Circuit is pretty easy to design.

4. Can be powered directly from Car Battery or a 19V Laptop charger.

Components needed: 
(For Mono Amplifier) 

1 2200µF
1 1000µF
1 470µF
1 10µ
2 0.22µF

1 1Ω

Power OP-AMP:
1 LM383 + Heat Sink


The Diagram


1. Use 25V Capacitor for 12V Input and 35V for 20V Input.
2. Make another Identical one to get Stereo.
3. You can add a 50kΩ variable resistor to control the volume.
4. You might omit the 1000µF capacitor if your power supply already have one.
5. Changing the 2200µF capacitor to 1000µF will reduce the lower frequency. 
6. Solder the 0.22µF capacitor of the Output section as close as you can to the Pin 3 and 4. 
7. Make sure to assemble in good quality PCB with proper Grounding.
8. Low impedance speakers will yield higher power at the expense of distortion.
9. Higher Input voltage will yield higher power but 20V must not be crossed.
10. Read the Datasheet for more information.


Datasheet of LM383
Index to my blog.

Thursday, December 18, 2014

Low-dropout Voltage Regulator

Good afternoon everyone, hope you guys are having a great time. This post will be about a regulator, a linear one, although I have posted about linear voltage regulators earlier, this one is a bit different, it is a low-dropout voltage regulator. Let's dive in and see what it is. In this post I will not be explaining how it works, will talk about that in a later post.


What is a Low-dropout Voltage Regulator?

A low-dropout voltage regulator is such a regulator that can work at a very small input-output differential voltage, that means this voltage regulators can regulate the output voltage even when the output voltage is very close to the input voltage. If you use a standard linear regulator(for example a 78XX), you need a minimum difference between input and output voltage of about 2V, so if you want 5V, you have to provide minimum 7V as its input. If input goes below that voltage the regulation will no longer work. This 2V margin is called dropout voltage, you can find it in the datasheet of respective element. Low-dropout voltage regulators have much lower dropout voltage about 0.5V-1.5V.

So why do we need this?

As for the linear voltage regulators, the lower the difference between input and output the higher the efficiency it will have because the power dissipation of the device is usually the difference between input and output voltage multiplied by the current its supplying, so low-dropout regulators allows you to input a much lower voltage than that of a normal regulator allowing much higher efficiency, lower heat generation and of-course lower minimum operating voltage.

What do we need?

In this post I will be writing about three different low-dropout voltage regulators. First one is a fixed 5V output regulator which has a 0.5V dropout and can provide 1A of current. This is ideal for many small projects that does not require much current. This integrated circuit can provide other voltage levels too but I will write about the 5V one right now.

Components needed for this:

1. Integrated Circuit : LM2940
2. Capacitor : 0.47uF at the input to suppress noise, 100uF electrolytic at the output to maintain stability, low ESR(Equivalent Series Resistance) capacitor preferred, 0.1ohm-1ohm capacitors.
3, Heat sink and thermal interface material for LM2940 if necessary.


Low dropout voltage regulator using LM2940

Pretty simple diagram, not much to talk about. Just for the capacitors 0.47uF one is needed if this circuit is located far from the power supply unit itself and you can put a lower rated capacitor at the output(although minimum 22uF is needed) but a 100uF will just work fine. I have used this 100uF one for better transient response.

Great thing about this integrated circuit is it has built in short circuit current protection and over-voltage and over-temperature shutdown feature.

Next I want to write about a variable voltage one which can provide an output of 5V-20V with a 1A of output current and has the similar 0.5V dropout like the LM2940.

Components needed for this:

1. Integrated circuit: LM2941.
2. SPST switch(single pole single throw).
3. Capacitor: 0.47uF(ceramic type), 100uF low ESR electrolytic(Same as above)
4. Resistor: Depending on voltage. It is good to use 1Kohm resistor as R1 to ensure bias current error from adjust pin will be negligible and none of these resistors should be shorted.
An 18Kohm resistor is needed for the ON/OFF pin.
5. Heat-sink and thermal interface material of LM2941 if necessary.


Variable Low dropout voltage regulator with LM2941

This one is also another simple diagram which can be used to build a variable voltage output. Here the R1 and R2 sets up the output voltage as shown by the formula. Here 1.275V is the typical reference voltage of this integrated circuit. For example a resistor value of R1=1kohm and R2=8.6Kohm will provide an output of 12.24V.

For the capacitor, it is same as above. 

For the On/Off switch, as this integrated circuit does not have internal pull up resistors, an external pull up resistor is needed for proper shut down. If you want to omit this function you can just connect the ON/OFF pin directly to the ground so that the circuit will always run.

Next and the last one is another very simple diagram that can provide a 5V output and very popular as SMD(Surface mount device-SOT223 package). In this diagram I will using a LM1117-5.0 which can provide 5V, although it is available at other voltages and also variable type and about packaging it is also available in TO-220 package. It can provide around 1A and has a dropout voltage of 1.2V.

Components needed: 

1. Integrated Circuit: LM1117-5.0
2. Capacitor: Two 22uF electrolytic with low equivalent series resistance. Higher capacitance will provide better transient response.
3. Diode: IN4007 as a protection diode.
4. Heat-sink and thermal interface material if needed.


Diagram Using LM1117 5.0

This one is a very simple diagram too. About the capacitors it is same as above and capacitor with higher capacitance can be used. 

About the protection diode, it is optional, in normal condition it is not needed however with large capacitor and the input and ground shorted that capacitor will be discharged through the output pin that might damage the integrated circuit, in that case a protection diode is needed.

This integrated circuit is widely used in Arduino Uno or similar development boards, In this picture of this arduino board, you can see that the 1117-5.0 (marked in red square), the input and output 47uF low ESR solid capacitor(marked in black square) and the protective diode M7(marked in white square, It is similar to 4007).

Arduino Uno

So that is pretty much about Linear Low-dropout voltage regulators, hope you have enjoyed reading.

More Resource:

1. Understand low-dropout voltage regulator.
2. LM2940 datasheet.
3. Wikipedia entry about low-dropout voltage regulator.
4. Linear voltage regulator
5. LM2941 datasheet.
6. LM1117 datasheet.
7. What is ESR.
8. Solid Capacitor.
9. Learn about Arduino.

You can read my other posts here!
Happy Experimenting!

Wednesday, December 3, 2014

5V-3A LM2576 SMPS

Good afternoon everyone, been a long time since I wrote something so here I am with very handy circuit diagram, a 5V 3.0A SMPS(Switched-Mode Power Supply) that requires only a few external components.

I have previously posted linear voltage regulators which are very simple in design and working but has a very big down side which is low efficiency. Switched-mode power supply can be complex but it's efficiency is much higher than linear regulator, even if the difference between input and output voltage is very high. If you recall my previous post you should know that the larger the difference is between Input and Output voltage for Linear regulator, more power it will waste. So, a simple switched-mode power supply can be very helpful mitigating that loss, production of heat and can be used in a versatile situation.

Scope of using:

This diagram can be used in many different scenarios, let me jot down a few of them.

1. If you want to run a Raspberry Pi/Banana Pi or similar products with a lot of external components like sensors and relay boards an efficient and high current supply will be very useful.

2. Want to make a portable charger that will charge your tablet or phone from battery? This will be perfect for its compact design, efficiency and cost effectiveness.

3. Your desktop computer is not putting enough current on the USB ports? You can make one of this and hook it up with the 12V rail of the computer power supply unit to get high current for charging* tablets fast or run any other external device.*****

And many more similar situations.

Components needed:

As mentioned above this diagram requires only a few external components it so the list will not be that long.

1. Integrated circuit - LM2576 5.0.
2. Capacitor - One 100uF 50V, One 1000uF 16V(Low ESR capacitor will be better) **.
3. Inductor - 100uH.
4. Diode - 1N5822 ( No, 1N4007 will not work) ***.

The LM2576 5.0

At the very heart of the diagram there is this integrated circuit LM2576 5.0. It provides all the active function for step down(Buck Conversion) switching regulation. This integrated circuit is enough for driving load up-to 3.0A and it has excellent line and load regulation.

As I was saying earlier, it requires only a few external components and it is very efficient, about 77% efficiency with an input voltage of 12V.

It also has protections like thermal shutdown and current limit protection. So in a very small package this integrated circuit is just perfect.

LM2576 Pin Out
Datasheet of LM2576.

The diagram :

Time for the diagram!

As you can see it requires only a few components it should be very easy to make. Moreover I will post about how switched-mode power supply works so not going to talk about it right now.

Final Result:

After assembling the circuit and testing the connections with continuity tester to make sure everything is in order I powered it up and all the measurements were fine. From an input of 19V it successfully put an output of 4.9V-5.0V. I had connected a DC Ammeter momentarily**** and the first reading that I had seen was about 5.5A, which is pretty high. the continuous current rating was about 3.0A which is sufficient for most works.


More Information and Caution:

       * While charging Lithium Ion bear in mind that charging this type of battery can be dangerous. High amount of charging current or voltage over the specification can lead to fire hazard. So limit the charging current to half of it's capacity. That means for a 2000mAh Lithium Ion use up-to 1000mA of charging current. Also you need to be careful while playing with the computer power supply unit, you might get shock. Learn more about computer power supply unit. Charging via USB is also a bit tricky though. Different device often negotiate with the charger to tell each other they are capable of fast charging, if this handshake doesn't occur devices won't pull much power from the USB port. To get about 1A you can simply short out the Data Lines of the USB also make sure not to connect that USB to any internal USB header of the motherboard.

     ** For the input section capacitor, the 100uF one, you can use a lower voltage one if your input voltage is low and for the output one it is better to use a low ESR capacitor, as it is a switched-mode power supply unit. Learn more about ESR.

    *** 1N5822 is a Schottky barrier diode, these type of diodes has low voltage drop and suitable for high speed operation. Learn more about Schottky diode and here is a datasheet of 1N5822. You can also use MBR350 if you want to.

 **** Don't use the ammeter directly with a power supply source, as it actually shorts out the output leads of the power supply and might be hazardous.

*****You can just bypass the motherboard to connect the USB directly with the computer power supply unit but that current will be really detrimental, If you short it out it will actually short the entire 5V rail of the power supply so it will not be that safe.


Anyway so that was all for now. Happy experimenting! If you want you can read my other posts here.

Friday, October 17, 2014

Temperature Sensor For Development Board

Welcome back and good day everyone.

This will be a small post about a temperature sensor that can be used with development boards like Arduino, Raspberry Pi or similar products. This circuit is a very simple and easy to make circuit. This circuit is based on a precision integrated circuit that has an output voltage linearly proportional to temperature. So higher the voltage is higher the temperature is. We can simply read the output voltage and convert it to centigrade temperature scale.


+2 Degree To +150 Degree Centigrade

-55 Degree To +150 Degree Centigrade

How It Works?

LM35 looks like a small TO-92 package transistor but it actually is an integrated circuit. This integrated circuit is from Texas Instrument. This IC can be operated from 4V to 30V, that means you can't run it on 3.3V but 5V will be fine for it.

If you check the datasheet of the IC you will see that it's output is Linear + 10mV/Degree Centigrade that means 10mV represents 1 degree Centigrade. So 0.25V will represent 25 Degree Centigrade. Although this IC can read from -55Degree to +150 degree, you will need slightly different diagram for that and also you will need dual polarity power supply for that. For the value of resistance use the theorem to calculate the value.

From the circuit diagram it can be seen that it is powered from a 5V source, a capacitor is used to slightly stabilize the output. You can use a lower valued one or higher valued one if you want(even a 100uF electrolytic will be fine). This circuit can easily be built on a small PCB. 

How to Interpret

While converting A to D ( Analog to Digital ) all you need to do is to use the fact that 10mV stands for 1 degree centigrade, Measuring the voltage you will get the actual temperature. 

More Information

1. LM35 Datasheet.
2. Dual Polarity Power Supply.
3. My other posts

Happy Experimenting.

Monday, October 13, 2014

Single/Multi Channel Relay Board

Good Morning. You may have heard or even used something like a Relay Board and often these boards can cost good amount of money but they are very simple to make so here is a few diagrams for making one. Board diagrams shown here can be used with Arduino or any similar development board.
Typical Relay Board

You can make many different types of Relay boards for ease of explanation I will be separating them based on how many channels they have and the power source they use.

For channels, it is quite simple, each relay will act as a switch so more switch you need more relays to be added and we can simply call each switch a Channel.

These relays can be powered both by the Development board itself or from an external power. If you don't have many external components on your development board and just want to run a single relay, you are fine with using power from the board but if you plan on using good amount of Relays or if they run on 12V you are better off powering the relays from an external 12V source.


These boards are essential if you want to control any external device running on different voltage or maybe controlling something that is on the main line. Say for example you want to make a Remote controlled ceiling light, for that you can easily use a single channel relay board with your development board of choice.

1. Circuit/Vero Board.
2. Diode,
3. Transistor,
4. Relay,
5. Resistor,
6. Connector


7. LED as status indicator. 



Single Channel 5V Relay Board

Single Channel 12V Relay Board

Dual Channel Relay Board
How It works:

Electromagnetic relays are switches that opens or closes with the help of an electromagnet, relays that are used here(the garden variety 5 pin one) usually connects the Common(C) pin to Normally Connected(NC) pin. When the electromagnet is energized with proper voltage the Common(C) pin then disconnects from Normally Connected(NC) and gets connected with Normally Open(NO) pin.
I have written about Relays in much more details so not gonna repeat much, link of that post should be in the Information section below.

Transistors are there to drive those relays as often Signal pins of development boards do not provide enough power.

A LED can be used as an Indicator.


1. While using an external 12V power source for relay, make sure it is regulated unless Relays might make noise/hum.
2. If your Signal pin needs to be pulled down, add that pull down resistor.
3. You can simply add more channels to any of the diagrams and have more relay channels.
4. To use an external source make sure to tie down both ground pins together.

1. Learn about relay here.

2. Read my other posts here.

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.

Tuesday, August 26, 2014

Another Amplifier Using TDA2040

Good morning everyone, hope you guys are doing great! Now I'm going to write about an amplifier, previously I have written about the TDA2030 and this post will be about using a TDA2040.

Let's talk about a few cool features about this IC.

1. Very wide voltage range of up to 40V, which so it can be used in many different designs.

2. It can run from both single and dual power supply.

3. Can be used in both normal and bridge mode.

4. Very low total harmonic distortion.

5. Thermal Shutdown at 150 degree Celsius.

6. Short circuit protection.

All these features makes it ideal for making amplifiers using TDA 2040.

So, lets take a look at the diagram.

First one is for single power supply.

Second one is for using it with dual power supply.

Nothing much to be said about the diagram. 

The IC TDA2040 has only 5 pins. the #5 pin is for connecting positive power supply and the #3 for connecting it to negative or ground.

#1 and #2 are Non-inverting and inverting inputs respectively. And the #4 is the output.

The Input and output capacitors are for decoupling purpose. Which blocks the DC and allows the AC to flow. 

The 220uF/470uF capacitors are for smoothing and 0.1uF capacitors are used for suppressing high frequency noises from power supply unit. 

The 22kohm resistor, 22uF capacitor and 680ohm resistor are used for creating a feedback path.

 So that's pretty much it. 4ohm speaker will give higher output with higher Total harmonic distortion so it's better to use an 8ohm speaker.

 You can easily make a bridged amplifier to get even more power. 

Use a good quality power supply with this.

Happy Experimenting.

TDA2040 datasheet.

Amplifier using TDA2030.

My other posts.

Transformerless Power Supply Unit

Good afternoon everyone, hope you guys are doing great. Right now I am going to write about something which can be very simple to make but very useful and it is a transformer-less power supply circuit diagram.


We all have used power supply unit that uses transformer to step down High voltage AC to a Low voltage AC which then be rectified to be used with our devices. That diagram is pretty good for using, with almost any application, but The major problem with that diagram is the fact that transformers are bulky, even if we want a very small amount of current you will be needing a large transformer for doing that. Just omitting the transformer will give us a smaller,lighter and compact power supply unit but how can you do that? Let's dive deeper.

In this post I will be posting mainly two different diagrams in four images.Starting out with the first diagram of-course.

Basic Idea:

So, Basic idea for this diagram is to use a high voltage capacitor's Capacitive Reactance to lower the voltage. You can think of this Reactance as resistance so there will be a voltage drop across the capacitor and we will be able to use the rest. The reason for not using a resistor is the because it will burns a lot of power comparing to capacitor as capacitors current and voltage do not stay in phase.


How it works:

Simple and straightforward circuit diagram. In this diagram The 1uF 400V capacitor is the main capacitor that will drop most of the voltage across it. 1Megaohm resistor is the bleeding resistor. We know capacitor can hold charge, and as this is a high voltage application the voltage stored by the capacitor will be sufficient to give a powerful electric shock. So the resistor will bleed the power stored in it when the AC supply is off.

Next the bridge rectification is done by 4 general purpose rectifier diodes. Hope you know how to do it. If not then follow this link.

next the 100Ohm resistor will drop some more voltage and you have to use a high watt capacitor to make sure it won't get burnt.

The 10uF 50V capacitor will smooth the output somewhat. As the output contains huge amount of ripple, it needs to be smoothed.

The Zener Diode will regulate the voltage to a certain level. See how it is done, click here.

This diagram can be used for providing about 100mA of current. If you need more than that use a 2.2uF capacitor and a high watt Zener diode.

Now lets modify this diagram slightly.

This diagram is also same as the previous one. Just added a couple of extra items.

Like the 0.1uF capacitor which will filter out AC noises partially. And a larger smoothing capacitor will give better voltage with lower ripple.

Next a 14V Zener is used also a general purpose diode is used. Both the elements will drop certain amount of voltage, after that we will get around 12V.

And as we have used capacitor rated at around 3uF in the input section, we will get slightly higher current.

Next I will show another diagram which is slightly different from this one but can perform the same.

This diagram uses a transistor as its active component. Lets take a look at the diagram.

This is also a very straightforward diagram. The main line AC is fed into the circuit the first diode rectifies the voltage and make it DC.

The 4.7uF capacitor smooths out the voltage somewhat. Remember if you use bridge rectifier you will need a higher rated capacitor, like 400V or above.

100Kohm resistor drops the current to a very lower level to be regulated and used on the Base of the transistor. 10uF capacitor smooths it slightly.

Then we get the output voltage which has moderate amount of current for running small stuffs like couple of LEDs, ICs or even charge batteries.

If we want a variable power supply we can just modify it like this.

This diagram is pretty much the same as the earlier diagram. Just like the earlier diagrams, a couple of things are added. Like a 0.1uF capacitor which will lower the high voltage noises, somewhat.

Next the variable resistor let's you choose the voltage from 0V to 24V. The Zener regulates the voltage to 24V as a 24V is used. The rest of the part is same as the earlier diagram.

The reason for using a MJE13005 transistor is its very high collector emitter voltage.

What if we want a dual polarity power supply?

Then this simple diagram can be used. Here we can change the value of Zener diode and the resistor to get different voltages. Lowering the value of resistor will allow us to get more voltage and with more voltage we have to use larger capacitors too. This circuit will provide around 30mA or so.


First advantage of this type of power supply diagram is the size of it, its very small so can be implemented anywhere.

This circuits can provide a maximum amount of 300mA which is enough for powering small integrated circuits, light emitting diodes or even charge batteries. You can build one of it right into the wall socket and get desired output from it.

Another advantage of this diagram is, its cheap.

Does not produce much heat.


It can't provide high amount of current.

Shock Hazard! As this circuit is not isolated from the main AC line it will surely give you lethal shock. Don't make this circuit if you don't know clearly about these things. Even if the output is siting at 12V or something if you touch it you will get hurt. So, don't touch the running circuit. And make sure the whole circuit is housed in a insulated case or box.

It won't give your device protection against surges.

So, experiment safely. That's all.

Transistor MJE13005 datasheet here.

My other posts here.

Monday, July 28, 2014

Guitar Fuzz Effect

Welcome back! Anyone who plays guitar for a long time knows this fuzz effect. It's kind of a vintage effect but it still is cool. This fuzz effect module can be bought but making one is easy and fun. In this post I'm not going to post a diagram for making this. Hope you will enjoy it.



1. LM741 is a very basic OP-AMP. You replace it with a better one for better performance.

2. The Input and Output 0.47µF capacitors can be replaced with lower valued capacitors for more Treble response.

3. For more Bass response a small valued capacitor can be added in parallel with the 1MΩ resistor.

4. 1MΩ resistor can be replaced with a variable resistor, which will give you the option to control the amount of Fuzz.

5. If the output volume level is too low, you can use a small amplifier to boost it up!

6. This circuit runs on a very small amount of current so standard PP3 9V battery or Six AA cells should be fine for powering it up.

7. It is a very small circuit so it can be built directly into the guitar.

8. An on/off switch can be added alongside a bypass switch which will bypass the audio to the female jack directly from the pick up.

There is just lot to tinker with this circuit so make one and see what you can do with it.
Good luck!

Visit My Full Blog.

AC Live Line Detector

Good Morning everyone! Hope everyone is doing great! Now I'm going to post a very small diagram that can be used as an AC main line detector even if it is buried under plaster. 

So what do we need?

1. CD 4017  Decade Counter with 10 decoded outputs.
2. 0.1uF non-polar polyester type capacitor. (can be replaced with a 47uF electrolytic)
3. Red LED.
4. Single Pole Single Throw(SPST) Press Button.
5. Probe made of 5-20cm long, stiff insulated piece of wire. Can be used 15Amp cables for this.

Now the diagram!

Live Wire detector

How it works?

To understand how this circuit is going to work we have understand the purpose and action of the IC CD 4017. In simple word #14 pin is the input clock pin for this IC, when it gets a clock it starts counting which means it will give output to its 10 decoded output pins one by one. So a 100Hz clock will result in each output pins giving a 10Hz output. 

#3 is one of its output pins, you can use any other output pin.

#16 Pin is for supplying positive voltage and #8 is for negative or ground reference.

#15 pin is the RESET pin, we are keeping it low so that the counter keeps on counting.

#13 is for clock inhibit, we want to advance the count one step at the positive clock signal transition. For that we have to keep this pin at low. So we hook it up to the ground reference point.

If the probe is brought closer to a live wire, capacitive coupling between the live wire and the probe clocks the counter. and causes the LED to flash, and as I said earlier the any of the output pins will get only 1/10th portion of it(as it has 10 output pins so yes that's logical) so the LED will flash 5 times in the 50Hz 220V line and 6 times in the 60Hz 110V line.

Keeping it away from the Live wire will eventually lower or breaks the capacitive coupling and thus the counter will stop and the LED will turn off.

Making The Probe!

5-20cm long and stiff insulated piece of wire can be used. Usually those used in high current applications such as powering up an air-conditioner. Sensitivity of this circuit can be varied with the length of this probe.

Powering up the circuit

This circuit can run from 3V only, two AA sized battery can do this. And because of using 3V supply no need to use current limiting resistor with the LED.

It can work with up to 18V supply but going over 3.5/4V will require a current limiting resistor with the LED.

Hope it will help! Happy Experimenting.

CD 4017 Datasheet for more information.

Read my other posts here!

Wednesday, July 2, 2014

Auto Power Off Circuit To Protect Home Appliance

In this post I will be showing you how to make a simple circuit for protecting your appliances from sudden power loss and restoration. What often times happen is when the power returns the voltage level can be a bit too high. What this circuit will do is once the power is gone it will keep the load off until you manually switch it on. You can modify this circuit in many different ways.

What we will need?


1 12-15V or anything suitable for chosen relay.


5 1N4007


2 100μF 25V
1 0.1μF 100V


1 7812


1 12V SPDT relay.


1 Momentary switch.

Circuit Diagram


When the 220V AC IN is hooked up to power source, the load won't turn on because one of the wires is connected to the Normally open terminal of the relay. If we hit the "Press Button" once it will provide power to the load and high side of the transformer momentarily. But in the mean time the relay will turn on as the power was available for the transformer to drive it. If the press button is released afterwards the load will continue to run.

But if the main 220V AC IN is lost the relay will automatically go to normally closed and thus if the power is back again the load won't turn on unless the press button is pressed again.

Note and Warning: 

1. As this circuit has 220VAC connection with it make sure to be careful.
2. Before connecting this circuit to AC main power check the circuit thoroughly for shorted connection or wrong connection.
3. Before changing anything remove AC main power.
4. Make sure to use a relay that can handle the load you want to turn on.
5. All capacitors should be rated higher than source voltage. If you use 5V Relay and power supply 16V Capacitors will be fine.
6. Regulator 7812 shouldn't be that hot. In case its hot, attach a heat-sink to the regulator with some thermal paste.
7. If you don't want to make a full circuit you can simply use a 5/9/12V ready made power supply with the relay. Make sure to put the diode that is with the relay. Make sure to use current input voltage for the relay as well.
8. Press button should be such that it will withstand the load current.
9. Use Neon or LED indicators if you want.

Visit My Full Blog.

Saturday, May 31, 2014


Hello everyone! Welcome back again! This post is going to be about NAND gate.

So what is a NAND Gate?

In digital electronics, a NAND gate (Which can also be called Negated AND or NOT AND) is a logic gate which produces an output that is false only if all its inputs are true; thus its output is complement to that of the AND gate. You can simply think of a NAND gate like this, add a NOT gate in front of an AND Gate.

Now we had three basic logic gates which are the AND, OR and NOT, why do we need NAND?
Because we can implement any logic gates or any Boolean logic using NAND Gate.

Why NAND Gate?

NAND gate is called one the universal gates, its because we can make any Basic Gate using NAND gate(which I will show you shortly). So what is the advantage here? Clearly one of the advantages is that we can use one single logic gate to implement everything, rather than using many different types of gate, using one gate is easier. Another advantage can be reduction in size, we can reduce AND + NOT to just a NAND, lower number of gate will result in lower power dissipation and heat. 


Its symbol is pretty much the same as that of a AND gate, only a not bubble in-front of it.

Symbol of NAND Gate

Truth Table:

So lets take a look at the NAND Truth table. Like I said earlier its just the complement of the AND gate so guess you can already figure it out by now.

NAND Gate Truth Table

From the truth table using using Boolean Expression it is evident that we can treat NAND gate as an inverted input OR gate or we can just use an AND gate with a NOT in front of it.

So you can see that how a NAND Gate can easily be constructed using an AND gate followed by a NOT gate. From Boolean expression it can be seen that if we invert the inputs and add those inverted inputs using an OR gate we will get a NAND gate, that is also shown.

Constructing Basic Gates Using NAND Gate :


NOT Gate Using NAND Gate
If we hook up both the inputs of a NAND gate give an input there we will get an output which is similar to a not gate. The Bar sign represents NOT operation.


Like I was saying earlier we can just hook up the NAND output to a NOT gate to gate an AND Gate. The output of a NAND gate is already invert of that of an AND gate, if we invert it again we will get the output of an AND gate. Simple thing if we invert something twice it stays the same. And for NOT gate we will use another NAND gate which is described above.


Now things have become a bit interesting! Like I have said earlier, from Boolean expression we can see that the output of an NAND gate is similar to that of an OR only the inputs need to be inverted. We have done exactly the same thing here. Two NAND gates with the inputs A and B acts as NOT gate, then it is fed into another NAND gate and from Boolean Expression we can see that it will act like a OR Gate.

XOR Gate:

XOR Gate Using NAND Gate
XOR gate is actually exclusive OR gate which compares the two inputs. If both the inputs are same it will result in a LOW or 0 and if both the inputs are different it will result in HIGH or 1. It can be easily understood from the Truth Table. This gate is used for comparing values. We can easily construct this GATE using NAND gate. 

NAND Gate Using Transistor:

NAND Gate Using Transistor
So how to construct NAND gate? This gate can easily be constructed. With only two NPN transistor we can construct a NAND gate. Now let me walk you through 4 possible input combination and their output.

First of all A and B both 0. So none of the Transistors will conduct, thus we will get a certain amount of voltage on the output. So when both inputs are 0 the output will be 1.

Second, if any of the outputs are 1. If any of the outputs are 1, that transistor will conduct and the other will not conduct and as they are connected in series, no current will actually flow through them. As a result we will stil get a voltage on the output. So for any of the inputs being 1 and other being 0 we will get 1.

Finally if both the inputs are 1. If both the inputs are 1, both the transistor will conduct and thus their Emitter to collector resistance will fall to almost 0( In practical, it won't be zero). So, the output point can be treated as the Ground or 0V. So for Input 1 on both input terminal it will result in 0.

[Here 1 means presence of some amount of voltage]


We can use NAND IC for this purpose too. They are readily available. All these ICs are of 14 pin, and can be found in both CMOS(Complementary metal–oxide–semiconductor) and TTL(Transistor Transistor Logic)

For CMOS we can use

  • 4011: Quad 2-input NAND gate
  • 4023: Triple 3-input NAND gate
  • 4012: Dual 4-input NAND gate
  • 4068: Mono 8-input NAND gate

Internal Configuration of a CMOS CD4011
 For TTL we can use

  • 7400: Quad 2-input NAND gate
  • 7410: Triple 3-input NAND gate
  • 7420: Dual 4-input NAND gate
  • 7430: Mono 8-input NAND gate
Internal Configuration of a 7400IC
Benefit of using a CMOS is lower power consumption and better accuracy but CMOS is more prone to getting damaged.

IC 7400 Which is a Quad 2 Input NAND
Anyway that's pretty much everything about NAND Gate. Hope you will find it interesting and helpful. 

Take a look at my other posts here if you want

And have a nice day!