With an assembled chassis, it felt like progress was being made, but that was until we reviewed what was left to do and became very nervous…
The design incorporates 5 Time of Flight sensors which I have discussed before: https://polidroid.co.uk/2020/03/12/sens-or-plight/. Whilst getting one working was an enjoyable challenge, given my lack of experience working with the I2C bus on the the Pi and the lack of knowledge base on Windows IoT, getting multiple sensors working when their default address is shared proved to be far more challenging – and not in the fun way – in the “tear out any remaining hair I have” way :).
Obviously before we could get started on the code, we needed to get multiple sensors connected up, we opted for JST connectors on the devices wired back to a small hub which allowed us to share the I2C pins through the main connection into each sideDrive, along with a GPIO output wired to each device’s XSHUT pin which is used to hold the device in an off state whilst the address of the powered on device is changed.
So we were connected and I had my code working for a single VL53L0X, what could be so hard about adding another 4, right?
Fancy a couple of bytes?
Wrong! As I mentioned above, as these are small devices, there are no contact tabs on the PCB to solder for an address change like with the larger boards, they all have the same address on power-up, so need to be changed in code each time in order to distinguish between the stream of data they output to the bus.
A bit of a Google turned up this very helpful post to the show the concept, but as we have established, we like to do things the hard way, so had to figure out how to get that to work on Windows IoT.
First off we figured out the correct GPIO output state to use for the XSHUT pin so we could shut down all devices, we then needed to bring each one back online, set it’s address and move on to the next one until we had created our entire array of sensors.
It’s fair to say that we were stuck in a loop trying to get the command which sets the address to work… Two simple bytes which needed to be sent to the device in order to sets it’s new address – they were the most frustratingly insignificant pieces of data which for me, as it would turn out, ended up producing one of the biggest, most satisfying Yesss moments of the entire build.
Don’t look down
In addition to the Time of Flight array and the Vision Container, we wanted to give our little creation another field of view to help it with automated driving. Even though we opted not to use it in the competition, we included the a line following assembly as part of opticDock as seen below.
As seen above, we made the bespoke wiring along with an expansion board in the piHelm which allowed us to easily connect the I2C devices, the SPI connection and the various sets of GPIO pins used for all the vision based sensors.
146 total views, 2 views today