Main Content


Read rotational speed of shaft

  • Tachometer block

Simulink Support Package for Arduino Hardware / Sensors


The Tachometer block reads the rotational speed of the shaft from the tachometer connected to the hardware. The block outputs the speed of rotation as a uint32 value.

If you simulate a model that contains the Tachometer block without connecting the hardware, the block outputs zeros. For more information, see Block Produces Zeros or Does Nothing in Simulation.



expand all

The port outputs the rotational speed of the shaft connected to the hardware.

Data Types: uint32


expand all

Specify the pin number on the hardware to which the tachometer is connected.

Click View pin map to open the Arduino Pin Mapping table .

To know how to assign pins for the block, see Pin Mapping for Arduino Timer Independent Blocks.

For more information about the pins supported on the hardware for interrupts from the tachometer, see Pins With Interrupts.

The interrupt mode specifies how the tachometer counts its output signal. The counting technique is different for different interrupt modes:

  • RISING – Counts every rising edge of the signal.

  • FALLING – Counts every falling edge of the signal.

  • CHANGE – Counts every rising and falling edge of the signal.

  • LOW – Counts every low signal.

  • HIGH – Counts every high signal.

This figure shows how the tachometer counts its output signal in different interrupt modes.

Specify the number of interrupts the block receives each rotation.

Specify how often the block reads the rotational speed from the tachometer, in seconds.

Version History

Introduced in R2018b