Main Content

Tachometer

Read rotational speed of shaft

Add-On Required: This feature requires the Simulink Support Package for Arduino Hardware add-on.

  • Tachometer block

Libraries:
Simulink Support Package for Arduino Hardware / Sensors

Description

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.

Ports

Output

expand all

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

Data Types: uint32

Parameters

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