Cool Stuff
September 11, 2024

Object detection sensors to use on your next build (2024)

Written by
Sara Gharnit
Senior Content Marketer

Whether you’re an experienced engineer optimizing a factory setup or a maker building your first smart home gadget, picking the right sensor for object detection is crucial. The right choice can lead to a smooth project, while the wrong one could leave you with more headaches than solutions.

With so many options—LiDAR, RGB cameras, thermal imaging, depth sensing, and more—the choices can feel overwhelming. But don’t worry, we’re here to make it easier. 

In this guide, we’ll:

  • Break down everything you need to know to choose the perfect sensor.
  • Walk you through the different types available.
  • Share some of our top picks for your next project.

Let’s dive in!

What is a detection sensor?

Think of detection sensors as the "eyes" of machines. These sensors capture data from their surroundings, allowing systems to identify objects, track movement, and make decisions based on what they "see."

Main purpose

Detection sensors gather information from the physical world—whether it’s light, distance, temperature, or another measurable attribute—and convert it into a form that a computer can understand.

Picture a security system with motion sensors: they detect movement by picking up changes in infrared light, then convert that data into signals the system uses to respond, like triggering an alarm when someone walks by.

A security system, using Viam’s object detection capabilities, identifies a person at the front of a building.

Common applications

Chances are, you've already interacted with detection sensors, whether you realized it or not. Think about those motion-activated lights in your backyard that turn on when someone walks by—that’s detection sensors at work.

A car’s front camera detects cars on the road, as seen in the Viam app interface.
A car’s front camera detects cars on the road, as seen in the Viam app interface.

These versatile sensors power a wide range of everyday applications, including:

  • Autonomous vehicles: Sensors collaborate to detect obstacles, pedestrians, and other vehicles, ensuring safe navigation and decision-making.
  • Industrial automation: Sensors monitor production processes, ensuring quality control by identifying defects and irregularities in real-time.
  • Security systems: Sensors are used for surveillance, detecting unauthorized access, and monitoring premises, even in varying lighting conditions.
  • Consumer electronics: Detection sensors are integrated into smart home devices to recognize faces, detect motion, and automate tasks like adjusting lighting.

Different types of detection sensors

Just like how we rely on multiple senses to better understand the world, detection sensors work together to identify and track objects in their environment. Choosing the right sensor for your object detection needs means considering how these technologies can complement one another to deliver the best results.

Let’s explore the different types of detection sensors and how each one can level up your object detection system.

RGB cameras

These versatile cameras, found in everything from smartphones to industrial robots, capture images using the red, green, and blue (RGB) color spectrum—the three primary colors of light. 

An Intel RealSense camera is two detection sensors in one: an RGB and depth camera.
An Intel RealSense camera is two detection sensors in one: an RGB and depth camera.

If you’ve ever seen a color wheel, you know how those three colors blend to create the entire spectrum of hues we see. This blending allows an RGB camera to produce full-color images.

Advantages

RGB cameras capture high-resolution images with accurate color reproduction, making them ideal for tasks like image recognition and classification. They’re affordable, widely available, and compatible with most computer vision (CV) models, allowing for easy integration into existing systems.

Limitations

However, RGB cameras rely on good lighting conditions and can struggle in low light or inconsistent environments. They provide only 2D images, lacking depth perception, which limits their ability to measure distance. 

Reflections, glare, and occlusions can also reduce detection accuracy, making them less effective for complex or outdoor settings.

Consider using for 

  • Real-time video capture and analysis: Many RGB cameras support fast frame rates, making them great for real-time video capture and analysis.
  • Non-complex environments: Perfect for controlled indoor spaces with consistent lighting.
  • Applications requiring color: Ideal for tasks like sorting items by color or traffic sign recognition, where color detection is crucial.
  • General object detection: Suitable for basic tasks like face recognition, item counting, or object classification, where depth perception isn’t required.

Depth cameras 

Depth cameras capture 3D information, enabling systems to understand the spatial relationship between objects. They measure the distance between the camera and objects using methods like:

  • Time-of-Flight (ToF), which calculates how long light takes to return.
  • Stereo vision, which compares two images to determine depth.
  • Structured light, which tracks how projected patterns distort when they hit objects.
Like the Intel RealSense, an Oak-D camera is two detection sensors in one product: an RGB and depth camera.
Like the Intel RealSense, an Oak-D camera is two detection sensors in one product: an RGB and depth camera.

Let’s imagine this in action: In a warehouse, a depth camera can detect objects, like boxes on a conveyor belt, and calculate their exact positions relative to robotic arms. This allows the robots to accurately pick up and move items without collision, optimizing the flow of operations by understanding how objects are arranged in 3D space.

Advantages

Whether it's guiding robots or detecting obstacles, depth cameras provide more spatial information than standard 2D cameras. They shine in dynamic environments, handling varying object sizes and complex shapes with ease, making them a go-to for applications like autonomous vehicles, augmented reality, and warehouse automation.

Limitations

Depth cameras can be pricier than RGB cameras and require more processing power, which might affect overall system performance. They also struggle in low-light conditions or on highly reflective surfaces, where depth perception can get a bit tricky. 

Long-range detection and objects that are partially blocked can also be challenging for these cameras, so consider distance and obstructions when using depth cameras.

Consider using for 

  • Precise spatial awareness: Perfect for applications needing 3D understanding, like robotic navigation and manipulation.
  • Obstacle detection and avoidance: Ideal for environments where spotting the distance and size of obstacles is crucial, such as in autonomous vehicles or drones.
  • Varying object sizes and complex shapes: Depth cameras capture the 3D structure of objects of all shapes and sizes with accuracy.
  • Warehouse automation: Great for detecting, placing, and retrieving items in automated logistics systems with precision.
  • Augmented reality: Enhances AR experiences by accurately aligning virtual elements with the real world.
  • Dynamic multi-object environments: Excels at tracking multiple moving objects and their spatial relationships in real-time.

3D LiDAR

LiDAR sensors, widely used in everything from self-driving cars to topographical mapping, rely on laser pulses to measure distances and create detailed 3D maps of their surroundings. 

The hardware of an RPLiDAR.
The hardware of an RPLiDAR.

Think of it like shining a flashlight in the dark—except LiDAR uses laser beams instead of light, bouncing them off objects to calculate exact distances. This creates a highly accurate model of the environment, ideal for systems that need precise spatial awareness.

Advantages

LiDAR is known for its exceptional accuracy, even over long distances. It excels in low-light or difficult conditions and is especially effective outdoors. 

With its ability to provide precise depth information, LiDAR is a top choice for autonomous vehicles, robotics, and mapping, where understanding the 3D layout of a space is critical.

3D LiDAR output of a hallway in the Viam office, as seen in the Viam app interface (source). 
3D LiDAR output of a hallway in the Viam office, as seen in the Viam app interface (source). 

Limitations

LiDAR cameras are typically more expensive than other sensor types, and their hardware can be more bulky and complex. 

They may struggle with detecting objects in highly reflective or transparent surfaces, and processing the data they generate requires significant computational power.

Consider using for

  • Obstacle detection and navigation: Ideal for real-time detection and navigation across a variety of environments.
  • 3D mapping: Great for creating detailed 3D representations of areas and objects over long distances.
  • Low-light or harsh weather environments: Performs reliably in conditions where visibility is poor.
  • Complex environments: Provides accurate depth information for navigating spaces with various objects and obstacles.
  • Precision measurement tasks: Useful for applications requiring high-accuracy distance measurements and spatial data tracking.

Thermal cameras

Thermal cameras excel in situations where light isn’t available, allowing them to "see" in complete darkness or through low-visibility conditions like fog, smoke, or dust. 

A thermal camera showing the differences in temperature of a house.
A thermal camera showing the differences in temperature of a house.

They can detect temperature differences, making them ideal for identifying people, animals, or machinery overheating. Thermal cameras are especially useful when visual data is blocked or unavailable, providing critical information based on heat signatures.

Advantages

Thermal cameras detect heat rather than light, allowing them to "see" in complete darkness and perform well in low-visibility conditions such as fog, smoke, or dust. 

They can identify temperature differences, making them highly effective for detecting living beings, machinery overheating, or other heat-related anomalies.

Limitations

On the downside, thermal cameras don’t capture detailed color or visual information, relying on heat-based images. This can make it difficult to identify objects or fine details when there’s little temperature contrast.

For example, in a crowded area where everyone’s body temperature is relatively similar, a thermal camera may struggle to distinguish between individuals, as it relies on heat differences rather than facial features or clothing to identify people.

An example of how thermal cameras struggle to identify who is who. 
An example of how thermal cameras struggle to identify who is who. 

They are also typically more expensive than RGB cameras, and their accuracy can be impacted by reflective surfaces or extreme environmental factors.

Consider using for

  • Nighttime surveillance: Detecting activity in complete darkness.
  • Low-visibility environments: Effective in conditions where traditional cameras struggle, such as darkness, smoke, or fog.
  • Heat monitoring: Ideal for applications where detecting temperature changes is important, like identifying overheating or heat loss.
  • Broad detection needs: Useful when visual clarity isn’t necessary but temperature patterns are key to understanding the environment.

What factors should be considered when choosing a sensor for object detection?

Selecting the right sensor for object detection is all about finding the perfect fit for your project's unique needs. With a wide range of options available, it’s important to strike a balance between performance, environment, and budget.

Whether you’re building a real-time system for traffic management or a simple pet-monitoring device, understanding key factors like frame rate, resolution, and environmental conditions will help you make an informed decision. 

Here are some important things to keep in mind as you explore your options:

Frame rate

Think about how frequently your application needs to capture images. Real-time systems, like monitoring traffic flow, demand a high frame rate to keep up with the action. On the other hand, a project like tracking your pet’s movement around the house can rely on occasional snapshots without missing much.

Resolution

Higher resolution means more detail, but it also comes with a greater need for processing power. If your goal is to pick out fine details, like reading text on a document, you’ll want a high-resolution camera. But for simpler tasks, like checking if a plant is wilting, a lower resolution will do the job just fine.

Proximity

The distance between the sensor and the objects you’re detecting is crucial. Self-driving cars, for example, require both high frame rates and a combination of sensors, like LiDAR, to get a full 360-degree view in real time. For closer or simpler tasks, you can afford to go with fewer or less sophisticated sensors.

Environment

Lighting conditions

The lighting in your environment will directly affect how well your sensor performs. RGB cameras are great for well-lit spaces, but in low-light settings, you might need infrared or thermal cameras to get the job done. 

Keep in mind that while thermal cameras are perfect for detecting heat in the dark, they don’t offer the detailed visual information that RGB cameras provide.

Weather

Outdoor projects face additional challenges. Look for weather-resistant sensors that can handle rain or harsh sunlight, and consider fixed-focus cameras to avoid autofocus issues caused by changing conditions.

Cost

Sensor costs can vary widely. For basic hobby projects, a simple webcam might be all you need. But for more complex applications, like robotics or autonomous vehicles, it’s worth investing in higher-end options like depth cameras or LiDAR to ensure top performance.

Now that you know what to look for, let’s dive into the different types of sensors and how they can help bring your object detection project to life.

What are some object detection cameras to consider using?

Now that we’ve walked you through different types of detection sensors and what to consider when choosing one, let’s highlight some of our engineers' top picks. 

These cameras can be configured with Viam in 5 minutes or less:

Intel RealSense

  • Type: RGB + depth Camera
  • Why we like it: The Intel RealSense captures 3D images and offers precise depth information, making it a go-to for projects that require an understanding of object distances.
  • Best for: Robotics applications where depth perception is crucial, like autonomous navigation. It’s especially useful for tasks that require robots to navigate through environments filled with obstacles, adjust to changing terrain, or handle complex interactions with surrounding objects. Its ability to deliver real-time depth sensing makes it perfect for ensuring accurate movements and avoiding collisions in dynamic environments.

To use the Intel RealSense with Viam, configure its module on your device.

The “realsense” module found in the Viam Registry.
The “realsense” module found in the Viam Registry.

Oak-D camera

  • Type: RGB + depth Camera
  • Why we like it: Similar to the RealSense, the Oak-D offers solid 3D imaging and depth perception, but at a more competitive price point. Its ability to handle precise distance measurement makes it a reliable choice.
  • Best for: Versatile scenarios like sidewalk navigation and stationary robots. It excels in applications that require depth awareness but are more stationary or slower-moving, such as indoor mapping, smart retail solutions, or smaller robotics setups. It’s also a great choice for autonomous systems in controlled environments where real-time object detection and spatial mapping are essential for navigation.

To use the Oak-D camera with Viam, configure its module on your device.

The “oakd1” module found in the Viam Registry.
The “oakd1” module found in the Viam Registry.

Webcams

  • Type: USB camera—generally found in laptops such as the MacBook.
  • Why we like it: Webcams are affordable, easy to use, and widely available. While they lack advanced features like depth perception, they’re perfect for basic object detection tasks.
  • Best for: DIY home automation projects where ease of integration and cost-effectiveness are more important than advanced 3D capabilities. They work well for beginners or those experimenting with object detection in controlled environments like a home or workshop.

To use your computer’s webcam with Viam, simply follow the instructions within our documentation.

A webcam configuration within the Viam app.
A webcam configuration within the Viam app.

Build your own object detection device today

Building your own object detection device can be an exciting and fulfilling challenge, whether you're designing a simple smart home solution or diving into a complex robotics project. 

Begin by choosing the right sensor for your needs, experiment with basic models to test functionality, and slowly integrate it into your system as you refine the design. With the right resources and a little know-how, you’ll be able to turn your concept into a fully functional object detection system.

Tutorials featuring machine learning found within Viam's documentation.

Ready to dive deeper into object detection? Check out our image classification guide, dive deeper into ML with our object detection guide, explore our YOLO model real-time object detection guide, or try out one of our hands-on tutorials using our (free!) app to get started.

Technically reviewed by: Khari Jarrett

On this page

Get started with Viam today!