release v1.0

master v1.0
czipis 2020-06-06 11:52:34 +02:00 committed by jan-cipa
parent e6e0b9219c
commit 107e3e7c77
4 changed files with 554 additions and 2 deletions

113
README.md
View File

@ -1,2 +1,111 @@
# mavic-mini-battery-info # DJI Mavic Mini Battery Info
DJI Mavic Mini Battery Info
Because Mavic Mini battery has not charge level indicator (like other DJI batteries) with this device you are able to quickly check Mavic Mini battery status, level of charge and other informations.
It reads I2C smart battery chip and report its values. All values are also printed to USB serial line.
![screenshot](https://czipis.eu/images/battery-info-screenshot.jpg)
serial line report example
```
Manufacturer Name: SDI
Device Name: BA01WM160
Chemistry 2044
Manufacturer Data:
Design Capacity: 2400
Design Voltage: 7200
Manufacture Date (D.M.Y): 20.1.2020
Serial Number: 1U5X02MEXP0ARB
Specification Info: 49
Cycle Count: 10
Voltage: 8.14
Full Charge Capacity: 2302
Remaining Capacity: 2080
Relative Charge(%): 91
Absolute Charge(%): 87
Minutes remaining for full charge: -1
Cell 1 Voltage: 4067
Cell 2 Voltage: 4068
State of Health: 0
Battery Mode (BIN): 0b110000000000001
Battery Status (BIN): 0b11000000
Charging Current: 4750
Charging Voltage: 8400
Temp: 23.75
Current (mA): -131
```
[![Watch the video](https://czipis.eu/images/youtube.png)](https://www.youtube.com/watch?v=iwm-ErN7L9Y)
### required parts
all parts can be purchased on Aliexpress for less than $6
- [Breadboard Jumper wires Cables](https://www.aliexpress.com/item/32725034190.html)
- [1.8" 128x160 65K SPI LCD Display Module ST7735](https://www.aliexpress.com/item/33031122936.html)
- [Arduino Nano ATMEGA328P Mini USB (Nano3 compatible)](https://www.aliexpress.com/item/33013146682.html)
### custom 3D printed case
- [3D printed custom case (Openscad parametrized)](https://www.thingiverse.com/thing:4430174)
### pin connections
![Wiring](./breadboard.png)
| Arduino NANO | SPI TFT | Mavic Mini battery |
|-----------------|:----------:|:-----------------------:|
|VIN | | 3 |
|GND | GND | 5 |
|5V | VDD | |
|3.3V | BLK | |
|A4 | | 6 |
|A5 | | 1 |
|D7 | RST | |
|D8 | DC | |
|D9 | CS | |
|ICSP3 | SCL | |
|ICSP4 | SDA | |
## compiling
### required libraries
#### following TFT library needs to be installed from .ZIP archvive
- download [zip](https://github.com/Bodmer/TFT_ST7735/archive/master.zip) and install in Arduino IDE (Sketch -> Include library -> Add .ZIP library)
- [Bodmer TFT_ST7735 v0.17](https://github.com/Bodmer/TFT_ST7735)
#### dependencies which can be installed from Arduino IDE
- (Sketch -> Include library -> Manage libraries...)
- [Adafruit_GFX_Library v1.8.3](https://github.com/adafruit/Adafruit-GFX-Library)
- [Adafruit_BusIO v1.3.0](https://github.com/adafruit/Adafruit_BusIO)
#### modify TFT_ST7735 library to fit in Nano flash memory
modify ${HOME}/Arduino/libraries/TFT_ST7735/User_Setup.h
uncomment following lines at top of the file
``` #define TAB_COLOUR INITR_BLACKTAB ```
comment any other TAB_COLOUR line, it should look like
```
//#define TAB_COLOUR INITB
//#define TAB_COLOUR INITR_GREENTAB
//#define TAB_COLOUR INITR_REDTAB
#define TAB_COLOUR INITR_BLACKTAB
//#define TAB_COLOUR INITR_GREENTAB
```
comment out all fonts except Font 1 and Font 2 (otherwise it will not fit in Nano flash memory)
```
#define LOAD_GLCD // Font 1. Original Adafruit 8 pixel font needs ~1820 bytes in FLASH
#define LOAD_FONT2 // Font 2. Small 16 pixel high font, needs ~3534 bytes in FLASH, 96 characters
//#define LOAD_FONT4 // Font 4. Medium 26 pixel high font, needs ~5848 bytes in FLASH, 96 characters
//#define LOAD_FONT6 // Font 6. Large 48 pixel font, needs ~2666 bytes in FLASH, only characters 1234567890:-.apm
//#define LOAD_FONT7 // Font 7. 7 segment 48 pixel font, needs ~2438 bytes in FLASH, only characters 1234567890:.
//#define LOAD_FONT8 // Font 8. Large 75 pixel font needs ~3256 bytes in FLASH, only characters 1234567890:-.
```

BIN
breadboard.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 KiB

127
dji_logo-48x48.h Normal file
View File

@ -0,0 +1,127 @@
/*******************************************************************************
* generated by lcd-image-converter rev.90f620c from 2017-10-04 21:09:44 +0500
* image
* filename: unsaved
* name: dji_logo-48x48
*
* preset name: Color R5G6B5
* data block size: 16 bit(s), uint16_t
* RLE compression enabled: no
* conversion type: Color, not_used not_used
* split to rows: yes
* bits per pixel: 16
*
* preprocess:
* main scan direction: top_to_bottom
* line scan direction: forward
* inverse: no
*******************************************************************************/
// We need this header file to use FLASH as storage with PROGMEM directive:
#include <avr/pgmspace.h>
// Icon width and height
const uint16_t Width = 48;
const uint16_t Height = 48;
// The icon file can be created with the "UTFT ImageConverter 565" bitmap to .c file creation utility, more can be pasted in here
const unsigned short dji_logo[2304] PROGMEM={
// █████▓▓▓▓▓▓▓████████████████████████▓▓▓▓████████
// ████▓▓▓▓▓▓▓████████████████████████▓▓▓▓█████████
// ███▓▓▓▓▓▓▓▓████████████████████████▓▓▓██████████
// ███▓▓▓▓▓▓▓████████████████████████▓▓▓███████████
// ██▓▓▓▓▓▓▓███████████████████████████████████████
// ██▓▓▓▓▓▓████████████████████████████████████████
// ██▓▓▓▓▓█████████████████████████████████████████
// ██▓▓▓███████████████████████████████████████████
// ████████████████████████████████████████████████
// ████████████████████████████████████████████████
// ████████████████████████████████████████████████
// ███████████████████████▓▓▓▓▓▓▓██████████████████
// ███████████████████████▒░░░∙∙░██████████████████
// ███████████████████████░░░░∙∙▒██████████████████
// ██████████████████████▓░░░░∙∙▓██████████████████
// ██████████████████████▒░░░░░∙███████████████████
// █████████▓▓▓▓▓▓▓▓▓▓▓██░░░░░░░█▓▓▓▓▓▓▓██▓▓▓▓▓▓▓██
// ███████▒░░░░░░░░░░░░▓█░░░░░░▒█▒∙∙∙∙∙∙█▓∙∙∙∙∙∙▓██
// ██████▒░░░░░░░░░░░░░█▓░░░░░░▓█░∙∙∙∙∙▒█▒∙∙∙∙∙∙▓██
// █████▓░░░░░░░░░░░░░▒█▒░░░░░░█▓∙∙∙∙∙∙▓█░∙∙∙∙∙░███
// █████▒░░░░░░▒████████░░░░░░▒█▓∙∙∙∙∙∙▓▓∙∙∙∙∙∙▒███
// █████░░░░░░░▓███████▓░░░░░░▓█▒∙∙∙∙∙░█▓∙∙∙∙∙∙▓███
// ████▓░░░░░░░████████▓░░░░░░▓█░∙∙∙∙∙▒█▒∙∙∙∙∙∙████
// ████▓░░░░░░▒████████▒░░░░░░█▓∙∙∙∙∙∙▓█░∙∙∙∙∙░████
// ████▒░░░░░░▒████████░░░░░░▒█▓∙∙∙∙∙∙▓▓∙∙∙∙∙∙▓████
// ████░░░░░░░▓███████▓░░░░░░▓█░∙∙∙∙∙░█▓∙∙∙∙∙∙▓████
// ███▓░░░░░░░▒▓▓▓▓▓▓▓░░░░░░░█▓∙∙∙∙∙∙▒█▒∙∙∙∙∙∙█████
// ███▓∙░░░░░░░░░░░░░░░░░░░░▒█▓∙∙∙∙∙∙▓█∙∙∙∙∙∙▒█████
// ███▓∙∙∙░░░░░░░░░░░░░░░░░░██░∙∙∙∙∙∙█▓∙∙∙∙∙∙▓█████
// ████▓▒░░░░░░░░░░░░░░░░▒▓██▓∙∙∙∙∙∙▒█▒∙∙∙∙∙∙▓█████
// █████████████████████████▓░∙∙∙∙∙∙▓██▓▓▓▓▓▓██████
// ██████████████████▓▓▓▓▓▓▒∙∙∙∙∙∙∙░███████████████
// ██████████████████∙∙∙∙∙∙∙∙∙∙∙∙∙∙▓███████████████
// █████████████████▓∙∙∙∙∙∙∙∙∙∙∙∙∙▒████████████████
// █████████████████▒∙∙∙∙∙∙∙∙∙∙∙∙▒█████████████████
// █████████████████░∙∙∙∙∙∙∙∙∙∙▒▓██████████████████
// █████████████████▓▓▓▓▓▓▓▓▓▓█████████████████████
// ████████████████████████████████████████████████
// ████████████████████████████████████████████████
// ████████████████████████████████████████████████
// ███████████████████████████████████████████▓▓▓██
// █████████████████████████████████████████▓▓▓▓▓██
// ███████████████████████████████████████▓▓▓▓▓▓▓██
// ██████████████████████████████████████▓▓▓▓▓▓▓▓██
// ███████████▓▓████████████████████████▓▓▓▓▓▓▓▓███
// █████████▓▓▓████████████████████████▓▓▓▓▓▓▓▓▓███
// ████████▓▓▓▓████████████████████████▓▓▓▓▓▓▓▓████
// ████████▓▓▓████████████████████████▓▓▓▓▓▓▓▓█████
0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xd6bb, 0xc639, 0xc639, 0xc659, 0xc659, 0xc65a, 0xc67a, 0xce7a, 0xce9a, 0xce9a, 0xcebb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xdefb, 0xdefb, 0xdefc, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xd6db, 0xc67a, 0xc67a, 0xce7a, 0xce7a, 0xce9a, 0xce9a, 0xce9b, 0xcebb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db,
0xdf1c, 0xdf1c, 0xdf1c, 0xdefb, 0xc659, 0xc639, 0xc659, 0xc659, 0xc65a, 0xc67a, 0xce7a, 0xce9a, 0xce9a, 0xce9a, 0xcebb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefc, 0xdefc, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdefb, 0xc67a, 0xc67a, 0xce7a, 0xce7a, 0xce9a, 0xce9a, 0xce9b, 0xcebb, 0xcebb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db,
0xdf1c, 0xdf1c, 0xdf1c, 0xce7a, 0xc659, 0xc659, 0xc65a, 0xc65a, 0xc67a, 0xce7a, 0xce7a, 0xce9a, 0xce9a, 0xcebb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c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db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xc659, 0xb5b7, 0xb5b7, 0xb5b7, 0xb5b7, 0xb5b7, 0xb5b7, 0xd6db, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc,
0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0x73af, 0x39e7, 0x39c7, 0x31a7, 0x31a6, 0x3186, 0x4229, 0xdefb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc, 0xdefc,
0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xd6db, 0x3a08, 0x39e7, 0x39c7, 0x31c7, 0x31a6, 0x3186, 0x8451, 0xdefb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xdefb, 0xdefb, 0xdefb, 0xdefc, 0xdefc,
0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xbdf7, 0x3a08, 0x39e7, 0x39c7, 0x39c7, 0x31a6, 0x31a6, 0xad96, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc,
0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0x94d3, 0x4208, 0x39e8, 0x39e7, 0x39c7, 0x31a7, 0x31a6, 0xce9a, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc,
0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xc659, 0xc639, 0xbe18, 0xbdf8, 0xbdf8, 0xbdf7, 0xb5d7, 0xb5d7, 0xb5d7, 0xb5d7, 0xb5d7, 0xce9a, 0xdefc, 0x632d, 0x4208, 0x39e8, 0x39e7, 0x39c7, 0x31c7, 0x630c, 0xdefc, 0xc679, 0xb5f7, 0xb5d7, 0xb5d7, 0xb5d7, 0xb5d7, 0xb5d7, 0xce9a, 0xd6bb, 0xbdf7, 0xbdf7, 0xbdf7, 0xbdf7, 0xbdf7, 0xbdf7, 0xc659, 0xdefc, 0xdefc,
0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6bb, 0x94d3, 0x5acb, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x4a8a, 0x4a8a, 0x4a69, 0x4a69, 0x4a49, 0xce7a, 0xce9a, 0x4228, 0x4208, 0x3a08, 0x39e7, 0x39c7, 0x39c7, 0x94d3, 0xdefb, 0x8431, 0x2966, 0x2965, 0x2945, 0x2945, 0x2124, 0x2124, 0xce9a, 0xb5b7, 0x18c3, 0x18c3, 0x18a3, 0x10a2, 0x10a2, 0x10a2, 0xad55, 0xdefc, 0xdefc,
0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0x8430, 0x4a8a, 0x4a8a, 0x528a, 0x52aa, 0x52aa, 0x52aa, 0x52aa, 0x4a8a, 0x4a8a, 0x4a8a, 0x4a69, 0x4a69, 0x632d, 0xdefc, 0xb596, 0x4228, 0x4208, 0x3a08, 0x39e7, 0x39c7, 0x39c7, 0xbdf7, 0xd6db, 0x4a69, 0x2986, 0x2965, 0x2945, 0x2945, 0x2124, 0x6b4d, 0xdefb, 0x8c92, 0x18e3, 0x18c3, 0x18a3, 0x10a2, 0x10a2, 0x10a2, 0xce79, 0xdefc, 0xdefc,
0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xbdf7, 0x4a69, 0x4a69, 0x4a69, 0x4a8a, 0x4a8a, 0x4a8a, 0x4a8a, 0x4a89, 0x4a69, 0x4a49, 0x4a49, 0x4249, 0x4228, 0x94b3, 0xdf1c, 0x8c72, 0x4228, 0x4208, 0x3a08, 0x39e7, 0x39e7, 0x39c7, 0xd6db, 0xc639, 0x3186, 0x3186, 0x2965, 0x2945, 0x2945, 0x2124, 0x9cf4, 0xdefb, 0x52ab, 0x18e3, 0x18c3, 0x18c3, 0x18a3, 0x10a2, 0x4a6a, 0xdefc, 0xdefc, 0xdefc,
0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6db, 0x8c51, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0x4a69, 0x4a69, 0x7c10, 0xd6bb, 0xdefc, 0xdefc, 0xdefc, 0xdf1c, 0xdf1c, 0xdf1c, 0xdefc, 0x52aa, 0x4228, 0x4208, 0x3a08, 0x39e7, 0x39e7, 0x73cf, 0xdefc, 0xa555, 0x3186, 0x3186, 0x2965, 0x2965, 0x2945, 0x2125, 0xbdf8, 0xce7a, 0x2104, 0x18e3, 0x18c3, 0x18c3, 0x18a3, 0x10a2, 0x8c72, 0xdefc, 0xdefc, 0xdefc,
0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xd6db, 0x4a6a, 0x4229, 0x4249, 0x4a49, 0x4a49, 0x4a69, 0x4a69, 0xad96, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xc659, 0x4228, 0x4228, 0x4208, 0x3a08, 0x39e7, 0x39e7, 0xa535, 0xdefc, 0x8410, 0x3186, 0x3186, 0x2965, 0x2965, 0x2945, 0x31a7, 0xd6db, 0xad76, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x18a3, 0x10a2, 0xb5b7, 0xdefc, 0xdefc, 0xdefc,
0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xbdf8, 0x4208, 0x4228, 0x4229, 0x4249, 0x4249, 0x4a49, 0x4a49, 0xce9a, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xa555, 0x4228, 0x4208, 0x4208, 0x39e8, 0x39e7, 0x39c7, 0xc659, 0xd6db, 0x4208, 0x3186, 0x3186, 0x2966, 0x2965, 0x2945, 0x7bef, 0xdefc, 0x8430, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x18a3, 0x1082, 0xd6ba, 0xdefc, 0xdefc, 0xdefb,
0xdefc, 0xdefb, 0xdefb, 0xdefb, 0x9cf3, 0x4208, 0x4208, 0x4228, 0x4228, 0x4228, 0x4229, 0x6b4d, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0x73cf, 0x4228, 0x4208, 0x3a08, 0x39e8, 0x39e7, 0x52aa, 0xdefc, 0xbe18, 0x31a6, 0x3186, 0x3186, 0x2966, 0x2965, 0x2945, 0xa555, 0xdefb, 0x39e7, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x18c3, 0x632d, 0xdefc, 0xdefb, 0xdefb, 0xdefc,
0xdefb, 0xdefb, 0xdefb, 0xdefc, 0x6b6d, 0x39e7, 0x3a08, 0x4208, 0x4208, 0x4228, 0x4228, 0x94d3, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xd6bb, 0x4228, 0x4208, 0x4208, 0x3a08, 0x39e7, 0x39e7, 0x8c92, 0xdefc, 0x9cf4, 0x31a6, 0x3186, 0x3186, 0x2966, 0x2965, 0x2945, 0xc659, 0xc618, 0x2104, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x18c3, 0x9cf3, 0xdefb, 0xdefb, 0xdefc, 0xdefc,
0xdefc, 0xdefc, 0xdefc, 0xd6bb, 0x39c7, 0x39e7, 0x39e7, 0x39e8, 0x3a08, 0x4208, 0x4208, 0xb5b7, 0xdefb, 0xdefb, 0xdefb, 0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xb5b7, 0x4208, 0x4208, 0x3a08, 0x39e8, 0x39e7, 0x39e7, 0xb5d7, 0xdefc, 0x632d, 0x31a6, 0x3186, 0x3186, 0x2965, 0x2965, 0x4a49, 0xdefc, 0x9d14, 0x2124, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x18c3, 0xbdf8, 0xdefb, 0xdefb, 0xdefb, 0xdefb,
0xdefc, 0xdefc, 0xdefc, 0xbdd7, 0x31c7, 0x39c7, 0x39c7, 0x39e7, 0x39e7, 0x39e8, 0x3a08, 0x8c92, 0xb5b7, 0xb5d7, 0xb5d7, 0xb5d7, 0xb5d7, 0xb5d7, 0xad96, 0x630c, 0x3a08, 0x3a08, 0x39e8, 0x39e7, 0x39e7, 0x4228, 0xd6db, 0xce7a, 0x31a6, 0x31a6, 0x3186, 0x3186, 0x2965, 0x2965, 0x8c51, 0xdefc, 0x738e, 0x2124, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x3186, 0xd6db, 0xdefb, 0xdefb, 0xdefb, 0xdefb,
0xdefc, 0xdefc, 0xdefc, 0xad76, 0x31a6, 0x31a7, 0x39c7, 0x39c7, 0x39c7, 0x39e7, 0x39e7, 0x39e7, 0x39e8, 0x3a08, 0x3a08, 0x3a08, 0x3a08, 0x3a08, 0x3a08, 0x3a08, 0x39e8, 0x39e7, 0x39e7, 0x39e7, 0x39c7, 0x94b2, 0xdf1c, 0x9d14, 0x31a6, 0x3186, 0x3186, 0x2986, 0x2965, 0x2965, 0xb596, 0xd6bb, 0x2945, 0x2124, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0x7bcf, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb, 0xd6fb,
0xdefc, 0xdefc, 0xdefc, 0xbdf7, 0x3186, 0x31a6, 0x31a6, 0x31a7, 0x39c7, 0x39c7, 0x39c7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39e7, 0x39c7, 0x52cb, 0xd6ba, 0xdefb, 0x52ab, 0x31a6, 0x3186, 0x3186, 0x2966, 0x2965, 0x2965, 0xce9a, 0xb5d7, 0x2124, 0x2124, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0xa535, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db,
0xdefc, 0xdefc, 0xdefc, 0xdefb, 0xa555, 0x6b4d, 0x4228, 0x39c7, 0x39c7, 0x39c7, 0x39c7, 0x39c7, 0x39c7, 0x39c7, 0x39c7, 0x39e7, 0x39e7, 0x39e7, 0x39e8, 0x4208, 0x4229, 0x52ab, 0x7bef, 0x9d14, 0xd6bb, 0xdf1c, 0xa535, 0x31a6, 0x3186, 0x3186, 0x3186, 0x2965, 0x2965, 0x738e, 0xdefb, 0x94b2, 0x2124, 0x2104, 0x2104, 0x20e4, 0x18e3, 0x18c3, 0xc659, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db,
0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefb, 0xdefb, 0xdefb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0xdefc, 0xdefc, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xb5b7, 0x39c7, 0x3186, 0x3186, 0x3186, 0x2966, 0x2965, 0x2965, 0xad76, 0xdefb, 0xce9a, 0xc679, 0xc659, 0xc659, 0xc659, 0xc659, 0xc659, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db,
0xdefc, 0xdefc, 0xdefc, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xdefc, 0xc659, 0xc659, 0xc639, 0xbe18, 0xb5b7, 0xa535, 0x6b8e, 0x31a6, 0x3186, 0x3186, 0x3186, 0x2966, 0x2965, 0x2965, 0x4228, 0xd6bb, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db,
0xdefc, 0xdefc, 0xdefc, 0xdefc, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6bb, 0x31a6, 0x31a6, 0x31a6, 0x31a6, 0x31a6, 0x31a6, 0x3186, 0x3186, 0x3186, 0x3186, 0x2966, 0x2965, 0x2965, 0x2945, 0xa535, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db,
0xdefc, 0xdefc, 0xdefc, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xb5b7, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x2966, 0x2965, 0x2965, 0x2965, 0x73ae, 0xd6db, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb,
0xdefc, 0xdefc, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6fb, 0x8c92, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x3186, 0x2966, 0x2966, 0x2965, 0x2965, 0x2965, 0x73cf, 0xd6bb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb,
0xdefc, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xdefc, 0x528a, 0x2966, 0x2966, 0x2966, 0x2966, 0x2966, 0x2965, 0x2965, 0x2965, 0x2965, 0x2986, 0x7bcf, 0xb5b6, 0xdefb, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6db, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0xd6bb, 0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f1c, 0xdf1c, 0xdf1c, 0xdf1c, 0xdefb, 0xd6fb, 0xd6db, 0xd6db, 0xd6db, 0xd6bb, 0xd6bb, 0xcebb, 0xce9a, 0xce9a, 0xce7a, 0xce7a, 0xc67a, 0xc65a, 0xc659, 0xc639, 0xc639, 0xbe39, 0xd6bb, 0xdf1c, 0xdf1c, 0xdf1c, 0xdf1c
};

316
mavic-mini-battery-info.ino Normal file
View File

@ -0,0 +1,316 @@
/*
thanks to
PowerCartel for smart battery routines - https://github.com/PowerCartel/PackProbe
Bodmer for fast TFT library - https://github.com/Bodmer/TFT_ST7735
Alain Aeropic - for BatMan inspiration - https://www.thingiverse.com/thing:4235767
*/
#define VERSION "v1.0"
#include <TFT_ST7735.h> // Graphics and font library for ST7735 driver chip
#include <SPI.h>
#include <Wire.h>
byte deviceAddress = 11;
// Standard and common non-standard Smart Battery commands
#define BATTERY_MODE 0x03
#define TEMPERATURE 0x08
#define VOLTAGE 0x09
#define CURRENT 0x0A
#define RELATIVE_SOC 0x0D
#define ABSOLUTE_SOC 0x0E
#define REMAINING_CAPACITY 0x0F
#define FULL_CHARGE_CAPACITY 0x10
#define TIME_TO_FULL 0x13
#define CHARGING_CURRENT 0x14
#define CHARGING_VOLTAGE 0x15
#define BATTERY_STATUS 0x16
#define CYCLE_COUNT 0x17
#define DESIGN_CAPACITY 0x18
#define DESIGN_VOLTAGE 0x19
#define SPEC_INFO 0x1A
#define MFG_DATE 0x1B
#define SERIAL_NUM 0x1C
#define MFG_NAME 0x20 // String
#define DEV_NAME 0x21 // String
#define CELL_CHEM 0x22 // String
#define MFG_DATA 0x23 // String
#define CELL4_VOLTAGE 0x3C
#define CELL3_VOLTAGE 0x3D
#define CELL2_VOLTAGE 0x3E
#define CELL1_VOLTAGE 0x3F
#define STATE_OF_HEALTH 0x4F
#define DJI_SERIAL 0xD8 // String
#define bufferLen 32
uint8_t i2cBuffer[bufferLen];
TFT_ST7735 tft = TFT_ST7735();
#include "dji_logo-48x48.h"
#define TFT_BACKGROUND 0xD6BB
void setup()
{
Serial.begin(115200);
Wire.begin();
Wire.setClock(100000);
tft.init();
tft.setRotation(0); // portrait
tft.fillScreen(TFT_BLACK);
drawIcon(dji_logo, (tft.width() - Width)/2, (tft.height() - Height)/2-40, Width, Height);
tft.setTextSize(1);
tft.setTextColor(TFT_BACKGROUND, TFT_BLACK);
tft.drawCentreString("Mavic Mini", 64, 68, 2);
tft.drawCentreString("battery info", 64, 90, 1);
tft.drawCentreString(VERSION, 64, 102, 1);
tft.drawCentreString("github.com/czipis", 64, 120, 1);
delay(3000);
tft.fillScreen(TFT_BACKGROUND);
}
uint8_t read_byte()
{
while (1)
{
if (Wire.available())
{
return Wire.read();
}
}
}
int fetchWord(byte func)
{
Wire.beginTransmission(deviceAddress);
Wire.write(func);
Wire.endTransmission(false);
delay(1);// FIX wire bug
Wire.requestFrom(deviceAddress, 2, true);
uint8_t b1 = read_byte();
uint8_t b2 = read_byte();
Wire.endTransmission();
return (int)b1 | ((( int)b2) << 8);
}
uint8_t i2c_smbus_read_block ( uint8_t command, uint8_t* blockBuffer, uint8_t blockBufferLen )
{
uint8_t x, num_bytes;
Wire.beginTransmission(deviceAddress);
Wire.write(command);
Wire.endTransmission(false);
delay(1);
Wire.requestFrom(deviceAddress, blockBufferLen, true);
num_bytes = read_byte();
num_bytes = constrain(num_bytes, 0, blockBufferLen - 2);
for (x = 0; x < num_bytes - 1; x++) { // -1 because x=num_bytes-1 if x<y; last byte needs to be "nack"'d, x<y-1
blockBuffer[x] = read_byte();
}
blockBuffer[x++] = read_byte(); // this will nack the last byte and store it in x's num_bytes-1 address.
blockBuffer[x] = 0; // and null it at last_byte+1
Wire.endTransmission();
return num_bytes;
}
#define BUFF_SIZE 64
void drawIcon(const unsigned short* icon, int16_t x, int16_t y, int8_t width, int8_t height) {
uint16_t pix_buffer[BUFF_SIZE]; // Pixel buffer (16 bits per pixel)
// Set up a window the right size to stream pixels into
tft.setAddrWindow(x, y, x + width - 1, y + height - 1);
// Work out the number whole buffers to send
uint16_t nb = ((uint16_t)height * width) / BUFF_SIZE;
// Fill and send "nb" buffers to TFT
for (int i = 0; i < nb; i++) {
for (int j = 0; j < BUFF_SIZE; j++) {
pix_buffer[j] = pgm_read_word(&icon[i * BUFF_SIZE + j]);
}
tft.pushColors(pix_buffer, BUFF_SIZE);
}
// Work out number of pixels not yet sent
uint16_t np = ((uint16_t)height * width) % BUFF_SIZE;
// Send any partial buffer left over
if (np) {
for (int i = 0; i < np; i++) pix_buffer[i] = pgm_read_word(&icon[nb * BUFF_SIZE + i]);
tft.pushColors(pix_buffer, np);
}
}
void loop()
{
uint8_t length_read = 0;
Serial.print("Manufacturer Name: ");
length_read = i2c_smbus_read_block(MFG_NAME, i2cBuffer, bufferLen);
Serial.write(i2cBuffer, length_read);
Serial.println("");
Serial.print("Device Name: ");
length_read = i2c_smbus_read_block(DEV_NAME, i2cBuffer, bufferLen);
Serial.write(i2cBuffer, length_read);
Serial.println("");
Serial.print("Chemistry ");
length_read = i2c_smbus_read_block(CELL_CHEM, i2cBuffer, bufferLen);
Serial.write(i2cBuffer, length_read);
Serial.println("");
Serial.print("Manufacturer Data: ");
length_read = i2c_smbus_read_block(MFG_DATA, i2cBuffer, bufferLen);
Serial.write(i2cBuffer, length_read);
Serial.println("");
Serial.print("Design Capacity: " );
Serial.println(fetchWord(DESIGN_CAPACITY));
Serial.print("Design Voltage: " );
Serial.println(fetchWord(DESIGN_VOLTAGE));
Serial.print("Manufacture Date (D.M.Y): " );
String formatted_date;
int mdate = fetchWord(MFG_DATE);
int mday = B00011111 & mdate;
int mmonth = mdate >> 5 & B00001111;
int myear = 1980 + (mdate >> 9 & B01111111);
formatted_date += mday;
formatted_date += ".";
formatted_date += mmonth;
formatted_date += ".";
formatted_date += myear;
Serial.println(formatted_date);
int str_len = formatted_date.length() + 1;
char mfg_date[str_len];
formatted_date.toCharArray(mfg_date, str_len);
Serial.print("Serial Number: ");
length_read = i2c_smbus_read_block(DJI_SERIAL, i2cBuffer, bufferLen);
char *djiserial = i2cBuffer;
Serial.println(djiserial);
Serial.print("Specification Info: ");
Serial.println(fetchWord(SPEC_INFO));
Serial.print("Cycle Count: " );
uint8_t cycles = fetchWord(CYCLE_COUNT);
Serial.println(cycles);
Serial.print("Voltage: ");
float voltage = (float)fetchWord(VOLTAGE) / 1000;
Serial.println(voltage);
Serial.print("Full Charge Capacity: " );
Serial.println(fetchWord(FULL_CHARGE_CAPACITY));
Serial.print("Remaining Capacity: " );
Serial.println(fetchWord(REMAINING_CAPACITY));
Serial.print("Relative Charge(%): ");
uint8_t charge = fetchWord(RELATIVE_SOC);
Serial.println(charge);
Serial.print("Absolute Charge(%): ");
Serial.println(fetchWord(ABSOLUTE_SOC));
Serial.print("Minutes remaining for full charge: ");
Serial.println(fetchWord(TIME_TO_FULL));
Serial.print("Cell 1 Voltage: ");
float cell1 = (float)fetchWord(CELL1_VOLTAGE)/1000;
Serial.println(cell1);
Serial.print("Cell 2 Voltage: ");
float cell2 = (float)fetchWord(CELL2_VOLTAGE)/1000;
Serial.println(cell2);
char buffer[5];
String v = dtostrf(voltage, 4, 2, buffer);
String c1 = dtostrf(cell1, 4, 2, buffer);
String c2 = dtostrf(cell2, 4, 2, buffer);
String cells = v + " " + c1 + '/' + c2;
str_len = cells.length() + 1;
char cellsV[str_len];
cells.toCharArray(cellsV, str_len);
Serial.print("State of Health: ");
Serial.println(fetchWord(STATE_OF_HEALTH));
Serial.print("Battery Mode (BIN): 0b");
Serial.println(fetchWord(BATTERY_MODE), BIN);
Serial.print("Battery Status (BIN): 0b");
Serial.println(fetchWord(BATTERY_STATUS), BIN);
Serial.print("Charging Current: ");
Serial.println(fetchWord(CHARGING_CURRENT));
Serial.print("Charging Voltage: ");
Serial.println(fetchWord(CHARGING_VOLTAGE));
Serial.print("Temp: ");
unsigned int tempk = fetchWord(TEMPERATURE);
float temp = tempk / 10.0 - 273.15;
Serial.println(temp);
Serial.print("Current (mA): " );
Serial.println(fetchWord(CURRENT));
Serial.println(".");
drawIcon(dji_logo, (tft.width() - Width)/2, 0, Width, Height);
tft.setTextSize(1);
tft.setTextColor(TFT_BLACK, TFT_BLACK);
tft.drawString("SERIAL", 3, 54, 1);
tft.drawRightString(djiserial, 126, 54, 1);
tft.drawString("PRODUCED", 3, 54+15, 1);
tft.drawRightString(mfg_date, 126, 54+15, 1);
tft.drawString("CYCLES", 3, 54+30, 1);b
tft.drawNumber(cycles, 45, 54+30, 1);
tft.drawString("TEMP", 70, 54+30, 1);
tft.fillRect(102, 54+30 , 25, 10, TFT_BACKGROUND);
tft.drawFloat(temp, 1, 102, 54+30, 1);
tft.drawString("VOLTS", 3, 54+45, 1);
tft.fillRect(40, 54+45 , 87, 10, TFT_BACKGROUND);
tft.drawRightString(cellsV, 126, 54+45, 1);
unsigned int batt_width = 110;
unsigned int batt_height = 20;
tft.drawRect(tft.width()/2 - batt_width/2, 130 , batt_width, batt_height, TFT_BLACK);
tft.drawRect(tft.width()/2 + batt_width/2 - 1 , 130+batt_height/4 , 5, batt_height/2, TFT_BLACK);
uint16_t color = TFT_RED;
if (charge > 25) color = TFT_ORANGE;
if (charge > 50) color = TFT_YELLOW;
if (charge > 75) color = TFT_DARKGREEN;
tft.fillRect(tft.width()/2 - batt_width/2 + 5, 130 + 2 , charge, batt_height-4, color);
String pct = String(charge) + '%';
str_len = pct.length() + 1;
char p[str_len];
pct.toCharArray(p, str_len);
tft.drawString(p,54,132, 2);
delay(1000);
}