nissimzur / myb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Move Your Body

Code provided in this repository gets the raw data from MPU-6050 and MAX30100, calculates a step counter and heart rate, and stores it in the ESP-32 SPIFFS to be send via bluetooth to the MYB App.

Table of Contents

Components

To make this code work, you need the following components:

  • This repository. It contains submodules, so make sure you clone it with --recursive option. If you have already cloned it without --recursive, run git submodule update --init.
  • ESP 32 module.
  • ESP-IDF.
  • MPU-6050 module.
  • MAX30100 module.

ESP 32

Any ESP 32 module should work.

ESP-IDF

Configure your PC according to ESP 32 Documentation. Windows, Linux and Mac OS are supported.

MPU-6050

This example has been tested with a MPU-6050.

The MPU-6000 should work aswell.

MAX30100

Any MAX30100 module should work.

Quick Start

If you have your components ready, follow this section to connect the components to the ESP 32 module, flash the application to the ESP 32 and monitor the data.

Connect

The pins used in this project to connect the ESP 32 to the MPU-6050 and MAX30100 are shown in the table below. The pinout can be adjusted in the software.

Interface MPU-6050 Pin MAX30100 Pin ESP 32 DevKitC Pin Mapping
I2C Serial Clock SCL SCL IO25
I2C Serial Data SDA SDA IO26
Power Supply 3.3V VCC VIN 3V3
Ground GND GND GND

Notes:

If the sensors are not communicating with the ESP 32, consider adding 10kΩ pull-up resistors to the SCL and SDA lines.

alt text

If you're using ESP 32 on Windows and is having the ESP 32 Reset to Bootloader issue, add a 2.2uF capacitor conencted between GND and EN pins of ESP 32 module.

Configuration and Flash

  1. Clone the code provided in this repository to your PC.

  2. To use the SPIFFS, you need a tool to create the SPIFFS partition image - we recommend using igrr's mkspiffs. After creating the SPIFFS image, use the esptool to flash the image binary to the module. If you're gonna use the partitions.csv file, use the following configuration:

BLOCK SIZE = 4096
PAGE SIZE = 256
PARTITION SIZE = 0x2F0000
PARTITION OFFSET = 0x110000
  1. On the menuconfig, use the following options:
Flash size: 4MB
Partition Table: Custom Partition Table CSV (choose the partitions.csv file)
  1. Compile with the latest ESP-IDF installed from GitHub and download it to the module.

How it Works

Software

The software has 3 libraries, all located in the components folder:

Application is executed from main.c file located in main folder. The main file has a step counter function, as well as log functions and routines that store the readings in the SPIFFS.

Next Steps

Add the GATT Bluetooth functionality to send the data stored in the SPIFFS to the MYB app.

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments

This application is using code based on:

About

License:Other


Languages

Language:C 87.7%Language:Makefile 12.3%