Week 8
08 Input Electronics
DISTANCE SENSOR
For this week I wanted to do a time of flight (ToF) sensor for my final project. In the final project a ToF sensor will regulate stimulation frequency.
With the Devkit out of the way I went ahead and started designing the ToF board with Fusion 360. When done milling it, I found that the pin traces were too compact (they were all connected) for the component to work. With most time having been spent this week on designing the SAMD21 devkit board, I had to fold it for this week.
I came back later to this week's assignment during my final project week. Here, I bought the Sparkfun VL53L5CX ToF component. Reading the datasheet, I found that the sensor needed to plugin to a SCL and SDA compatible pin on my board. In the final project, I was using an ESP32 microcontroller with the SDA being on the 21 pin and SCL on the 22. pin.
I then went into the ARDUINO IDE to get the component to read distance information. For that, I found this ESP32 implementation that I based my code on. With my modified version of the code, I was able to measure the distance pretty neatly.