The Pedometer click is designed to be fairly simple to use. This Click board™ contains the STP201M module, made by NiceRF. The module itself is designed for wrist pedometer products, like the pedometer bracelet or watch for example. The end user doesn't have to worry about doing any calculations on their own, or worry about what the algorithm for step detection is doing, since the INT pins output is already a measurement of the steps that were taken. Before that, though, come the intricate parts of the design inside. First of all, the STP201M module, which is the main component of Pedometer click, has a built in G sensor within the IC chipset.
How does it work?
Specifically, a MEMS sensor. Micro-electro-mechanical system sensors, abbreviated to MEMS, are made out of very small components, with their size usually ranging from 1 to 100 micrometers. These account for the sensor being very small and therefore it having low energy consumption and also not requiring a lot of space. This particular sensor is a 3D one. The three axes it utilizes, allow for precise measurements of any movement and the direction its taking. The three axes system, along with the MCUs meticulous algorithm, make it significantly less likely to make any false-positive counts (ex. tying up shoes).
The MCU has two distinguished modes. The first one of them is the operational mode. The MCU is designed to go into the operational mode whenever it senses some activity. However, if there is no discernible movement over the course of 20 seconds, it goes into the sleep mode. This mode is characterized by the very low energy consumption of only 5 µA max. The STP201M modules communication is somewhat different from the standard I2C protocol. Since our libraries do not support it, the user has the capability of changing the code of the main MCU in order to fit the protocol of the module and thus change any preprogramed settings.
Since the modules maximum operatin voltage is 3.6V, the Pedometer click uses the 3.3V rail for power supply. The other pins it utilizes are the, before mentioned, Interrupt pin, and the I2C Clock and Data pins. This click also has a Power LED indicator.
This Click Board™ is designed to be operated only with 3.3V logic level. A proper logic voltage level conversion should be performed before the Click board™ is used with MCUs with logic levels of 5V.
Specifications
Type |
Motion |
Applications |
This device can be used for tracking physical activity, for example measuring how many calories somebody burned and because of it's small size, it can be used in various healthcare products. |
On-board modules |
STP201M module, a 3D pedometer module with a precise G-sensor and MCU |
Key Features |
3D MEMS sensor combined with high precision 3D pedometer algorithm gives a precisely pedometer in any direction. |
Interface |
I2C |
Input Voltage |
3.3V |
Compatibility |
mikroBUS |
Click board size |
S (28.6 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on Pedometer click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Notes |
Pin |
|
Pin |
Notes |
---|
|
NC |
1 |
AN |
PWM |
16 |
NC |
|
|
NC |
2 |
RST |
INT |
15 |
INT |
Interrupt |
|
NC |
3 |
CS |
RX |
14 |
NC |
|
|
NC |
4 |
SCK |
TX |
13 |
NC |
|
|
NC |
5 |
MISO |
SCL |
12 |
SCL |
I2C Clock |
|
NC |
6 |
MOSI |
SDA |
11 |
SDA |
I2C Data |
Power Supply |
3.3V |
7 |
3.3V |
5V |
10 |
NC |
|
Ground |
GND |
8 |
GND |
GND |
9 |
GND |
Ground |
Onboard settings and indicators
Label |
Name |
Default |
Description |
---|
LD1 |
PWR |
- |
Power LED Indicator |
Software support
We provide a library for the Pedometer click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library contains all the necessary functions for detecting and reading the steps.
Key functions:
uint8_t pedometer_process()
- Pedometer process.
uint32_t pedometer_getStepCounter()
- Functions for get step counter.
void pedometer_resetStepCounter(uint32_t newCnt)
- Functions for reset Step counter.
Examples description
The application is composed of three sections :
- System Initialization - Sets INT pin as INPUT for detection STEP .
- Application Initialization - Initializes driver init and sets step counter on 0 .
- Application Task - It checks if a new step is detected, if detected new step - reads the current number of steps made and logs data to the USBUART.
void applicationTask()
{
uint8_t newStep;
uint32_t stepCounter;
char demoText[ 50 ];
newStep = pedometer_process();
if(newStep == PEDOMETER_NEW_STEP_DETECTED)
{
stepCounter = pedometer_getStepCounter();
LongWordToStr(stepCounter, demoText);
mikrobus_logWrite(" Step Counter : ", _LOG_TEXT);
mikrobus_logWrite(demoText, _LOG_LINE);
mikrobus_logWrite("---------------------------", _LOG_LINE);
Delay_ms( 50 );
}
}
The full application code, and ready to use projects can be found on our LibStock page.
Other mikroE Libraries used in the example:
Conversions Library
UART Library
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This click board is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.