December 06, 2017 / by Sergey Kapustin

Ir Noise Capacitor And Power

After connecting an infrared sensor to my Arduino, I noticed that an ultrasonic sensor, which is connected to the same board, started reporting inconsistent measurements. The investigation took me a few hours, but now I know better to pay attention to the power requirements for electronic components.

In this post, I’ll share the steps I took to resolve the issue.

On YouTube

Analysis

When only the ultrasonic sensor is connected, the measurements it reports are fairly stable and the power line trace looks clean.

Clean

Good measurements:

1
2
3
4
5
data: 22
---
data: 22
---
data: 22

Once IR sensor is connected, the ultrasonic sensor starts reporting inconsistent values. The 5-volt VCC from Arduino shows very noisy pattern:

Noisy

Bad measurements:

1
2
3
4
5
6
7
8
# The data is output every second without physically moving
# ultrasonic sensor or an object in front:

data: 12
---
data: 43
---
data: 86

After connecting a 12-volt battery to the barrel connector, the noise seems to decrease just slightly:

Noisy

The internet search led me to a discussion on reddit that suggested to use a capacitor on the power supply line. Indeed, the data sheet for Sharp IR sensor also suggests the same thing. The data sheet for MaxBotix ultrasonic sensor also talks about the requirement for clean power supply:

Pin 6-+5V- Vcc – Operates on 2.5V - 5.5V. Recommended current capability of 3mA for 5V, and 2mA for 3V.

Pin 7-GND- Return for the DC power supply. GND (& Vcc) must be ripple and noise free for best operation.

Having only a 47uF polarized capacitor, I connected it to my junction strip between VCC and ground. The noise has subsided when compared to the previous result:

Good

The output from the sensor is stable and back to normal:

1
2
3
4
5
data: 22
---
data: 22
---
data: 22

There is still some amount of noise that ideally I would like to minimize. I’ll try it when I get a bigger ceramic capacitor than the tiny ones I currently have.

Noisy IR discussion

Related Posts

December 18, 2017

Adc Auto Trigger Median Filter Analysis

Have you thought of how to filter the data coming from an analog sensor? In this post, I describe:

  • Problem with sensor measurements
  • Way to auto-trigger analog data collection
  • Median and mean filter application
  • Analysis of sample data

December 04, 2017

Ultrasonic Sensor Range Update

MaxSonar sensor can continuously update my Arduino program with the range values. Instead of writing serial, blocking polls to get the sensor’s data, I let the sensor push it to the Arduino.

November 27, 2017

Ros Arduino Integration

ROS has good messaging system that uses publisher/subscriber model. My project requires an Arduino to talk to a ROS network. Rosserial for Arduino exists to enable such communication. My previous attempt to use rosserial on Atmega168 was not successful due to 1 kilobyte SRAM limit on the Atmega. This time, I will use Atmega2560 with 8 kilobytes of SRAM.