Open leon-thomm opened 2 years ago
Consider this repo for ideas on peak detection
Added a small lib and external dependency to read basic data from MPU in 27638096f1961866e9d02c6caa5ef555f46369e9. Tested on 3.3V, values are okay and can be read quite frequently, but sometimes the sensor gets stuck (especially in z direction).
temperature sensor (guide, wiring for S
and -
seems flipped)
Implemented reading from analog temperature sensor directly in 20974c4b1b2e0eee16f8f815b49685a849204a09. Added ADC spport in f8a072e1d7f0c6c5fe924e7241e062e21b3045d9. The temperature sensor runs on 3.3V and should, by default, be connected to A1 of the ADC.
photo resistor (guide, wiring for S
and -
seems flipped)
Implemented reading from analog photo resistor directly in e1e8b2c254c16c891ab76e92f59e71a6674a9d9b. Added ADC support in 92b6be58ceb9619613eb73ddeebe5eb99cf404c0.
ADC
Since we are using multiple analog sensors, we need to use the ADC. I implemented simple reading from the ADC's channels in 971878cba817169953d74b67a5f45610a8692bee.
I2C
In order to use the ADC and MPU we need to use I2C. I implemented a script to conveniently scan the devices and addresses in 23f0d00a102f17df13f99ea0fc1d3d87f5d67cf0 and 0ca4c731d78dced9a1880477c9a70e8bf0d50547.
TODO: we pre-assign different addresses I2C addresses to the ADC and MPU.
I2C
TODO: we pre-assign different addresses I2C addresses to the ADC and MPU.
The MPU and the ADC are natively using different addresses. The ADC's address can also easily be changed by applying different voltages to the addr
pin.
ADC
I switched to a library because manually configuring it caused a bunch of issues - I could not correctly select channels and had depressing timing constraints.
temperature sensor
The temperature seems quire imprecise is a few °C off. We should check with the prof on the formula we used, but it assumes very specific constants derived from the sensor's built-in resistors, and I don't know if this is accurate for our exact temperature sensor. While it didn't seem super accurate, if a constant error in temperature of 1-3°C is not a big deal, we can just go with this. Changing this later (after starting to collect data), however, will not be an option.
The glued sensor seems broken - maybe the glue is too hot?
photo resistor
The glued sensor works fine.
Test out MPU9250 (Gyro + Accelorometer + Compass)