Some decent progress has been made since the last blog post. See the image of the breadboard below which shows the current state of the electronics:
The small blue pcb with the four mounting holes is the BNO55 breakout board from adafruit. The vertical standing pcb is a serial bluetooth adapter and the green pcb on the far right is a teensy 3.6. The whole thing is powered by 4AAA batteries because I’m intending to put this on the end of a rotating stick and don’t want power cables getting in the way.
The Teensy communicates with the BNO55 via I2C and also can send serial data via one of it’s UART ports which is connected to the bluetooth serial link.
At the moment I’ve got some euler values streaming via bluetooth serial to my computer as an initial test:
I had a motor in my parts bin that has a built-in gearbox and a good amount of torque. The issue was connecting the shaft of the motor to the rotating arm. In the end a laser cut bracket made out of acrylic did the job and allowed me to make a good connection between the motor shaft and the rotating arm as seen here:
The rotating arm is 1.5 metres in length, that seemed to be about the longest the motor could handle and it also fits in my room which is nice. For testing that the motor had enough torque I taped 100g weights to either end of the arm and thankfully the motor was still able to rotate the arm without too much difficulty. See the video below for the rotating arm in action:
As you can see from the video, the speed of the arm is not constant as it rotates around. When the arm is vertical or approaching vertical the law of the lever makes things a bit easier on the motor so it is able to accelerate a bit, when the arm is horizontal that is the hardest part of the cycle for the motor and so the arm slows down. This isn’t an issue and it probably is a closer analogue to a data buoy on a wave than if the acceleration was kept constant all the way around.
The end goal is to have the breadboard circuit with the batteries, bluetooth adapter, teensy and BNO55 attached to the rotating arm. The one detail that will require extra attention is that the electronics need to stay more or less horizontal as the arm rotates. This will require some kind of mount that can rotate freely and has a bit of weight towards the bottom so as the arm rotates the mount stays horizontal. Having the electronics rotate with the arm would make the IMU calculations way more difficult. I’m not saying it’s impossible, it would just add a layer of complication that is totally unnecessary for the current application. Once the electronics is mounted to the arm I can start thinking about how to approach the software for the project. My thoughts at the moment are that it might be easier to get the raw IMU data for a couple of rotations, store that in a CSV file on my computer and try to develop some algorithms using that data. Once I get something working on the PC I can then go back and try to run it on the microcontroller. I think this approach will be fastest but I’ll give it more thought over the next few days.