One of my tasks for the autonomous robot project was to design and build a IR sensor array that could “sense” ewoks, gaps, black lines, and obstacles on the competition surface. This was the final design that we used on our robot.

The array circuit consists of the ADS7828 ADC (courtesy of Texas Instruments), eight IR LEDs and photo-transistors, and accompanying circuitry. The entire sensor array connects to an I2C bus through two parallel JST connectors, which means that the sensor array has the capability of being daisy-chained. This proved to be a fantastic feature, as one iteration of our robot required 4 arrays, and was only accessible though one connector.

Electronics

IRSensorArray

Main schematic of the board. Some of the specific wording of the ADC and how it uses the reference was not very clear, so I kept my options open by providing multiple ways of utilizing the reference.

irblock-Block 0


Fairly simple repeated array block.

sensorarray


Here is the layout of the PCB. Very simple 2 layer board. Hardest part was squeezing everything into a size that would cost the least.

array


3D KiCad model. I love 3D preview!

Software

I also had to write a library for the sensor array that could be used by our main processor board (an STM32 development board running the Arduino framework). The library I wrote in C++ contains basic functions for connecting to the array, but also some statistic functions, such as weighted mean, inverse weighted mean, and others. These functions were helpful in writing algorithms to made decisions based off what the sensors are seeing.

You can find the software I wrote, as well as all of the hardware files in the repository: https://github.com/Arrakark/IRSensorArray