Please help me resolve why the Output suddenly drops to zero

Thread Starter

Vikram50517

Joined Jan 4, 2020
81
Hello People,
Iam implementing a simple RC low pass filter. Let me attach the circuit below
1647442259144.png
I used the digital pin of arduino (pin 12) and provided a square wave output which remains on for 1 sec and off for 1 sec. I connected the Vout to pin A0 of arduino. When i use very high values of resistance like 100 M ohm, my output as expected had a very low near constant dc value. But if i decrease my resistance below 1 M ohm, the output magically reduces to zero. Why is that?
 

Thread Starter

Vikram50517

Joined Jan 4, 2020
81
Sure, here you go

Sketch:
C-like:
#define cellpin A0

const float mvc=4.88/1000;

float counts=0;

float mv=0;

int wave=12;

void setup() {

  // put your setup code here, to run once:

  Serial.begin(9600);

  pinMode(wave, OUTPUT);

}


void loop() {

  // put your main code here, to run repeatedly:

  digitalWrite(wave, LOW);

  //Serial.println(digitalRead(wave));

  counts=analogRead(cellpin);

  mv=counts*mvc;

  Serial.println(mv);

  delay(1000);

  digitalWrite(wave, HIGH);

  //Serial.println(digitalRead(wave));

  counts=analogRead(cellpin);

  mv=counts*mvc;

  Serial.println(mv);

  delay(1000);



  }


Basically my circuit works if resistance is very high , else my output drops to zero. Just a refining to my question
 

MrChips

Joined Oct 2, 2009
30,433
It would appear that you are doing something wrong that we cannot see from this end.
You will have to double-triple check all your HW connections and SW code.
 

MrSalts

Joined Apr 2, 2020
2,767
Hello People,
Iam implementing a simple RC low pass filter. Let me attach the circuit below
View attachment 262896
I used the digital pin of arduino (pin 12) and provided a square wave output which remains on for 1 sec and off for 1 sec. I connected the Vout to pin A0 of arduino. When i use very high values of resistance like 100 M ohm, my output as expected had a very low near constant dc value. But if i decrease my resistance below 1 M ohm, the output magically reduces to zero. Why is that?
How, exactly are you connecting your potentiometer?
Are you measuring voltage or current?
Your code and capacitor voltage (yellow) and capacitor current (in=positive, out=negative) (red).

3327F6BE-FCF3-475E-B761-B63B523B7DA5.jpeg
 

crutschow

Joined Mar 14, 2008
33,977
How did you determine those RC values?
How do you expect a significant LP filter effect when you are use a 0.5Hz square-wave into a filter with a maximum time-constant of 0.1 second (-3dB corner frequency of 1.6Hz)?
Below is the LT spice simulation of the circuit with a maximum 5s time-constant (0.032Hz corner).
The output is shown for pot settings of 200kΩ (red trace), 500kΩ (yellow trace), and 1megΩ (green trace).

1647450857010.png
 

Thread Starter

Vikram50517

Joined Jan 4, 2020
81
Hello All, Thanks a lot for all your replies and interest towards answering me. Firstly to all of you, I had used Tinkercad arduino simulator to run my circuit, i will attach my schematic in the following post for your reference. Now,let me address your queries one by one,

@crutschow The dc value that i get when i keep my resistance like say 10000M ohms is 0.49V . I used an IC741 amp in my circuit to get my output as 4.99V. I know that i have a very low corner frequency in my circuit construct. The reason is i wanted to see how well a low pass filter works, so i restricted to a much lower corner frequency to see whether the output is DC. " How do you expect a significant LP filter effect when you are use a 0.5Hz square-wave into a filter with a maximum time-constant of 0.1 second (-3dB corner frequency of 1.6Hz)? " . Iam sorry sir, being a novice in this field i cant understand why i cant expect that, can you kindly clarify.

@MrSalts Iam measuring Voltage as the output . Iam not using a pot, iam using a simulator so iam just changing the value of the resistor. Also MrSalts, what is your Simulator?

@AnalogKid Sorry sir, I don't understand your answer, my output remains 0 throughout, it does not have any oscillatory character(at least it lacks in the noticeable scale). or maybe IDK, iam printing a output sample for every 1 second, has it got anything to do with that?

@ericgibbs Oh, does it work? Maybe is it the reason my simulator is messing up and it just works fine on the actual arduino IDK

@MrChips
Let me attach my schematic in the next post (Note: I have just added an amplifier to amplify the output thats all and a 9v battery to provide power supply to the amp)
 
Last edited:

Thread Starter

Vikram50517

Joined Jan 4, 2020
81
1647494099569.png


Output when my R value is so high(100000 M ohms)
1647494194382.png

Output when my R value is low even like anything below or equal to 1 M ohm

1647494285279.png
 

ericgibbs

Joined Jan 29, 2010
18,623
hi V,
The OPA is missing resistive components, so the results you are measuring are a result of these missing components
Also, the OPA is incorrectly wired.
E
 

Thread Starter

Vikram50517

Joined Jan 4, 2020
81
Hi @ericgibbs , so should i provide a feedback resistor to the Op-amp? Also i tried removing the capacitor from the circuit and this issue gets eliminated, So i figured out the capacitor is the black sheep out here somehow.
 

ericgibbs

Joined Jan 29, 2010
18,623
Good Morning V,
If you could explain the purpose of the project, I will be pleased to help.;)

What is the OPA designed to do. Also the type of OPA.?
E
Added: image
 

Attachments

Last edited:

Thread Starter

Vikram50517

Joined Jan 4, 2020
81
Hello @ericgibbs , its not for a project per se, although i encountered this situation while doing my project of creating a visible light system reciever with a photodiode. I just wanted to cultivate some deeper skills in electronics and in the process , wanted to know WHY this particular situation is happening, so just out of interest.

Also the Op-Amp iam using is the IC-741 amplifier , iam trying to use the OP-Amp to amplify my output voltage from the filter.
so iam connecting pin no 6 of the op-amp to arduino pin A0, which represents the circuit output
 

ericgibbs

Joined Jan 29, 2010
18,623
hi V,
The simple circuit, in post #16, will give a gain of *2.

The tests I have done with your Sketch and Cap/resistor components, post #1, show that the circuit works as expected.

The circuit you posted in post #13 will not work, due to the missing components, so it will give misleading results.
 

ericgibbs

Joined Jan 29, 2010
18,623
hi V,
Regarding visible light transmission projects, the downside is that ambient light levels will most likely saturate the receiver.
Usually IR is used, the IR beam is modulated so that the receiver can be AC coupled, also the modulation can be encoded with specified instruction codes.

E
 

MrChips

Joined Oct 2, 2009
30,433
Nobody has a 10000MΩ resistor!
Ah, I see, you are using a simulator where anyone can enter garbage.
GIGO machine (garbage in, garbage out) and that is why I don't use simulators if I can avoid it.
 
Top