Pololu Robotics & Electronics
My account Comments or questions? About Pololu Contact Ordering information Distributors

Pololu Forum

Background Infrared

Hi, sorry if this is quite an obvious one but I am trying to get a QTR-3A reflectance sensor to measure the background infrared using QTR_EMITTERS_OFF I was hoping someone could show me an example of code for running this.


Do you have the one of our second generation QTR sensor arrays, like the QTR-HD-03A or the QTR-MD-03A, or do you have the older QTR-3A?

If you are using the older QTR array then it is not going to be possible to ready the sensors while the emitters are disabled. If you are using one of the newer boards, could you post a diagram showing how you are wiring your sensor and your code so far?

- Patrick

Hi Patrick, thank you for the reply.

Unfortunately, I am using a QTR-3A.

The project for which I am using this sensor looks to differentiate between coloured surfaces using reflectance and hence I was planning on measuring the background infrared for calibration to achieve better colour classification, are there any approaches you would suggest that will be viable with the QTR-3A sensor, for reading the background infrared?

Or alternatively if there is an approach that you have come across before that you could suggest as an alternative for improving colour differentiation with the QTR-3A sensor? (I know using a reflectance sensor is not the most logical approach to this task, but we are experimenting to see how accurately the reflectance can be used for colour classification)

Thank you again for your reply

These sensors might not be a great tool for distinguishing colors, so I would suggest spending some time characterizing whether you are able to get different enough readings for each color in all of the lighting conditions you plan to operate in. Our newer QTR sensors which allow you to control the emitter brightness would give you some flexibility to tune your particular system and possibly increase the range of readings your sensors report across your range of colors.

- Patrick

Hi Patrick,
thanks again for getting back to me.

So specifically what I am try to achieve is just a low level ability to separate between 4 colours. Which can be interpreted by the romi as a direction to travel.

From initial analysis the sensors should be able to differentiate there is just a level of variability between readings that I was hoping could be corrected by adjusting for background infrared. Do you have any ideas how I could improve the colour classification with the simpler QTR-3A model - maybe through improving the consistency // accuracy of readings somehow. I have already planned to integrate averaging values over multiple readings but was hoping to add something more technical.

Any improvement at all would be great.
Thank you again

Since you cannot turn off the emitters to measure background infrared you might consider doing everything you can to minimize the amount of external infrared light the sensors are exposed to, such as by making sure you keep your sensors the optimal distance away from your target surface (about 3mm) and shielding your sensors from ambient light.

- Patrick