1

I d'like to test if the PWM mode is working correctly on the pins of my Arduino Board. Do you know a simple schema to do this ?

snoob dogg
  • 229
  • 1
  • 4
  • 15

2 Answers2

1

There are my options:

  • The default way to do this is to use an oscilloscope. These can be quite expensive.
  • Use a logic analyzer if the voltage is logic/binary (0 and 3.3 or 5V). These are very cheap.
  • The easiest way to know if it works without the devices above, is to lower the speed drastically (using a divider in the software, like 1000 or more to get PWM widths of 100 ms to multiple seconds) and connect the PWM output with a resistor and a LED to GND. If the LED flashes faster, the PWM speed is high, otherwise low. By using a stopwatch you can roughly calculate the PWM speed (taking the divider into account) and after the test remove the divider.
  • If the PWM is controlled completely from your Arduino (probably not), you can use a software counter and print it out afterwards to see the speed.
Michel Keijzers
  • 12,759
  • 7
  • 37
  • 56
0

You could just do a simple analogWrite, varying the duty cycle, with an LED/resistor. Fade the value up & down, see if the LED gets brighter & dimmer.

CrossRoads
  • 2,376
  • 5
  • 9