Skip to content

User Manual

Freeze-FF edited this page May 2, 2024 · 20 revisions

Arduino Setup and Instructions

To connect the board to the Arduino IDE:

  • Install the ESP32 board: Tools/Board/Board Manager:

image

  • Install all other required libraries via the Library Manager: SD, Adafruit BusIO, Preferences, RTClib, SparkFun LSM6Ds3 Breakout.
  • Select the Board: Tools/Board/Board: “ESP32 Dev Module"/esp32/ESP32 Dev Module:

image

  • While flashing the code, check the output if everything works as expected.

image

  • Select the correct baud rate: In the code, a baud rate of 115200 is set (Serial.begin(115200);). Therefore, the same baud rate must be set in the Serial Monitor:

image

  • Before and while connecting the board to the computer, keep pressing the right button on the board. Once the serial adapter is plugged in and the cable connected via USB stop pressing. Select the correct Port, now you can flash code via the Upload button in the Arduino IDE. Then you can use the serial monitor to see what’s happening.

  • To Restart the ESP32 after flashing code, press the left button on the board.

  • Important: Some of the Lsm6ds3 IMUs are a slightly different version. It’s not possible to see which one it is on the IMU. Within the code there is a serial print, telling which version it is. It reads out the “who am I “register. 106 is the LSM6ds3-c, 105 the LSM6ds3. Everything is working the same way except the TAP_CFG1 register, that must be set correctly! You must therefore manually comment/uncomment the correct lines in the “final_sequence” code file!

  • If you set up a toothbrush with IMU 106 (IMU LSM6ds3-c), you can ignore the warning, "can't reach the sensor", as the toothbrush is working correctly.

Setting up and Starting the Smart Toothbrush

  • Use the USB to TTL serial converter and insert the pins of the converter into the socket of the board as shown in the picture.
  • Please note that only the first five pins are used, so check the orientation of the converter!
  • Then you can use the USB 2.0 A to Mini B cable to connect the board via the converter to the computer.

image

  1. Flash the “erase_flash” code to reset the counter to 0.

1a. Before and while connecting the board to the computer keep pressing the right button on the board.

1b. Flash the “erase_flash” code via the Upload button in the Arduino IDE.

1c. Restart the board via pressing the left button on the board and use the serial monitor to see if it worked:

image

  1. Close the Arduino IDE and disconnect the board from the computer by unplugging the USB connection.
  2. Insert the empty microSD card.
  3. Flash the “final_sequence” code to the board.

4a. Before and while connecting the board to the computer keep pressing the right button on the board.

4b. Make sure the correct version of the Lsm6ds3 IMU is selected for the TAP_CFG1 register. Set the register correctly.

4c. Flash the “final_sequence” code via the Upload button in the Arduino IDE.

  1. Insert battery (flashing the code does not work if the battery was installed prior to flashing the code).

image

  1. Restart the board via pressing the left button on the board and use the serial monitor to see if it worked:

image

  1. Disconnect the serial converter and put the board in the case.
  2. Use tape to secure the battery in place.
  3. Insert screws to screw the inner and outer shell together.

image