Material Measurement Device
Materials
- Adafruit Trinket M0 - $9
- .9" I2C OLED Display - $3
- Hall effect Sensor - $2
- Magnets!
- Perfboard
- Repurposed Lithium Battery - $0
- Charge/Discharge IC $2
- USB breakout board
"Unique pad capabilities Digital #0 / A2 - this is connected to PA08 on the ATSAMD21. This pin can be used as a digital I/O with selectable pullup or pulldown, analog input (use 'A2'), PWM output, and is also used for I2C data (SDA) Digital #1 / A0 - this is connected to PA02 on the ATSAMD21. This pin can be used as a digital I/O with selectable pullup or pulldown, capacitive touch, analog input (use 'A0'), and true analog (10-bit DAC) output. It cannot be used as PWM output. Digital #2 / A1 - this is connected to PA09 on the ATSAMD21. This pin can be used as a digital I/O with selectable pullup or pulldown, analog input (use 'A1'), PWM output, and is also used for I2C clock (SCL), and hardware SPI MISO Digital #3 / A3 - this is connected to PA07 on the ATSAMD21. This pin can be used as a digital I/O with selectable pullup or pulldown, analog input (use 'A3'), capacitive touch, PWM output, and is also used for UART RX (Serial1 in Arduino), and hardware SPI SCK Digital #4 / A4 - this is connected to PA06 on the ATSAMD21. This pin can be used as a digital I/O with selectable pullup or pulldown, analog input (use 'A4'), capacitive touch, PWM output, and is also used for UART TX (Serial1 in Arduino), and hardware SPI MOSI"
Vout=Vbat×R1+R2R2=Vbat×100k+330k330k=Vbat×0.767
Pseudocode, but insert real values of R1 & R2 from DMM: