I have measured the voltage and frequency between the GND and pin 13. And I get a correct ~14mV and ~146 kHz value (I've set the delays to a lower value).
But if I make the same measurement on the led
I get ~13-14 mV and zero Hz frequency.
Why do I measure zero Hz when I measure on the led compared to the measurement when I do it on the GND + pin 13. How the 220 ohm resistor makes this difference?
Thanks a lot. I tried to measure the current. I am still shown zero Hz.
I've played with it a lot, and I think the reason may be the limitation of my meter.
I do not have an oscilloscope, so I purely depend on what value is shown by the meter.
I think this exercise generates a square wave.
I have measured the voltage on the LED using DC measurement, and when the pin 13 is set to HIGH, the meter shows 2 V DC between the two legs of the LED, and about .5 mV when LOW. So I thinks in theory the frequency should be measurable by examining the voltage.
So probable getting zero Hz is not because there is no linear connection between the V and the current flowing as the voltage fluctuate between 0 and 2 V DC measured across the LED.
I've reproduced the 14 mVrms/146.7 kHz, this one produces these values:
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delayMicroseconds(1); // wait for a second
//delay(50);
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delayMicroseconds(1); // wait for a second
//delay(50);
}
In theory this should ideally produce about 500 kHz. Probable you get 146 kHz because some other limitations. And it is not really relevant to the question why it is 146 instead of 500.
I use a multimeter (extol 8831251), it has a measurement range from 1 Hz to 5 MHz below 36 V.
This function works very accurately in the range 3 microseconds and up. We cannot assure that delayMicroseconds will perform precisely for smaller delay-times.
10: 14 mVrms, 40.85 kHz (the meter shows 0 Hz on the legs of the LED)
But back to the topic ... so the topic is why I measure zero Hz on the LED why I measure correct (or maybe better to say reasonable values) between the pin 13 and GND.
As you see from your experiment with lower frequencies the voltage at pin 13 is about 2.3 times greater than the voltage across the LED. I suspect that your meter is just not sensitive enough to read the lower voltages.
Yes, based on my experiments and measurements. I think the same that it will be the limitation of my meter. And probable there is no reason why we shouldn't be able to measure the frequency on the LED itself if the right equipment is available.
Referring back the above mentioned possible reason, that the behavior of the LED is not linear. When I set the blinking to a very low frequency and I measured DC on the LED legs, the voltage clearly fluctuates. Is it possible that on higher frequencies, still this non linear behavior is the reason? But having 10/25 Hz are not specifically high frequencies.
Did someone made similar measurements on this LED circuit, with some more sophisticated measurement tools than what I have? Did you maged to measure the frequency on the LED legs?
Here is the output from pin 13 on the yellow trace and the voltage across the LED on the blue trace.
Using your code with delayMicroseconds(1);
Measurements made satisfactorily.
Thanks John for the measurement results, I think we can say that there is no other reason why I get 0 Hz, just because my meter cannot measure the real value.
Jim, you asked me why I wanted to measure it. I cannot tell any specific reason. Just learning and want to play around and getting first hand experience about what is going on in the world of electric power. The idea just came to me to measure the voltages at different points of the circuit, to know it more deeply, and as my meter also shows the frequency I noted the different frequencies as well. And I noted that measuring the voltage on the LED showed zero. And I couldn't find any reason, based on my current knowledge why this would happen.
This is how I got here