A pedometer is a device that counts the number of steps a person takes and calculates the distance by multiplying the number of steps by the length of the step. This design uses an AVR MCV to build a pedometer. This circuit not only has the characteristics of a traditional pedometer, but also has low power consumption (low power consumption is an important feature of portable devices).This design also includes instantaneous speed measurement. Traditional Features This design uses an AVR AT90S2313 MCU, and its connections are shown in Figure 1. Different buttons switch the number of steps, distance, and speed. Other switches reset the step count, set the step length, and start/stop the step count. The walking step is sensed by each weight shift up and down of the pedometer worn. The steps can be automatically recorded by a mercury switch or other mechanical device, sending a positive edge to the INTO line for each step. Due to power consumption requirements, this design uses a 16×1 LCD readout display. The buttons are frequently queried and debounced by software, and the program is dedicated to each operation. The number of steps, distance, and speed are calculated and the display is refreshed through the interrupt service routine when there is a rising edge on the interrupt pin (INTO). Different parameter ranges are determined according to actual requirements. This design provides a range of 0_255cm step length (average human step length is 60cm) and measures 0_65535 steps (about 39km distance), 9_65535cm/s instantaneous speed. Power saving methods Power consumption is one of the most important parameters in today's industry. This design shows how to achieve power efficiency, taking into account the practicality of the product and basic microprocessor programming. For a pedometer, once the user puts it on the belt and starts walking, there is no need to use its buttons until you want to change the display mode or reset the count, etc. So no button polling is needed during this period. However, steps, distance or speed need to be counted and displayed. This can be done by putting the processor in sleep mode if no button is pressed for 10 seconds (indicating that the pedometer is on the belt). In sleep mode, no code is executed, but the registers and services are interrupted. In other words, the pedometer continues to count and display steps/distance/speed. The processor can be reset to update the execution of the button functions used, restoring its counting state, values, display, etc. In this design, the pedometer consumes 4.70mA in sleep mode and 12.65mA in normal mode. Therefore, the power consumption is reduced from 75.9mW to 25.2mW, a reduction of 37.87%. This is very beneficial for a pedometer with an on-board power supply. Speed Measurement It is easy to calculate the speed by measuring the time between two interrupts. The step length is divided by the time (in software) to get the speed. Enable the MCU's TimerO register to measure the time between interrupts. Figure 1. The AT90S2313 MCU-based pedometer puts the device into sleep mode 10 seconds after the last button press to save power. In sleep mode, it still services interrupts, allowing the display to indicate steps, distance, or speed.
|