Is there any problem if I supply an op-amp with a voltage divider? I tried to supply an INA 128 op-amp with 15 V coming from a voltage divider. INA 128 used to do a substraction between 2 signals but the only thing I got for output was zero. I tried a different circuit to test ina and it worked fine. Is voltage divider the reason for getting zero at the ouput? And if that is the problem, why is it happening?
Indeed, supplying an op-amp (or nearlly anything else) with a voltage dividor is a bad idea, and is very probably the cause of your problem (to be 100% sure, we would need to check the resistors used for the divider, and know the power consumption of the op-amp).
The problem is that a voltage divider works as expected only if the same current crosses both resistors (ie no current enters or leave by the midle point).
If the current "leaking" out of the middle point of the divider is very small compared to the current flowing through the resistors (ie at least 100 times smaller), then the effect of this leak will be negligible. This allows for example to connect an ADC (analog to digital converter) or the input of an op-amp to the middle point of a voltage divider, as those draw only some nA.
If you want to supply anything consuming a somewhat big current (even just a few mA), you need to make sure that the resistors of the voltage dividor are small enough to have a current at least 100 times bigger than what you want to supply. So for your op-amp, if the output current is for example 1mA, then you would need at least 100mA flowing through your voltage divider. This would be quite a waist of energy.
Now let's supose you did your voltage divider with "usual" values for a voltage divider, for example, you generate the +15V from +30V using two R=10k resistors.
Your current (without the op-amp) is I=U/Rtot=U/(R+R)=15/20000=0.75 mA. It is far from the required 100mA.
What is happening if you still try to use the voltage divider with a significant leak current?
The current entering the middle point (i2) is equal to the sum of the currents exiting the middle point (i1 + i_leak) : i2=i1+i_leak
The voltage of the midle point is U_middle=i1R1=Vcc-i2R2
If i_leak=0, this becomes i=i1=i2 and U_middle = iR1 = Vcc - iR2, so i=Vcc/(R1+R2) and U_middle = Vcc*R1/(R1+R2) : this is the classical voltage dividor.
If however i_leak is not 0, then U_middle = i1R1 = Vcc - (i1+i_leak) R2. So i1(R1+R2)=Vcc-i_leakR2. So i1=(Vcc-i_leakR2)/(R1+R2). Therefore, U_middle = R1/(R1+R2) * (Vcc-i_leakR2)
As you can see from the final equation, when the leak current increases, the output voltage decreases, and in you case, with a big R2 and a i_leak in the order of a mA probably the voltage goes down to near 0V.
If you want to double check, take your voltmeter, and measure the supply voltage of your op-amp : you will probably have something far bellow the 15V you wanted.
To simplify, never use a voltage divider to "power" something : for this, use a voltage regulator/converter. Voltage dividers are however usefull to generate "signal voltages" where tou draw no or negligible current