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

**URL:** <https://forum.core-electronics.com.au/t/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current-pololu-4348/13683>\
**Category:** Product Questions\
**Created:** [6 April 2022 06:00 UTC](https://forum.core-electronics.com.au/t/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current-pololu-4348/13683 "2022-04-06T06:00:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Core](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/core/32/57_2.png) [@Core](https://forum.core-electronics.com.au/u/Core)\
**Post date:** [6 April 2022 06:00 UTC](https://forum.core-electronics.com.au/t/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current-pololu-4348/13683/1 "2022-04-06T06:00:19Z")

</div>

This is a placeholder topic for [  
 **“QTRX-MD-08RC Reflectance Sensor Array: 8-Channel, 8mm Pitch, RC Output, Low Current”** ](https://core-electronics.com.au/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current.html) comments.  
  
 ![](https://core-electronics.com.au/media/catalog/product/cache/5ba536955e3e815f4e908e49c1dd8155/i/m/image_7428.jpg)  
  
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**](https://core-electronics.com.au/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current.html)

---

<div class="post-metadata">

**Author:** ![chestcutter](https://avatars.discourse-cdn.com/v4/letter/c/e95f7d/32.png) [@chestcutter](https://forum.core-electronics.com.au/u/chestcutter)\
**Post date:** [6 April 2022 06:00 UTC](https://forum.core-electronics.com.au/t/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current-pololu-4348/13683/2 "2022-04-06T06:00:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![James](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/james/32/4400_2.png) [@James](https://forum.core-electronics.com.au/u/James)\
**Post date:** [7 April 2022 01:40 UTC](https://forum.core-electronics.com.au/t/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current-pololu-4348/13683/3 "2022-04-07T01:40:23Z")

</div>

Hi Chestcutter,

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

> **[Pololu - 2. RC-type sensor output (intended for digital I/Os)](https://www.pololu.com/docs/0J13/2)**
>
> Information about using the Pololu QTR reflectance sensors, including differences between A-type and RC-type sensors and sample oscilloscope screen captures of sensor outputs.

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

---

<div class="post-metadata">

**Author:** ![Trent5487676](https://yyz2.discourse-cdn.com/flex028/user_avatar/forum.core-electronics.com.au/trent5487676/32/4583_2.png) [@Trent5487676](https://forum.core-electronics.com.au/u/Trent5487676)\
**Post date:** [8 April 2022 05:31 UTC](https://forum.core-electronics.com.au/t/qtrx-md-08rc-reflectance-sensor-array-8-channel-8mm-pitch-rc-output-low-current-pololu-4348/13683/4 "2022-04-08T05:31:03Z")

</div>

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.

> [@chestcutter](#):
>
> Do the outputs of the sensor, which are a decay time of the voltage need to be handled by a Timer on the uC?

The overall process is outlined well in Pololu’s documentation  
 ![image](https://canada1.discourse-cdn.com/flex028/uploads/core_electronics/original/2X/8/84cc2bad539302f20e672733239ed0f3918ec534.png)  
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](https://www.st.com/en/development-tools/stm32cubemx.html) 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?
