Does anyone know where I can find SensESP code for a magnetometer...
Specifically the Adafruit LSM6DSOX + LIS3MDL board connected to a FireBeetle WROOM-32E
Sending it all to SignalK running on a Victron Cerbo-GX
I have looked all over the interweb but can't find anything specific.
Thanks in advance
Bob
5 Replies
Are you trying to create an electronic compass or something else?
https://learn.adafruit.com/lsm6dsox-and-ism330dhc-6-dof-imu/arduino
It’s a basic sketch. You need to port it into the sensesp framework but there are tons of examples on how to dot that
Yes, a digital compass
IMO, the downside to an IMU combo like LSM6DSOX + LIS3MDL is that they need to be manually calibrated. In my experience, this is a bit difficult and error-prone. I prefer the BNO08X IMU for a boat compass. There's a variant called CMPS14 (based on same IMU) and a github repo to send the data to N2K: https://github.com/htool/ESP32_Precision-9_compass_CMPS14
If your Cerbo is connected to the N2K backbone, you can transmit heading as an N2K message and then any other instruments (such as autopilot or chartplotter) can pick it up from the network. If your Cerbo is not connected to N2K, that would be a good reason to use sensesp, but as @Tony mentioned, you would need to modify the digital compass code to use SensESP, and there are lots of good examples. You will probably be writing a single path navigation.headingTrue.
There are good tutorials for using Arduino libraries in SensESP.
E.g.
https://signalk.org/SensESP/pages/tutorials/bmp280/
https://signalk.org/SensESP/pages/tutorials/bmp280_part_2/