QTRX-MD-08RC Reflectance Sensor Array: 8-Channel, 8mm Pitch, RC Output, Low Current (POLOLU-4348)

This is a placeholder topic for
“QTRX-MD-08RC Reflectance Sensor Array: 8-Channel, 8mm Pitch, RC Output, Low Current”
comments.



This array of IR LED/phototransistor pairs is great for precisely identifying changes in reflectance (like line detection). It operates from 2.9 V to…

Read more

1 Like

Dear Core experts,
I purchased a group of QTRX-MD-08RC IR arrays from Pololu for a small robot project. I have read all the accompanying material and datasheets but remain unclear as to how to best get the data to and from my uC. I am using an ST32 Nucleo board, programming in C, with a Cube IDE. Do the outputs of the sensor, which are a decay time of the voltage need to be handled by a Timer on the uC? How best to handle an array of 3x3 sensors spaced over 60x60mm, to differentiate black on white symbols to guide the robot?
Not sure the AVR code files are applicable to my uC.
Thanks
Michael

3 Likes

Hi Chestcutter,

I had a read of the Pololu docs, and they are nice!

I think you’re right in steering clear of the AVR code (and its associated hefty standard Arduino library)

I’d say timers would definitely be the go here. I’ve dabbled with them on the Arduino before, but I haven’t had the chance to work with STM32s yet.

“Input Capture” might be a keyword that’ll help, but I wish I’d worked with your hardware myself so I could go deeper into this one!

Maybe someone else has more experience with the Nucleo/Cube ecosystem?

-James

2 Likes

Hi Michael,

It’s been years since I’ve used my STM32 Nucleo board and worked at the HAL level with timers but I think I can outline what it’s going to take to get that sensor running with an STM32 device.

The overall process is outlined well in Pololu’s documentation
image
You are going to need 1 timer for each sensor you want to monitor and since you’ve got multiple timers it’s best to configure them with interrupts so that when your interrupt triggers, a function you write will measure the time taken for the pin logic level to fall to zero.
You’ll also need a timer to handle the 10µs delay that’s mentioned.

The easiest way to set up all these timers will be to use STM32 CubeMX which is their initialization code generator. You’ll still need to write the program flow and handle the interpretation of the timing results.

In summary, this is going to be a lot more involved than just using the Arduino libraries with an Arduino board. You will have to do everything from scratch using the documentation available.

Can you share a bit more about what this robot project is for and why you chose the STM32 Nucleo over an Arduino?

2 Likes