PC's Interrupt Measures RPM

Feb. 22, 1999
This simple design measures the speed in RPM of a rotating wheel by using the PC’s special BIOS interrupt INT1CH and its printer interrupt IRQ4. An infrared optocoupler mounted on the wheel side...

This simple design measures the speed in RPM of a rotating wheel by using the PC’s special BIOS interrupt INT1CH and its printer interrupt IRQ4. An infrared optocoupler mounted on the wheel side senses the wheel rotation and generates clock pulses, which initiate an interrupt to the PC through IRQ4 (see the figure).

Each rotation generates an interrupt that enables the interrupt handler routine written in Turbo “C” (see the listing). The handler software increments a global counter “RPMCOUNT” for each occurrence of IRQ4. The timer handler routine written for Special BIOS interrupt INT1CH increments another global counter “TICKER” for each clock tick of INT1CH. It also monitors the number of revolutions stored in “RPMCOUNT” for each one-second interval. The special BIOS interrupt (INT1CH), which does nothing until you provide a routine for it, automatically occurs 18.2 times per second. INT1CH is invoked by the BIOS timer interrupt after it has updated the time-of-day count.

The variable “RPM” provides number of rotations per minute (RPM) of the rotating wheel by multiplying the variable “RPMCURR” by 60. That’s because the variable “RPMCURR” contains the measurement for a one-second interval. Consequently, this simple design is able to precisely measure RPM of a rotating wheel in the PC environment.

Sponsored Recommendations

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!