what is this on serial plotter ?

hi guys

i just was experimenting with the serial plotter after i made a simple circuit

its an LDR with 1M ohm resistor and conected as analog input but when i put my finger
above the LDR a strange pattern shaws up

thats the circuit

i think its a my heart pulse but i am not sure
can you guys help

can you guys help

It is plotting the data that your code, that you did not show, is sending it. What help do you need, and how can you expect us to help without seeing your code?

i am sorry i assumed that you know the circuit already
thats the code

int ldr = A0;
int light;

void setup() {
Serial.begin(9600);

}

void loop() {

light = analogRead(ldr);

Serial.println(light);
delay(50);

}

i am sorry i assumed that you know the circuit already

I can't see a circuit.

i modified the topic and i put the circuit

i think its my heart pulse shawoing on the ldr due to changing in light intensity
by blood pressure

or i might be totally wrong

The X axis has 500 points and each tick of the axis is equal to an executed Serial.println() command.

You are printing every 50ms, so 100 on the axis = 5 seconds. You have approximately two and a half events repeating every 5 seconds or 50 per min.

It's certainly possible it is your heartrate. Try to run around a bit , or do anything to elevate your heart rate. I can think of other methods :slight_smile: Then place your finger over the ldr. See if the frequency is higher.

cattledog:
I can think of other methods :slight_smile:

i certanly should try that with the LDR stick to my finger while watching the serial plotter
that would be fun :slight_smile:

is there is a way to make the arduino calculate how many pulses
a minute?

The image shows a mix of two frequencies, most probably 20Hz from delay(50), and 50 or 60Hz from mains. Your finger acts as an antenna for such environmental noise.

thanks drdiettrich

is there a way to make the arduino count how many at some period of time?
how many time the analog raed would reach say 300 at one minute

Count what? If you modify the delay time, the shown frequency will vary as well - it's only an artifact. You'll see a very low frequency if the sample rate matches your mains frequency.

If you want to dispose of the mains interference add a (suggest) 1uF capacitor across the resistor. The LDR is slow anyway, so you won't be losing much

regards

Allan

@ DrDiettrich

The image shows a mix of two frequencies, most probably 20Hz from delay(50), and 50 or 60Hz from mains

How do you determine this? What I see is a 20Hz signal which alternates high/low and is the value of each analog read every 50 ms. Is this alternating pattern the 20Hz modulated at 50Hz?

But more fundamentally I see this alternating signal is being modulated at approximately 2.5 Hz.

I say this because there are approximately 10 patterns across the x axis time base. This image is graphed in the serial monitor with the Serial Plotter where the 0 to 500 axis represents readings, and 500 x 50ms = 2.5 seconds.

I thought this low frequency pattern was possibly/probably the heartbeat.

See Aliasing and Beat Frequency Oscillator.

Human heartbeat would show as a single line, not like a mix of multiple sinusoidal frequencies. What you see is an artefact (alias) from a high frequency signal, sampled at a lower frequency. Aliasing is a common problem with digital sampling of signals which contain higher frequencies. Professional ADC applications (digital scopes...) include a low pass filter, that drops frequencies above half the sample frequency from the input signal.

I see 50 Hz modulated by 20 Hz which is not a human heart rate, unless you are using very excited Hummingbird for testing.