Week 09. Input Devices
Let's look at some sensors and see how we can use them to interact with our project.

Assignment
Group Assignment (link):
Probe an input device's analogue levels and digital signals
Individual assignment:
Measure something: add a sensor to a microcontroller board
that you have designed and read it
Adding a sensor to a microcontroller board and measuring it
Useful links for this week
DFRobot wiki page for the MPU-6050 6-Axis Gyroscope and Accelerometer Sensor DF Robot shop link to MPU-6050 6-Axis Gyroscope and Accelerometer Sensor adafruit 9DoF BNO085 IMU F Board produced in week 8
Most of this week was dedicated to finishing my Fab board (I did briefly call it my F'in board, but it has since reclaimed its proper name).
I decided to use an accelerometer and gyroscope sensor this week as I figured I would be needing it in my final project.
I also used a module that was readily available in the Creative Spark Industry Fab Lab, that was the DF Robot MPU-6050 6 DOF Sensor (Breakout).

I had issues getting this sensor to work with the Seed XIAO RP2040 board and my Fab board. so at this point I decided to get the Adafruit BNO085 IMU
so back to the MPU6040 - i decided to get this one up and arunnning as there maybe issues wiht the BN085 working with the XIAO ESP32 board.
follow this link to download the libraries for the MPU6050 MPU6050 library However its not that straight forward as I found out - you need to download the enitre repo from this link - extract - and navagate to your desired library - So Follow this link https://github.com/jrowberg/i2cdevlib and download the repo - extract - and navagate to the MPU6050 foldersome missing libriaries in processing folloiwed this link to get answers - https://forum.processing.org/two/discussion/19409/where-is-toxi-geom-i-can-not-find-it-anyware.html
Downloaded the toxiclibs from the following link -
toxiclibsScreatch all that - I've gone back to the BNO085 as I will be using the XIAO RP2040 and the MPU6040 seemed to have considerable drift when using it.
I was "vibe coding" using Cursor AI to generate some test code to test the BNO085 with the XIAO RP2040 - See prompt below worth noting the AI has context and is aware of the components i'm using - this prompt came later in the converstaoin

See code below


video of the code running -
The first code produced results in the serial monitor however I wanted to visulise using serial plotter.
I went back to Cursor AI to ask how this could be achieved - see updated code below.


video of the code running -
Issues I've encountered
AGHHHHH!
what went wrong.

what went wrong.
Learning Outcomes

This week's key learning outcomes:
- Successfully implemented IMU sensors (BNO085 and MPU-6050) with microcontrollers
- Mastered sensor data visualisation using Arduino's Serial Plotter
- Developed troubleshooting skills for sensor integration
- Gained practical experience in sensor selection and library management
Code structure and how the types of flow required - I will need to explore more of this, but this week has given me a good grounding.
I have a good grounding in the Arduino IDE and have a good understanding of the code structure and how the types of flow required.