Sensor options for MCUs

February 1, 2018 Jeremy Cook, Engineering Consultant

Arduino boards and the like are amazing devices. For just a few dollars, they can take in a number of inputs, process them at millions of cycles per second, and produce outputs in a variety of forms. But where do you get this input data? While these boards can respond to serial inputs from a computer, to really take advantage of MCUs and their associated development boards, you need an array of sensors. This article will outline some of the most common devices available, as well as how they can be applied

IR emitter/receiver

[This emitter/receiver pair is separated to sense the lack of signal when an object comes between them. Image via Adafruit]

In this sensing setup, an IR emitter sends out infrared light, while a receiver photodiode converts this light into an input. While used for remote control in television sets and other types of consumer electronics, these devices also work quite well for robotic sensing applications, where the emitter sends light out, and the receiver detects whether it is reflected off of an object in front of it. One can construct a sensor using individual emitters/receivers, or packages are available with the emitter/receiver already assembled in different applications.

Passive infrared (PIR)

[A sensor module with the lens on (left) and off (right)]

Passive infrared sensors detect the change in radiation in the environment, and are commonly used in security systems, where a human’s movement can set them off. For those wishing to use this sensor type in their own projects, modules appropriate for MCU use can be found at reasonable prices. These generally include both the sensor, a board that does processing for a discreet on/off output, and the lens which changes the range and sensing pattern of the device. This tutorial is a good reference if you’d like more insight into these devices, and if you’d like to see a project example, I used one with an infinity mirror prop seen here.

Photoresistor or light-dependent resistor (LDR)

Perhaps the simplest sensing method available, LDRs change resistance based on the amount of light they absorb. When combined with a MCU, these can be used for simple light-following robots, or can even be used in applications like a puzzle that responds audibly or visually when pieces are added or removed. Given their simplicity, they can be found for just a few cents each, making them great options for budget projects.

Ultrasound sensor

Similar in some ways to how an IR emitter/Rrceiver pair can detect light bouncing off of an object, ultrasound sensors detect sound reflecting off of a distant object. These devices, however, add the ability to measure the distance to the object that sound is bouncing off of by calculating the time it takes for the signal to return. Besides pure distance measurement, these devices can be used in other creative ways, such as measuring air flow.

Temperature/humidity sensor

[DHT11 temperature/humidity module. Image via Adafruit]

While temperature sensors can be found on their own in the form of a TO-92 package, a very popular option is the DHT11 temperature/humidity module pictured above. Conveniently, this sensor module outputs data in a digital form, allowing you to monitor the environment without using an analog pin on your MCU.

Any of these devices can be used with a MCU to control other devices directly, but they also integrate quite well as end nodes in a larger network. For example, perhaps you need to monitor and run a weather station or stations near your house. MCU with the correct associated hardware can not only run the station, but collect data, process it as needed before sending it on. One might do the same with PIR/MCU setups, taking in area movement data and only passing it along to “the cloud” under conditions that would represent an unauthorized entry.

Jeremy S. Cook is a freelance tech journalist and engineering consultant with over 10 years of factory automation experience. An avid maker and experimenter, you can see his exploits on the Jeremy S. Cook YouTube Channel

Previous Article
Take our reader survey, win a $50 Amazon gift card

It only takes a few minutes and you'll help our team deliver relevant and engaging content.

Next Article
Extra hardware needed to get started with the Raspberry Pi Zero
Extra hardware needed to get started with the Raspberry Pi Zero

First off, the Pi Zero doesn’t use a standard HDMI connector, or even RCA-style outputs, but needs a mini-H...