LM324N connection problem in a sensor circuit

I'm working out to produce water level sensor using a capacitive sensor. The flow will be a voltage will supplied to the capacitive sensor, then the signal from capacitive sensor will be amplified. Lastly, the signal will be read by using analog pin on arduino. At first, I try to find the analog value that I can get from the arduino. So, I'm trying to amplify the voltage supplied by using LM324N, but I got the value of analog value recorded to be 0. I expect that the connection of op amp is wrong. The amplifier operation I used are 2 inverting amplifiers with gain of 3.0.

The circuit I copied into tinkercad (i used two 741 op amp since they dont have LM324N):

ps: I used 10pF capacitor first as an exchange for my capacitive sensor since my sensor range calculated is 10pF - 35pF.

The schematic diagram:

The code to read the analog value im using:

om amp (lLM324N) connection only:


ps: (i) the 5v from arduino connected to the +ve part of voltage.
(ii) the output from second inverting op amp is connected to A2 on arduino
(iii) I used capacitor there to resemble as a capacitive sensor.

overall circuit:

I am sorry to say that those photos are not that helpful.

Please post a schematic. Hand drawn, photographed and posted is fine.

2 Likes

To what are you referencing your amplifier input? If it is 0V, and you do not have dual polarity supplies, then the inverting stage output can never go below zero.

Do you have a link to the capacitive sensor datasheet?

How do you know you need a gain of 3?

Normally a capacitive sensor doesn't need amplification.

An inverting op-amp circuit "naturally" has a high-impedance input which can be good with a "weak capacitive signal" but a capacitance doesn't provide a DC reference so you need a high-value resistor to ground, or a high-resistance bias circuit to keep the input from floating to an unknown voltage. It MIGHT be floating to a negative value, forcing the op-amp output to ground (assuming there is no negative supply and it can't go negative),

Hi, @khaiaz
Welcome to the forum.

Can you please tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

Forget the display for now, disconnect it and put it aside for later. Connect only the sensor and write some simple code to take readings from it and send them to the serial monitor. Only when you are happy with how that works should you try to get the display working. When you are happy with the display only then try to combine the two.

1 Like

Im sorry for that. I already add the schematic diagram including the code I used into the post. Feel free to check it out. Thank you

The input will be from 5v pin on the arduino board. I already add the schematic diagram including the code I used into the post. Hope that it helps you to understand the circuit.

I just learned basic things in classes during my foundation level. But during that, I just copied whatever been told in the tutorial book basically. I can tell you that I'm not quite good in anything related to the electronincs and arduino.

  • Make sure the Arduino GND is connected to the circuit.

  • That breadboard might have broken power rails 1/2 way down their length.

  • Are the pads on the LCD soldered to their wire connections :face_with_monocle: .

  1. I have changed the diagram.
  2. Yes, it has a break of power rail between upper and lower board. But I already connected those two.
  3. Yes, it has been soldered.

To be clear the break that may need to be bridged is in the center of each power rail in the black "squares" as well as connecting the top and bottom rails.

I connected it in a different which is I made the upper and lower rails connected to two different 5v pin and ground pin on the arduino board. I thought it will be the same.

Hi,
Please post any updates in new posts to keep the flow of the thread.

How do you think the sensor circuit works?

Tom.. :smiley: :+1: :coffee: :australia:

Its not readable, and its not drawn correctly.

Remember, where you can, INPUTS go to the left, OUTPUTS to the right, positive voltages to top and negative to bottom.

Hi,
Here is a redraw of you input circuit;

How do you think the capacitor is going to measure the water level?
OR
Do you have a capacitive sensor module?

Can you please post a picture of what you are using for the sensor?

Please do this in a new post.

Thanks. Tom... :smiley: :+1: :coffee: :australia:

2 Likes

That circuit is never going to work.
U3 needs a negative signal on it's (-) input to generate a positive output.
U2 can't provide that negative voltage on a single supply.
The cap on U2 seems ornamental.

The cap in a capacitive sensor is normally part of some sort of oscillator, where a change in capacitance changes the frequency or pulse length that can be measured.
I see nothing of that in the circuit provided.
Leo..

I suspected your op amp was connected like that. The output of U2 cannot swing below 0V without a negative power supply. The lowest voltage it can go is 0V, the -ve power supply (actually it is a few hundred millivolts above 0V as the transistor on the op amp output will saturate).
There are two fixes

  1. provide a negative supply – that is a bit of a fiddle.
  2. Or 2) much simpler is to bias the non-inverting inputs of the amplifier to form a sort-of artificial 0V. This could be at half the power supply voltage ~2.5V in your case. However, the LM324 will not swing to the full positive power supply, it needs ~2 x Vbe drops so about 1.4v. The max it can swing is 5-1.4 = 3.6V. So bias the non-inverting inputs to half of this 3.6/2 = 1.8V to give you maximum voltage swing.
    I have given a crude sketch of how to modify your circuit. Break the connection to the two i.e both, non-inverting inputs and connect to the junction of the resistors.

I’ll leave it to you to calculate the two resistors. For now you can ignore the LM324’s high bias current.

I would add that I do not understand how your capacitive sensor provide an input. That is probably a separate issue.

Im working for building a water level system by using capacitive sensor right now. My idea is the signal from the capacitive sensor will be read by arduino in term of analog signal. Before this, I have tried to used inverting amplifier for the signal conditioning, but it results the analog signal to be 0. The circuit i have used is as below:


credit to @TomGeorge for the circuit.

the code:

I would to ask for others opinions regarding to the example of the signal conditioning for this project.

If You post a link to the datasheet of the sensor You might get useful replies. Please read the topic "How to get the best out of this forum', and follow it.