Thursday, November 21, 2013

Nvidia Shadowplay

Welcome everyone! Although this post is mainly for gamers but you can still read this if you want.

Right now I am going to write about Nvidia's ShadowPlay. 

What is ShadowPlay?

ShadowPlay is a screen capturing tool just like Fraps or  similar software, the difference is Fraps is not free but ShadowPlay is free. If you have 600/700 Series nvidia card you can use ShadowPlay, record your winning/loosing and upload it to anywhere!

The main advantage of this tool is it is hardware accelerated, unlike the software based solution which had a noticeable impact on the system's performance, ShadowPlay doesn't have that much impact. It uses the 600/700 series card's video engine(which usually sits idle during gaming).

So let's see what you will need to run ShadowPlay.

A system with (Minimum requirements of ShadowPlay )

1. Intel Core i3 2nd generation or AMD Quadcore Athlon II Processor
2. Nvidia 600 Series card or Higher
3. 4GB of System Memory
4. GeForce 331.43 or higher driver.

No AMD card? Yes, no AMD card. As ShadowPlay stays as a part of the GeForce Experience you can't use it on an AMD card.

How to get this?

You will need driver for running games on your system. And it will come with the driver. Just download GeForce driver 331.43 or higher(Currently I'm using 331.81) and make sure you Install the GeForce Experience. And you are good to go.

How to configure?

Just launch your GeForce Experience you will see something like this.



On the top right corner you can see ShadowPlay. Left clicking that will pop up the ShadowPlay options.



After Clicking ShadowPlay, you will see this. Here you have to turn on the ShadowPlay first. Hope you can see the mini button on the left side of the small ShadowPlay window. After enabling it you will see this.



Here you can change a few settings. Not much really.

1. You can use any one of the modes, Shadow mode or manual. In the shadow mode this will automatically record your game but saving is up-to you, during playing if you think that damn I just did something that is horribly awesome! Just press the button it will save the last 20 minutes(Max) of the game. In the manual mode, as you can guess, you have to manually start the record and pause the record.

2. You can change how much time it will save if you press the record button during shadow mode. You have to change the mode to shadow mode to change this option.

3. You can switch between High Medium & Low quality.

4. You can change the audio input, either from the game or mute.

Preference button will allow you to change the directory where the videos will be saved(As shown in the picture) and also allow you to change the recording indicator's position. 

How to Use :

For manual record Alt + F9
For Shadow record Alt + F10

Indicator



Simple!

Advantages 

Free. As it comes with the driver itself, it is free no need to buy a screen recording software.

As it uses dedicated hardware on the card, it doesn't have that much performance impact on the system. While recording you won't even loose frames that much.

It records at 1080p which is pretty good quality.

Disadvantages 

Can't change the options that much. Control over resolution and frames per second would be real handy.

Don't have any good option for getting audio input from microphone. 

Limited time limit (3.8GB/about 10 min).

Testing 

Playing Black OPS II on a GTX 670 and recording it using ShadowPlay 


From the GPU load you can easily understand the time when the game was on. And during ShadowPlay recording the video engine load gets higher (usually it was sitting idle).

How it looks?
Check out a few videos to find out the quality. No compression software was used. Though youtube might have compressed the video a bit more.



 
Shitty Sniping performance right?


ok!

Damn You tank you always get stuck!


Hope you will like it. Have a nice day and keep recording keep uploading.

Friday, November 15, 2013

Dual Power Supply Setup For Desktop

Good morning everyone. Hope you guys are doing well. So this post is about how to use two different power supplies on a same system if you can't get a higher capacity one or have multiple lower capacity one just laying around.


Allow me to remind you some of the basics.

You probably know this already but I will just remind you one more time. Desktop computers that we use needs power and it needs stable DC voltage of 3.3V , 5V and 12V. The outlet that we have in our home provides either 110V or 220V AC depending on where you live. For us it is 220V. So the power supply has to convert the incoming 220V AC to suitable low voltage DC levels but each power supply has it's limit which you will see on the label of every power supply. Usually when we buy a system we buy a proper power supply to go along with it. Often times due to limitation of budget we go for power supplies that has little or no headroom for future upgrade, in that case what happens is if you try to connect any more device to it say a Graphics card you will run in power shortage issue because your power supply was capable before but with added hardware it no longer is. So best practice in this case is to get a newer and more capable power supply but what if you have say another power supply in hand and want to use two of them together? This post might help you with that.


You can get "dual power supply kits" or similar product online but those are kind of costly and often times not that good. Moreover if we can make our own why shouldn't we?

Possible scenario where this can be used:

Say you have two power supplies and each of them can provide 450W, but your requirement is around 550W. So none of those supplies alone is going to cut it. In that case two of them together can help. 

Dig a bit deeper:

If we want to use two power supplies on a single computer we have to understand a small thing about how they work. Thing is desktop computer's power supply is not like a mobile phone or laptop charger, yes they do pretty much the same thing and often has similar circuits but one major difference is desktop power supply won't provide power if you just plug in an AC power source to it. You have to turn it on so that it powers all the rails. So what we can do is use one power supply as the Primary which will be turned on by the user by pressing the power button of the computer which will eventually turn on the secondary one or allow power flow from secondary one to the system.


Let's do it then: 

Like I was saying the computer power supplies won't provide power on the major rails unless it is told to. So what happens is whenever you put AC voltage in your power supply it will only provide 5V and a small amount of current on it's standby rail which is the Green wire of the 24 Pin connector of your power supply. No other rail will provide any power at this stage. But if you short it out with any other Ground wire that is a signal the power supply to power up other rails, so what the power supply will do is simply put power to all other rails like the 3.3V, 5V and 12V. As long as you remove the short however it will enter the standby state pulling down all the rails to zero and pulling up the standby rail to 5V. So we can use two methods to use two power supplies in a system let's talk about those.









Method 1: 

In this method we will be using a simple electromagnetic relay that will be turned on by the Primary power supply which will short out the Green wire of the secondary power supply to any ground pin causing the secondary one to start providing power too. Problem with that is a small amount of delay because the relay will take a small amount of time to turn on and the secondary power supply has to turn on after relay being turned on which might take a small amount of time too. Although the total delay will be very small as both relay and power supply can turn on pretty fast.

Method 2:

So the other method that can be used where the secondary power supply is already on. To do so what we are going to do is short out the secondary power supply Green wire to any ground and the relay that is being turned on by the primary will be used to connect the main 12V rail of the secondary power supply to the system. Although in this method we can get rid of the delay caused by the secondary power supply as it takes time to turn on, the relay has to conduct a high amount of current and even if there is small resistance in the relay, the voltage drop across it might be something considerable. It will also keep the secondary power supply on as soon as the AC voltage is available which might waste more power compared to the first method. This method also requires larger number of cutting and joining wires.

If you want to make it however, I would ask you to go for the first method. 

Let's start with first method in details with diagram.



Like we discussed earlier in method 1 we will simply turn on the secondary power supply using the primary one. So what's gonna happen is this, when the primary power supply turns on it will provide power to it's 12V rail which will cause the relay to short out the Green wire of secondary power supply to the ground. Thus the secondary power supply will turn on and provide power to the load.

Let's move on to the secondary one. 



In here however as soon as you put the AC voltage in the secondary power supply will turn on. What the relay is going to do is simply power up the load as soon as it gets power to turn on from the primary power supply unit.

Connection:

For both methods you can simply use a Molex Cable to power up the relay from the primary power supply. The diode that I'm using here can be a simple all purpose diode.




The best way to use two power supplies is I think one for almost everything and the other to power up a certain power hungry device. For example just use one for the whole system and maybe the secondary one to power up the 6 or 8 Pin PCI express power connector of the GPU. However keep in mind that if you want to use the second method you have to do a lot of cut and joint to make it work as you need to put the relay in the middle of the 12V rail and load.

Don't forget to tie up Black wires or the GND of both the power supplies.


Advantages : 

1. Cheap. If you Graphics Card burns a lot of energy which your existing power supply can't handle, you can add another cheap power supply to provide that power. It will save you a lot of money that might be needed for buying a new heavy power supply.

2. Easy to build. This circuit is pretty simple and doesn't have to many components.

Disadvantages :

1. Lot of hassle. 

2. Looks odd.

3. Take a lot of space.

Warning :

Before you do anything make sure you have clear idea of what you are doing. Computer is a very sensitive machine, use correct polarity, don't short any yellow or red wire to black wire. Before turning on the power supply double check connections.

Don't forget to use a diode with the relay as shown in the figure.


Before using any of the methods with an actual system, do a dry run.

Good Luck everyone.

Read my other posts here.

Wednesday, October 9, 2013

Digital Volume Control

Welcome everyone, hope you guys are doing great.In this short post I will be writing about how to use a digital potentiometer as a digital volume control. The model number of this integrated circuit is DS1669.

For this particular project we don't need too many components to work with. For input and output we can simply use two 3.5mm jacks. We will also need couple smoothing capacitors and to get stereo we will need a pair of the said integrated circuit.

Like I was saying it is a digital potentiometer. Like any other variable resistor it has a High Terminal, Low terminal and a wiper Terminal. Here we will use the higher and the wiper terminal. Changing the position of the wiper terminal will give us different resistance. Note that between higher and lower terminal there will always be a fixed resistance.

This additional circuit can be used with amplifiers where you want to get rid of Analog potentiometer to make the design look smart. 

Let's look at the pin configuration of the DS-1669.

Pin Configuration of DS1669, Photo Courtesy: Internet.



Diagram:



A very simple diagram. Couple notable points are:

1. Input and Output can be 3.5mm jacks.
2. Use momentary switch for SW1 and SW2.
3. A normal SPST(Single Pole Single Through) switch can be used as on/off switch in SW3 position.
4. Supply voltage can be anything between 5V-8V.

So, that's it pretty much it, hopefully it was helpful.


Resources:

DS1669's datasheet.
You can also check my other posts in here.

Wednesday, October 2, 2013

How to Use An ATX Power Supply For General Purpose

Good morning everyone. It's 7 am! I can hear the harsh tweeting of the infamous house sparrow and it is really hot in here too. Still hope it will be a good morning. Apparently it is not, I am kinda dizzy so I should get a cup of coffee or something.

Anyway as I am awake I think I can write something. So, allow me to write something about using computer power supply as general purpose power supply unit.

What is an ATX power supply?

ATX is a standard. It stands for Advanced Technology eXtended. It is a worldwide standard for motherboard, casing power supply etc. So, all ATX power supplies will comply this standard. They will have almost the same output voltages, same size and so on. There are other standards available for today's computers.

Simply it is the power supply used by many computers right now. We know computer needs power to run. Though it is supplied from AC main line of 110V/220V, internal components of computers run on lower voltages like 12V, 5V, 3.3V even 1V. Different components, different voltages. So this power supply has to take an input of AC 110V-220V and convert it to DC 3.3V,5V,12V etc.

So, if you have one of this power supplies you can easily use that one to utilize that DC voltages. For example, 5V is very common in development boards and other stuffs like it and 12V is very common for amplifier applications.

So where is the problem?

Yes I can use these power supplies for any other purpose, I will just plug in the power supply in the AC main line and start using it. 

No. That's not going to happen. First of all these power supplies are not linear like we talked earlier. ATX power supplies are mainly switching power supplies ( you can find more about switched-mode power supply here ). It uses higher frequency in the transformer thus lowering the size of the whole thing. And ATX power supplies use one of it's pins to determine whether it will stay on or off. 

If you look at a ATX power supply you will see bunch of wires coming out of it (guessing it's non modular). Wires might be color coded. If it's color coded then it is then it is very easy to understand. Yellow for +12V, Blue for -12V, Red for +5V, Orange for +3.3V and Black for Ground or 0V. 

You will also see 20/24 pin header, which actually goes into the motherboard and thus when you press the power button of your computer you can see the power supply turns on. 

The mechanism is there is a Green wire (Standby Power) in that 20/24 pin header which needs to be shorted to the Ground to tell the power supply to turn on. As soon as you press the power button this wire is grounded via the motherboard and the power supply turns on, so does the computer.


So, what to do?

 

So, just take a small piece of wire and short out the Green Wire and Black wire. If you can't find which is the green wire use a multimeter, if he power supply is in off state and AC supply is provided to it, one of the 20/24 pins should give a +5V reading, that is the green pin. 

You can also use a switch between Green and Black wire to turn on as your require and turn it off after that. 





 I am using this small breadboard jumpers for connecting it.








This is the ratings of the power supply that I'm using. Here you can see the voltages with there corresponding current is printed on it.


Measuring the 12V Rail (Yellow)

Measuring the 5V Rail (RED)



As you can see that after shorting out the green wire, the fan has started spinning and the voltage on the Rails are good.

Sometimes these power supplies might not run properly without any load, in that case just use such a resistor that can draw some current and act as a dummy load. 

 
A small resistor between 5V rail and ground acting as a dummy load


Why?

Why would anyone use one of these?

1. Cheap. This power supplies are relatively cheaper than linear power supplies


2. Small. Size of these power supplies are pretty small comparing to linear power supplies

3. Quality. Power quality of these supplies are good. It has good voltage regulation and lower ripple and noise.

4. Power. These power supplies can provide high amount of current for running most of your project stuffs. Like you want to build an audio amplifier with CD drive on it. These power supplies can save you from hassle of making one linear power supply with very large transformers.

5. Compact. As these power supply units offer different voltages it can be used for multiple purpose. Also you can use a boost converter to convert the 12V to higher voltage levels, there is ample current provided in this rail so you don't have to worry much.

6. Ease of use. This power supplies can easily be modified and used.

Warning

1. High Voltage Application. Make sure to ground the power supply unit properly. Don't run the power supply without the metal cover.

2. Don't exceed the current limit labeled on it.

3. Don't Short circuit any other terminals. 

4. Don't touch the power supply while it is on.


You can visit the index page for more posts. Hope You like it.
I'm using this power supply for demonstrating purpose only.

Thursday, September 26, 2013

UPS All You Need To Know

Good afternoon everyone. Sometimes I hear people ask about UPS, it's back-up time, ratings and more questions like this. So, I'm trying to write about these stuffs. This will be a bit basic stuff. If you are into tech stuffs you might know more than this. Still hope you will enjoy reading.

UPS What is this?

UPS stands for Uninterruptible Power Supply. Your personal computer or maybe laptop or other similar electrical equipment runs from AC outlet of your home. AC power that is provided by this outlet is not stable, it may vary by small amount with load and sometimes there might be power outage. That is load-shedding or something like that, maybe a cable fault. If you are in the middle of an important work and suddenly your computer just turns off, you will loose important data or think about medical equipments that needs to be on 24/7. So, you will need an UPS to get backup to save your important data or keep life saving equipments running in power outage situation. As soon as electricity fails UPS turns on and keep your system running thus giving you the opportunity to save the important data before turning off the computer.

It has batteries inside which charges from the AC main line and with in the event of a power outage these batteries supply that necessary power.



How Does It Work?



Let's start with offline UPS(Later I have explained both of them).

UPS takes in AC power from AC outlet and simultaneously 1. Provide AC power to the output, and 2. convert it(from main's AC) to DC to charge single or multiple Lead Acid Battery and when power fails an inverter turns on taking power from the battery and provide sine wave to the output. As soon as the battery is dead UPS stop providing backup. It charges from the AC mains again when AC power comes back.


Offline UPS




This is a very basic block diagram of how UPS works. Here Red lines indicates the AC line, Blue is the DC line, and the Green is the control. As you can see it takes in AC power straight to the Transfer Switches and to the battery charger. Transfer switches are actually relay based switches. Battery charger converts AC to suitable DC levels and charges the battery. Control always monitors battery level and if battery is fully charged it sends signal to battery charger to turn of charging. When AC is on control keeps the AC flowing to the output but as soon as AC fails control sends signal to turn on the Inverter and the Inverter takes in DC power and gives off AC power. Relay switches between direct main line connector and Inverter. Thus keeping the load turned on. The whole thing happens within very small amount of time that computer doesn't turn off.

In real world things might be a bit more complex but the main working principles stays the same. An offline UPS might use the same transformer as both inverter and step down transformer for charging the battery.

Rating, No watt?

You might have noticed that UPS comes with a volt-ampere rating rather than a watt rating(which you will find in your power supply). Well we are talking about AC voltage here, In DC we just multiply voltage and current and we will get watt, but In AC there is one more term to worry about and that is power factor. Not going to get in depth of it just remember in AC Voltage*Current*Power Factor = Watt. So, if you have a 1200VA UPS with 0.6 and 0.8 power factor what will be the maximum capacity?

1200VA * 0.6 = 720W
1200VA * 0.8 = 960W

So, UPS with a higher power factor is needed here.

If you buy a 650VA UPS with a power factor of 0.6 and your system's consumption is 450W when loaded, assume you are playing Battlefield 3 or Crysis 3 which is causing the system to draw 450W power, if AC fails your computer will just turn off. It won't even give backup for even fraction of seconds. Because 650VA * 0.6 = 390W which is the UPS's capability and you are drawing 450W.  So, get an UPS with higher power factor and calculate the amount of load you are planning to put on it.


So, I get a higher VA Rating and will get higher backup?

Well, Yes and No.

UPS VA rating stands for its maximum capability not for backup time. Though higher VA usually results in longer backup time but backup time and VA is not connected that much.

Like I said earlier UPS has battery inside(or maybe outside) of it. Usually these are Sealed Lead Acid Type battery or lead acid type battery. 





650VA 800VA 1000VA UPS have one of these battery, where 1200VA 1500VA have two of these battery. So, 650VA-1000VA converts 12V to 220V and 1200VA or 1500VA converts 24V to 220V. 

Now let's look at the battery, it is a 8.2Ah 12V battery. What it means? It means if you pull 8.2Amp from this battery at 12V this battery will last for 1hour. 8.2A from 12V is 8.2*12 = 98.4W. So, If you run a 98.4W 12V load with this battery it will last for an hour.

If you pull 16.4Amp or 196.8W from this battery it will last for 30 min. And if you pull 4.1Amp that is around 50W it will run for 2 hours!

Wow my computer burns only 100W, so I will get 1 hour backup! 


Wait! You have heard half of the story!

Remember the construction, DC voltage enters into the Inverter, where it is converted to AC via Power Transistors and then fed into a Transformer to step it up to a higher voltage level like 110V/220V. This conversion method is not efficient, a lot of heat generates thus a lot of energy wastes, moreover transformers have losses, different kind of losses, so there's another power loss there. And last but not the least your system's power supply is not 100% efficient either. Maybe 60%-90% efficient. So, your system's power supply will draw more power than its providing.

So, a lot of losses decreases the backup time! Yet try to get a UPS that has higher AMP-HOUR rated battery.


 
Now, why multiple battery?

Multiple battery are connected in series. Hope you know what will happen if you connect it in series. Two 12V battery result in 24V. Assume two 12V 8.2Ah battery. So, total 24V 8.2Ah battery(In series current stays the same) so, now you can run 196.8W load for an hour! 


So, you see more battery more backup. It is not necessary to be with a higher VA rating. Later I will tell a bit more about it.

Although you can't just put multiple battery anywhere, the circuit has to be capable of working at that voltage.

 
How fast?

UPS has a very fast switching speed. It can switch between AC main line and Inverter within millisecond so that Computer won't turn off. Each computer power supply has a Hold up time. This is the amount of time Computer's power supply can provide power(from the bulk capacitors) to keep the system running even if the AC power is out. You will need a UPS which has a speed faster than this Hold up time. Within the hold up time if power fails and inverter start providing backup computer won't feel anything. But if, lets say the computer or any other device has a hold up time of 15ms and the UPS needs 18ms to provide power, computer or that device will simply turn off. Luckily most consumers UPS can provide power within 5ms.


 
Types of UPS

There are two major types of UPS available in the market. 

Offline UPS
Online UPS


 
Offline UPS:

 

Diagram that I have shown on top of this post is actually of an Offline UPS. In this type Inverter only turns on when AC fails. So, rest of the time AC supply will go directly to load or maybe via Automatic Voltage Regulator or Surge Protection System. But if these protections are not available surge might damage the load. But most modern UPS has these protections so don't worry. Offline UPS is the cheaper one and less reliable one. Although it is more efficient than the online counterparts.

 
Online UPS

In online UPS Inverter always stays on. So, there is no break. This type of UPS takes in AC voltage, step it down with a transformer then converts it to DC and use that DC to both Charge the battery and to feed the inverter circuitry. As soon as AC fails battery starts providing the voltage required for inverter. So, this circuit produces more heat than offline UPS. But as output is totally isolated from the input AC, the output power quality is higher. Different types of protective measures can be taken here. This units cost a bit more than offline one.


You might sometimes see that this type of UPS is marked as double conversion UPS, the reason is it actually has two conversion units running simultaneously. One converts the AC to DC and the other converts the DC to AC and drives the load. As the inverter has to always stay on the heat generation is also high. Moreover inverters are not that efficient so the overall efficiency of online UPS drops to 80-90%. 

Online UPS may employ power factor correction circuitry and frequency regulation circuit which makes the efficiency and quality of power a bit better.



Schematic Of An Online UPS

As you can see online UPS has a totally isolated output. It is a bit more reliable than offline UPS. Because of the isolation it is easier to suppress the AC noise and protect the load from ripple, transient voltage or surge and brownouts. Better protective measures like low voltage or high voltage protection and surge protection can be implemented easily.


Why Back Up Time Decreases Overtime?

As you might have already faced backup time decreases overtime. And with frequent using backup time decreases even more. That's because of the characteristics of sealed lead acid batteries being used in this devices. 





From the graph shown above its clear that if you use 100% of its capacity everytime you will only get about 200 cycles. This number will change from battery to battery but the thing is higher the discharge depth is lower the number of usable cycle is. 

If you use a battery everyday to 100% and fully charge it back again, it will only last around 200 days, not even a year. Now you can do your calculation.

If capacity drops significantly you can replace existing batteries with similar type of battery.

You can read this manual for more info.


Maintenance

1. Don't use it in a very hot place. As you can see from the graph below that with higher temperature service life reduces drastically.







 



2. Don't leave it discharged for long time. As it will damage the battery even more. Charge it regularly.


 As you can see with time the battery self discharge and looses its capacity if not charged after reaching 60% of its capacity.

3. Don't overload it. 

4. Keep it in a dry place.

5. Visually inspect for any mechanical failure or check for any smell that indicates burning of something.

6. Regularly clean it, you can use a blower to do that.
 

UPS HACK:

Assume you have a 1000VA single 12V battery UPS which has a power factor of 0.8. And the battery is dead. You want to replace it. You can replace it with a higher capacity battery even with a car battery for that matters. Say you had a 12V 9AHr battery earlier. You can easily replace that with a 12AHr battery which will increase the back up time slightly.

Connect battery with the proper polarity. Positive with positive and negative with negative. You can use a multimeter to determine the polarity. And batteries will usually comes with polarity marked on them. Another thing you can look up is, usually the black wire is the ground wire.

What if a car battery is used? Like a 12V 100AHr battery? well it will give back up but the charging will be a bit tricky. Lead acids battery needs to be charged at 1/10th of its current capacity. So if a UPS has 9/10AHr battery the charging circuit is providing only 1Amp of current. But a 100AHr car battery requires 10Amp of current to charge, charging it at 1Amp will need days to charge it properly.

One way to solve this problem is using a different charging circuit for the batteries, connecting with a relay based switch. The way it will work is when the AC power is available the load will run from the AC and the battery will be charged from a different charging circuit, as soon as the AC is gone the relays will shift their switches in such a manner that battery terminals get to contact with the UPS actual battery terminal thus providing back up.

I'm adding a small schematic to clear this up a bit.


UPS Hack

Only two items are needed, one a simple relay that is connected with the Charging circuit, battery and the battery terminal of the UPS. Relay's common terminal is connected to the battery and the normally connected terminal is connected to the battery terminal and the normally open is connected to the high current charging circuit. Relay can be powered directly from the AC main line via a step down transformer, AC to DC converter and voltage regulator. 

When the AC is available the load is being fed from the AC main line via the Transfer Switches, and that AC is keeping the relay On and the charging circuit On. The way the relay is connected if the AC power is On, the Common terminal will touch the Normally open terminal thus charging the battery. As soon as the power fails, relay's common terminal touches the normally connected terminal thus providing power to the UPS circuit and the inverter. So the load will keep on running. As relays are very fast we don't need to worry much about the load's hold up time.

Some smart UPS might not be happy with no battery on its battery terminal but some of them just work fine.

When powering up the relay make sure to use proper transformer. You want to select such a transformer that will provide such a voltage that won't be able to drive the relay at AC input 190V or lower.  

Warning:
High voltage application, be cautious.

 

Some more info:

AC to DC conversion.
Voltage Regulating.
How Relays Work.

Read my other posts here.

Have a nice day.

Wednesday, September 25, 2013

Stethoscope/Spy Bug Using Op-Amp

Welcome again. This post is about a hobby project of how to make a Stethoscope or a Spy bug using Operational Amplifier as known as Op-Amp.

I will write about Op-Amp later. But now will just talk about the project and how to build this.

When I was young(10 years from now) I came across Op-Amp for the first , the TL062. I had plan to make a piano or something, and found this chip very suitable for the job. For audio we can use other Op-Amps too.

For basic, Op-amp is such an amplifier which has a very high sensitivity and gain. If it gets a small amount of input voltage it can amplify it very largely. Well the amplification depends on its supply voltage too. If the gain is high enough and mathematically the output voltage is crossing the operating voltage, it will saturate and its output voltage will be same as its operating voltage.

Let's look at an Op-Amp.

Internal Diagram And Pin Configuration of LM 741, LM324 and TL072


What it does is takes input voltage and spites out output voltage which is actually a product of its gain and input voltage. So, it can easily amplify any signal.


To hear heartbeat or hear what people is saying all you need is a microphone, and a headphone to hear what the microphone is hearing. But the problem is  Output of a microphone is so small that you can't hear anything if you directly connect it to a headphone or speaker. So, we need an amplifier. And Op-Amp is a very nice choice here.

Let's look at the diagram.



In this diagram, we will need only one set of input and output. Here we will take the input from the microphone which is around 0.02V and we will need around 2V to power up the headphone. So we will need an amplifier with a gain around 100. so 0.02V*100=2V. Here gain for this circuit is 1+220K/2.2K=101. So, it will do. We need resistors with around 1% tolerance, 5% tolerance will do.

This Op-Amp is running in non-inverting mode.

First 9V supply and 5K resistor is for powering up the microphone, the next 0.1uF capacitor and 100K resistor is for Removing DC voltage, it's actually a High pass filter, it will filter out DC level and a good AC signal will enter the Op-Amp. Op-Amp needs 9V 0V -9V supply.

This circuit can be used to hear heartbeat or small noises.

Any way that is all. Just try it. You can use any other Op-Amp instead of LM324. Anyway happy experimenting!

Dual Power Supply

Good evening everyone. Hope everyone is okay. This post is about dual power supply. 

Now if you are into hobby electronics projects and tech stuffs you may have come across the idea of dual power supply. You might have seen that Op-Amp requires Dual Power supply. In different power supply labels you may have seen powers like +12V, 0V, -12V or something like that. This post will help you to make one for yourself.

When I was a kid my brother got a remote controlled vehicle which can go back and forth. And as usual we opened it up and found an interesting motor feeding system. Though the vehicle was running from 4 AA size battery but only 3V was given to the motor, either from 2 of the battery or from the other 2. Thus achieving a different polarity causes it's direction to be different. It was about 11 years ago. Anyway don't want to bother you anymore with uninteresting history. Let's see the first figure.



This is how dual power supplies work. You can use any of these three points for getting different voltage level. 

From Battery

First, let's see how to make a dual power supply from battery. You can use any type of battery. For example you can use 4AA battery or 2 9V battery.



Very simple, right? Just connect both the battery in series. Now the center of the two cells will work as the Ground, and two other terminals will provide positive or negative supply. 

Very simple but effective. If you use two 9 volt battery you will get 9V 0V -9V power supply. With that you can power up small op amp IC or maybe small motor that will go in both direction.


Dual Power Supply From Battery

 


From CT Transformer

Okay now let's see how to make a dual or negative power from a center tapped transformer. 


Unregulated Dual power supply from CT Transformer


Regulated Dual Power Supply from CT Transformer




Voltage Testing


Voltage Testing

 
Diagram above is a diagram of Dual power supply capable of providing 15V-0V-15V. You can read my earlier posts to find out more about how this circuit is converting AC from DC, what is voltage regulation etc. Those posts may help you to understand this circuit better. Now for simplicity I will describe it in brief. First the transformer steps down the power to a lower level. Here it is 18V. And then the diode IN4007 converts it's to DC. Adjacent capacitors smoothen the power - Lowers the voltage ripple and noise. You have already got the dual power supply. But it's around 15V 0V -15V. And it's not regulated (1st diagram). To regulate it to 12V we will need one positive regulator and one negative regulator. 7812 is a positive regulator where 7912 is a negative regulator both 12V and 1A capable. At the Output side you will get +12V 0V -12V power(2nd diagram).



Actual picture doesn't have the regulator added to it, yet. If you add a regulator you will get a cleaner voltage, that means less noise and ripple. Open pictures to see them in high resolution. You will be able to see diode orientation and polarity from voltages from this. I needed three multimeter but I only have one working right now, two of my meters got busted. But still you can see that positive from one point and negative from another. If we use only positive and negative point, we would have seen around 44V here.

From ATX Power Supply

Now, I'm going to show one more way. Most of us have seen computer power supplies. Small but efficient and powerful. ATX power supplies provide both positive 12V and negative 12V.


A Corsair CX750 Unit, Colors refer to Wire color and respective voltage



 
Voltage of Blue Wire Respect With Ground/Black Wire
Voltage of Yellow Wire Respect With the Ground/Black Wire
This is how you can get dual power supply from your ATX power supply. Simple keep the power supply turned on. Click here to see how. Anyway as you can see form the ratings Blue Wire provides -12V, Yellow provides 12V and black provides 0V. As we can see from the same 0V respect we are getting 12V both positive and negative, we can obviously use it as dual power supply.


You can also check your own power supply to see the ratings. You will see the Yellow wire is for 12V, Black wire is for 0V and Blue wire is for -12V. You can use Yellow - Black - Blue configuration to get +12V 0V -12V supply. Though most power supplies -12V will provide only a small amount of current. But that should be okay for running most of the small ICs. If your power supplies cables are not color coded you can always use a multimeter to measure the voltages.

Anyways these are the three basic ways to get dual power supply. Hope it will help. Will update as soon as possible. 

You can visit the index for more interesting posts. 

Warning

1. If you use the CT transformer or ATX Power supply, Take proper caution from shock hazard.

2. Don't touch the circuit of a running ATX power supply.

Thursday, September 19, 2013

Computer Power Supply Buying Guide

Good Morning Everyone. Anyone interested in Computer Stuff knows about power supply. Still we often get confused about which power supply to buy for our system. So, I'm going to write a post about computer power supplies. 

What is a Power Supply?

We know desktop computers run from AC 110V/220V. But the internal components do not run on alternating current, neither run on such high voltage. Different computer component runs on different voltage level. For example, a 3.5inch hard drive requires both 5V and 12V DC supply. Now, How can I provide that voltage? Simple using an adapter. PC power supply is that adapter. It sits inside of your system and convert its input 110V/220V AC to different DC levels. Standard power supply has 3.3V, 5V, 12V, -12V, 5VStandby output leads. Sometimes they have color coding. 





This is a 850W power supply from corsair. You can see its large cooling fan and bundle of wires. Those wires power up different devices inside of a computer..

Though power supply does not directly improve your system's performance it still is a vital element of the computer. You will be needing a proper power supply for systems durability and reliability. If you don't have the right power supply unit, your system may turn off without notice, power supply might gets burnt. So, a right power supply is very important. 

Now few basics about the power supply.

Wattage


All the power supplies you will see, you will find a Wattage rating printed on it. In most cases this is the amount of total power it can provide. Some power supplies print their continuous power and some print peak power. Remember always go for the higher continuous power rated power supply unit. So, if a power supply has a continuous 500W supply and one with a 500W peak, obviously go for the 500W continuous. This rating is actually the combined output power of all the different voltages.



This is the rating of a Thermaltake Toughpower 1000W. Its printed on the side of the power supply unit. As you can see the 1000W is the combination of all the different voltages. 


Rails

When looking for power supplies you may have come across the word Rail, Single rail, dual rail, quad rail. It means the output leads. Like the 5V rail which provides 5V, 12V rail which provides 12V. But if it has Dual rail or Quad rail it means there are Dual and Quad 12V output port. In the above picture you can see there are multiple +12V. It means it has multi-rail.

For safety manufacturer divides the total 12V Output current in different 12V rail, each having a maximum amount of current limit. For example if a power supply has dual 12V rail each of them has 20A rating, that means this power supply can provide (20A+20A)*12V=480W in its 12V rail(Make sure to look for the combined total output power of 12V rails,some power supplies have low total output current, if a power supply has 20A rating on both of its 12V Rail but a 23A combined current rating,that means you can't pull more than 23A or 276W from its 12V rail). Anyway, right, 480W on its dual 12V rail, but what will happen if you hook up 300W on it, and somehow you hook up all the load on a single 12V rail. It won't run because it has a 20A current limit on its each 12V rail. That means each of the rails will provide 240W. If you want to use more than that you have to distribute the load on different rails. 

That's the reason I prefer single rail power supplies, it provides all the current on a single rail, so you don't have to worry about connecting the loads in right places. If you have a multi-rail power supply just don't hook up all the load on a single wire, use multiple wires to balance the load.


Most important Rail


+12V supply rail is the most important rail of a power supply unit. If you use a gaming system or heavy system look for the power supply with highest +12V current rating. If you plan on buying a lets say 550W power supply, you find two of them from different manufacturer one with 42A on its 12V rail, other has 44A on its 12V rail, buy the one with the 44A. Because all the heavy things on your computer depends on the 12V rail. Your computers motherboard will take in 12V supply via a 8pin or 4pin ATX connector and convert it to the appropriate voltage for Processor, RAM etc. If you use a mid to high end Graphics Card it will take in 12V via 6pin or 8pin PCI express power connector and convert it to proper voltage for GPU core and memory. Your optical drive or hard drive's motor spins using the 12V supply, cooling fans run on 12V supply. So, 12V is the most important thing, just buy a power supply which has a high +12V current.

Connectors 

Power supplies have different types of connectors for different device. 





In the picture above you can see the 20+4 pin main power connector, 4 pin and 8 pin processor power connector and 6pin PCI express power connector. If you look at the motherboard you will see there are two atleast two different points for plugging in the power supply unit cable. One of them is the 20/24 pin power connector, other is the 4/8pin CPU power connector. If you buy a motherboard that has 8pin CPU power connector make sure to get a Power Supply that has a 8 pin power connector. There are more connectors for Graphics card, Hard drive, Optical drive, Cooling fan etc. Graphics cards usually use 6pin/8pin power connectors, Make sure to buy a PSU with proper connectors for your system. Hard drives and Optical drives this days require SATA power connector(4/5pin) and cooling fans are often powered by Molex(4pin) connector.


MTBF
One of the important thing about power supply is the MTBF. It means Mean Time Between Failure. This is the approximate time that the Power Supply Will serve without any failure. Higher MTBF value means higher service hours. So, better taking a Power supply with high MTBF like 100000 Hours or more. Don't buy any power supply below 20 000 hours of MTBF. 


Remember power supply will only reach its MTBF if it runs at proper condition. You can't overload it, you can't run it in high temperature.

Efficiency 

Efficiency is also an important thing. Efficiency does not affect its output power but it affects its input power. Lets assume two power supplies with same power rating of 500W providing constant 200W to the load, one with a 60% efficiency and the other with a 85% efficiency. 

Then the one with 60% efficiency will  pull around 333W From AC input.
And the one with 85% efficiency will pull around 235W from AC input.

So,higher efficiency will surely cut your electric bill. For a greener world use power supply with high efficiency.

Cooling

Power Supply has transformer, DC to DC converter inside of it, which often get hot. To cool it down power supplies come with heatsink and fan inside of it. Some power supply has 8cm fan some has 12cm or even 14cm. Get a power supply which has a good cooling solution. The better the cooling fan is the better the heat dissipation will be. And it will result in longer power supply life.


Power Supplies with different sized fans.



Non-Modular/Semi-Modular/Fully Modular

You may have also heard these terms. It is the cable management feature. If you buy a normal non-modular power supply, All the cables will be attached with it, you can't remove them. So huge amount of cables will be lying inside of your system which can cause poor airflow inside of your case. Power supply cables blocks the airflow, more cables more blocking. Most of the time you won't be needing all the connectors but with the non-modular design you still will be needing to get them connected.

With the semi modular design only a few cables like the 4/8Pin power connector and 20/24pin connector is attached to it. It gives you the flexibility to use cables as you want. Use the cables that you need. Don't need to connect the other cables so, eventually it will be less jampack your system and will result in better airflow. This feature will also allow you to route cables as you want.

Fully modular has no cables connected (like the one in the above picture). You have to connect all the cables.


My choice is the semi-modular because we will need those cables no matter what. And each contact point may have electrical resistance, which  may lower the power. If you think about the resistance that might be present in connectors, Non modular will be best choice, but we need cable management for good airflow, so if we think about balancing it, Semi - Modular will be the best choice.


Support And Protection

If you plan on building a very high end system with multiple Graphics Card, you will need a certified power supply. The most common multi-GPU system is SLI or Crossfire make sure the power supply has these certificates. 

Good power supplies feature over current, over voltage, under voltage protections. These are very important feature. Accidental short circuit may blow up the power supply if it doesn't have over current protection feature. Moreover if accidentally load gets higher than its capability it will turn off automatically.


PFC

PFC stands for power factor correction. As this device will be running from AC, power factor is a very important thing here. In DC , watt is the product of voltage and current. But in AC watt is the product of voltage, current and power factor. So the better the power factor is better the power supply is. Modern good power supplies come with power factor correction mechanism. This mechanism automatically adjust the power factor to higher value. It results in lower power consumption. Efficiency and Power Factor is not the same, though they have almost the same effect.

So, that is all about power supply in brief.

Now lets take a look at which one to buy.

 1. Calculate your consumption. Find out how much power you will need. Get a power supply with atleast 20% higher wattage than your consumption. If you plan on overclocking buy even higher.

Remember your power supply will have the best efficiency when it will run on 50-60% load. So, if you have enough money you can buy such a power supply which has 200% rating of your consumption. It may require more money but eventually will pay off. More over lower load means lower temperature of the Power Supply Unit and lower noise from its cooling fan.

 2. My suggestion will be go for the single rail. 

 3. Study the power ratings carefully and buy the power supply with higher +12V current.

 4. Make sure the power supply has enough connectors for all your devices.

 5. Buy the one with Higher MTBF value.

 6. Buy the one with Higher Efficiency(must buy 80+) and better cooling option.

 7. My suggestion, semi-modular.

 8. Make sure to check for features like low voltage , over voltage and low current protection.

 9. Make sure it has Active PFC(Power Factor Correction)

10. Must have better warranty period.


11. Don't buy cheap or non-brand power supply. 


List of Good Power Supply Manufacturer


 1. Antec
 2. Silverstone
 3. Corsair
 4. Seasonic
 5. OCZ
 6. Rosewill
 7. Thermaltake
 8. Cooler Master
 9. Sapphire 
10. XFX

Hope it will help. That was all for now.

Tuesday, September 10, 2013

Newton-Raphson Method

Welcome everyone to my blog. Today I am going to write on Newton-Raphson method, which is in Numerical Analysis called the Newton's method widely in brief.

Newton-Raphson method is used widely in finding better approximation of roots of real-valued function. 

For doing this calculation we can take two easy ways, one with a graph that will help us through, or directly start calculating.

In the graphical method, all we need is to guess a point on the function f(x), draw its Tangent. Find out where it intersects x, again draw a new tangent using that intersecting point, we will get a new point on x. If it is closer to the function than the previous one, it is a better approximation. More iteration may result in even better approximation. Remember it may not work all the time.





Next one is the straight-forward calculating using calculator or something. In straight forward calculation, we need the formula. 




As you can see the formula is very simple.You have to make sure a few things though. 

1. f(x) must be equal to 0. That means it should be f(x)=0. If you have an equation like X^3 +2X=2, You have to change it to X^3+2X-2=0 this form.

2. Finding out f'(x) symbolically. According to the formula you have to find out the first derivative of the function that is given. You have to manually calculate this.

3. Choose an initial guess Xo, some people may call it X1 and the next one is X2 and so on, its totally up to you, you can write anything you want as long as you are writing the formula correctly.

4. Use formula to find out next value.

5. Now the next value will be the new guess, put it in the formula and get the next value.

6. You can keep on the iteration to find out better or closer results.

Absolute Relative Approximate Error 


Sometimes pre-specified tolerance is given, you have to use this approximate error to see how much error is in the calculation. To minimize error or get in the tolerance level more iterations might be needed.

Example 

1.

x^3 = 20, we have to find out a root of this function. 

First of all it needs to be converted to a form like this f(x)=0, so we can write x^3-20=0.

Now finding out the derivative. x^3 -20 will result in 3x^2.

Assume a guess of x=3.

Now putting that in theorem we get 

X1 = Xo -(f(Xo)/f'(Xo))

that is X1 = 3 - ((3^3-20)/(3*3^2))

X1 = 2.740740741

To find out X2, we will just replace the position of Xo with X1 and will get X2.

From there we can check what if the new result satisfies the condition or not. If not iteration will go on.

We can find approximate error if pre-specified error tolerance is given. We will just use the formula shown in earlier figure and will find out error. 

Using Calculator

If you want to speed up the calculation you can use a scientific calculator. Scientific calculators saves the last value as Ans. Just type the initial guess press = sign. Initial guess will be stored in Ans. Now use appropriate operators to establish the example 1. Now each time you press = it will show the next value, as Ans value changes with every click it will actually give you the results of onward iterations.


Any way that was all for now. Pretty basic stuff. Hope it will help.

Monday, September 9, 2013

MATLAB Basic Tutorial

Good morning everyone. Hope everyone is okay. Today I'm going to write about MATLAB, a very popular and handy application for doing a lot of works. It is a numerical computing environment.

So, lets dive in!

First of all how to get it. You can simply go to their site for downloading/buying it. Once you have done doing that, install it. And run it.

The interface will be like this.


In the picture you can see the MATLAB 2012b edition. It has File browser , Command window, Workspace, Command History from left to right. You will be writing codes in the command window area.

Let's start with the Basic Arithmetic Operators then.

Arithmetic Operators

1.   +   Addition

Simply add two or more digits by directly typing all the digits and pressing enter. Result can be directly stored in any variable 

12+23.5= 35.5000

d=1222+45, d=1267
[You can see the variable values in workspace]

2.   -   Subtraction

Simply subtract. Either it can be done directly by typing and hitting enter or can be stored in variable first and then apply operator.

23-5=18

b=23-5 , b=18 (stored in b variable)

3.   *   Multiplication

Same as before.

47*89= 4183

e=45*65, e=2925

4.   /   Right Division

Same as before.

5.   \   Left Division

Same as before.

6.   :   Colon 

This can be used for creating list.

list = -3 : 3 will result in a list from -3 to 3.
list = 1 : 2 : 20 will result in a list of odd numbers. This syntax means it will start from 1, with an increment of 2 it will end at 20.

7.   ^  Power

Same as before.

8.   '   Transpose

Check the wiki link I have added. It will give you a clear knowledge about Transpose.

a = [3 5 9]  will result in a Row vector of 3 5 9.
but a = [3 5 9]' will result in a column vector because of the Transpose Operator.


Let's look at the examples now.





Now, Let's do some Vector and Matrix Stuff!

1. Constructing Row Vector

a = [1 5 9 4 3 6]
Will result in a Row vector a with the following elements mentioned above.

Extracting a certain element-

a(3) = 9 
It will find the third element of a.

c = a(3)
Value of third element will be stored in c variable.

Change any certain element.

a(3)=8
Third element will be 8.

Deleting certain element.
a(5)=[]
it will delete the fifth element of the vector a.
[] is the empty matrix whose size is 0x0.



2. Constructing Column Vector

b = [5; 8; 7]
b = [5 8 7]' 
second line Transpose operator has been used.




3. Constructing Matrix.

A = [ 2 4 3 ; 5 2 9 ; 3 1 7]

Extracting elements from matrix.

A(3,2)
1

Results in A32 element.

Extracting Sub-Matrix

A( 1:2 , 2:3 )

Extracting Certain Row

A(3,:)
Here ":" means all elements in the array.

Appending.

Append a certain value to  the matrix.
Sizes of two arrays must be compatible otherwise will result in error.

Deleting certain Row or Column.

A( : , 3) = []
A( 2 , : ) = []

Note that earlier we have used A( 3,:) for extracting certain value.
Now we will be storing 0x0 in that location that is ultimately Zero.






4. Time for some Matrix Calculation.

Construct Matrices as shown earlier.

Assume they are A and B.

Using arithmetic operators like + - * we can compute A+B , A-B or A*B matrices.

Note :

1. ";" sign after a line will stop MATLAB to print on the command Window.


2. Anything written after "%" sign will be ignored.