Well I am trying to make a Stroboscop. I found this code at blow: and tried. It works normally. But if I increase the RPM so decrease the "strobeDelay" time, the brightness of the LEDs goes out. Even if I try the GreatScott code. The same problem persists at high RPM. I am using power LED.

On the other hand there is a stroboscop which is Fluke 820, it says

Features high-intensity 7-LED array—4,800 Lux @ 6,000 FPM/30cm

How they achieve that constant brightness under the high frequency?

    // Gray text are just helpful comments, you don’t need to type them. :)

/******* -----=====!! EASY STUFF TO MESS WITH !!=====------ ******/

  // What analog pin should we use to read the value from the potentiometer?
  int analogPin = 2; // Yep, you heard right: The coolest of the Analog pins...

  // What pin is the LED connected to?
  int ledPin = 13; // Contains a built in resistor!

  // How much time should the light stay on between delays, in Microseconds (millionths of a second)?
    /* Big number = more blur, more perceived brightness
     * Small number = less blur, less perceived brightness  */
  long onTime = 250;

  // What should the minimum delay be in milliseconds (thousandths of a second)?
  // This sets the bottom delay range of the strobe, as a delay of 0 doesn't actually flash =P
  // The strobe starts with this as the "fastest" mode, and goes slower from there, adding to the delay
  int minDelay = 1; // 1 is the lowest we can actually do without a better delay function   

  // What should the maximum delay be in milliseconds?
  // This is the longest time that the biggest potentiometer value will be mapped to, and longest
  // time between strobe flashes.
  int maxDelay = 100;

/******* -----=====^^ EASY STUFF TO MESS WITH ^^=====------ ******/

// Initialize the number to hold our strobe delay. Isn't used till we get to the main loop
long strobeDelay = 0;

void setup() {
 pinMode(ledPin, OUTPUT); // Setup ledPin as an output.

void loop() {
  // To make the math easier, we use map(value, fromMin, fromMax, toMin, toMax) to convert the
  // 0 to 1023 range we get from analogRead, into our strobe delay range of 1 to 100 :D
  strobeDelay = map(analogRead(analogPin), 0, 1023, minDelay, maxDelay);

  digitalWrite(ledPin, HIGH); // Switch the ledPin to HIGH, turn it on!
  delayMicroseconds(onTime); // Delay while on, for the given onTime.
  digitalWrite(ledPin, LOW); // Switch the ledPin to LOW, turn if off!
  delay(strobeDelay); // Delay while off, for given strobeDelay.

For those who wonder there is a video, but another brand same result, brightness constant even if RPM changes. I tried 2 different power LED. on of them is this, the other LED is I found in a broken projector, I used them 2 working strip. No doubt in your mind, this led strip is very bright at low frequency. Both of them same result like this:

enter image description here

  • 1
    How are you driving the LEDs?
    – Majenko
    Commented Dec 13, 2020 at 11:12
  • I think the answer is in the comments on the code you posted: Big number = more blur, more perceived brightness * Small number = less blur, less perceived brightness Short duration makes for lower perceived brightness. The actual brightness is the same, but our eyes see it as less when the duration is shorter.
    – Duncan C
    Commented Dec 13, 2020 at 12:47
  • 1
    I don't think the term RPM applies here. What do you mean by it? What parameter are you changing and what exactly is the effect, that you see with what values? The analogRead() currently only changes the delay between the pulses. The onTime stays constant. Each pulse will be as bright as the other one. Though you might see the overall brightness rising with lower delays, as your eyes will start tying the pulses together - more pulses per second means more overall brightness.
    – chrisl
    Commented Dec 13, 2020 at 13:05
  • @Majenko a npn channel mosfet (IRFZ44N) datasheet is here datasheet.octopart.com/…
    – mehmet
    Commented Dec 13, 2020 at 19:38
  • @chrisl Actually your says looks absolutly right, but in realty not works.I've never heard of it yet, but is there a time required for the leds to flash? I will change leds and try again.
    – mehmet
    Commented Dec 13, 2020 at 19:42

1 Answer 1


To keep the same brightness, you have to keep the same duty cycle (percent of on time over off time). So to change the rate without changing the brightness, you have to increase delayMicroseconds(onTime) by the same percent you increase delay(strobeDelay). But note that as you go slower, the on time will be too long to freeze the motion you are trying to study. (If it's just for a party effect this may not matter.)

  • 2
    Try delayMicroseconds(strobeDelay*250); (instead of delayMicroseconds(onTime);). This should give you the same perceived brightness, not matter what speed/"RPM" is selected.
    – Gerben
    Commented Dec 13, 2020 at 16:15
  • nice idea, I will try tomorrow and write here the result
    – mehmet
    Commented Dec 13, 2020 at 19:36
  • 1
    @Gerben same result nothing changed. I think I need very shiny leds
    – mehmet
    Commented Dec 15, 2020 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.