CraftsMan BLE is designed to send accelerometer&Gyroscope data over BLE and serial port toany BLE Client and/or computer with a serial port.
Systems requirements:
- M5 Stick-C Plus (the device that will send the data) as BLE Server
- BLE Client a Mobile phone using Bluefruit LE Connect on iOS or Android
- and a Laptop with Arduino IDE
- Download the CraftsmanBLE.ino file to your Arduino sketches directory
- Compile it (Make necessary changes in case you are using a M5-Stick instead of a M5 Stick C plus. Note the only changes needed with be the Button numbers for Button A,B, IMU initialisation and IMU read commands, and the LCD print commands.
-
Reset the M5-StickC plus
-
Connect Mobile to "Kosha Craftsman" servie using the BLE software
-
Hit Connect
-
Click UART under modules section
-
On the M5-StickC Plus - Click Button A to start reading IMU readings
-
After a few seconds click Button A to stop the accelerometer readings.
-
M5 Screen will show the number of readings taken(see last line)
-
Click button B - to dump the readings in CSV format to BLE Client device
-
Click "Settings" icon, Export, Copy as txt.
-
Long Press A to restart device.
Version 2.0 allows control of M5 from the BLE Client device as follows
- All commands are single letter command (case insensitive)
- An optional integer (max 3 digits) follows the command
S.No | Commands | Argument | Remarks |
---|---|---|---|
1 | S | None | Start reading IMU |
2 | S | None | Stop reading IMU |
3 | D | None | Dump readinds to BLE Server |
4 | R | None | Restart M5 |
5 | P | nnn | Set period to nnn millisecs |
6 | O | nnn | Set offset to nnn millisecs |
introduced a way to control M5 from the mobile phone
- M5 Stick C plus
- ESP32 Arduino BLE
- Easybutton
- CraftsmanBLE is set to take readings every 100 ms. you can change that by changing delta_T
- The current buffer size can accomodate a max of 3000 accelerometer readings, if the number of readings exceed 3000 then the buffer pointer will fold back to 0 and start writing from top of buffer. Acts like a ring buffer.
- Sorting the data on seqno will provide you the right order of readings even if the buffer has folded.
- a 10ms delay is inserted while writing to BLE client- this is ensure BLE server is not overwhelmed.
- 1.0 :17/Feb/21 Output consisted of 3-axis Accelerometer readings
- 1.1 :19/Feb/21 Output now includes 3-axis Accelerometer and Gyro readings
- 1.2 : 1.5 :23/Feb/21
1. SeqNo in BLE output is replaced by secs.999 (starts at 0.000) 2. The interval time is very close to desired delta_T using delta_offset 3. Long Press A button till beep to restart device 4. If connected to physical serial port you can still read old seqNo along with Secs 5. Device has a unique name derived for chip id and prefixed by KoshaCraftsman
- 2.0 :03/Mar/21
- Use Serial Input to provide commands to change Period and Offset
1. Single letter command followed by a max 3 digit number 2. example P100 or p100 will set period to 100ms 3. example O20 or o20 will set offset to 20ms (DONT USE THIS FOR NOW) 4. note: Period has to be greater than processing time ie delta_offset 5. Offset cannot be very large betwee 24 and 30 ms 6. program will ignore values outside this range. 7. s or S to start/stop reading activity 8. r or R to restart M5