Build a Low‑Cost Arduino Particle Counter: A Step‑by‑Step DIY Guide

Ever wonder how the air quality sensor on your phone works, or why a lab‑grade particle counter costs more than a weekend getaway? The truth is, the core idea is simple physics—counting tiny bits of dust as they pass a light beam. In this post I’ll show you how to turn an Arduino, a few cheap parts, and a dash of curiosity into a working particle counter that can help you see the invisible world around you. It’s a perfect project for anyone who loves a good experiment but doesn’t want to break the bank.

Why a DIY Particle Counter Matters

Air quality is a hot topic right now, from wildfires to indoor pollution. Knowing how many particles are in a room can guide you to open a window, add a filter, or simply understand why your allergies flare up. Commercial devices are accurate but pricey. By building your own, you get three things: a learning experience, a tool you can tweak, and a budget‑friendly way to keep an eye on the air you breathe.

What You Need

Below is the minimal list of parts. All of them can be found on common electronics sites or even in a local hobby shop.

  • Arduino Uno (or any compatible board) – the brain of the project.
  • Infrared LED (5 mm) – creates the light beam.
  • Photodiode or IR phototransistor – detects the light that makes it through.
  • Laser pointer (optional) – gives a tighter beam for better sensitivity.
  • 220 Ω resistor – limits current to the LED.
  • 10 kΩ resistor – forms a pull‑up for the photodiode.
  • Breadboard and jumper wires – for quick assembly.
  • 3D‑printed or laser‑cut housing – keeps the LED and detector aligned (you can also use a simple cardboard tube).
  • USB cable – to power the Arduino and upload code.

If you already have an Arduino lying around, the total cost can be under $15.

How It Works in Plain Language

A particle counter uses a principle called light scattering. When a particle passes through a narrow beam of light, it blocks or scatters some of that light. The detector sees a brief dip in the signal, which we count as one particle. The Arduino reads the voltage from the detector many times per second, looks for those dips, and tallies them.

Think of it like watching raindrops on a window. Each drop creates a tiny dark spot that moves across the glass. If you could record the light that passes through, each spot would show up as a short dip in brightness. Our circuit does exactly that, only with dust instead of rain.

Wiring the Circuit

1. LED side

  1. Connect the anode (long leg) of the IR LED to the 5 V pin on the Arduino through a 220 Ω resistor.
  2. Connect the cathode (short leg) directly to GND.

2. Detector side

  1. Connect the collector of the photodiode (or the middle pin of a phototransistor) to 5 V through a 10 kΩ resistor.
  2. Connect the emitter to GND.
  3. Tap the junction between the photodiode and the 10 kΩ resistor and wire it to A0 (analog input) on the Arduino.

3. Power and safety

Make sure the LED is not wired directly to 5 V without the resistor—otherwise it will burn out quickly. Double‑check all connections before plugging the board into your computer.

Building the Housing

Alignment is the secret sauce. If the LED and detector are too far apart, the beam spreads and you lose sensitivity. If they’re too close, the detector may see the LED’s own glow.

  1. Cut a short piece of PVC pipe (about 2 cm long) or print a simple two‑piece holder that snaps together.
  2. Drill a tiny hole for the LED on one side and a matching hole for the detector on the opposite side.
  3. Insert the components so the LED faces the detector directly.
  4. Seal any gaps with black tape to block stray light.

I printed a housing on my home 3‑D printer for a previous project, and the result was surprisingly sturdy. If you don’t have a printer, a piece of cardboard rolled into a tube works fine—just make sure it’s dark inside.

The Arduino Sketch

Below is a minimal sketch that reads the analog signal, detects dips, and prints a particle count every second. Feel free to copy it into the Arduino IDE and upload it.

const int sensorPin = A0;          // analog input from photodiode
const int threshold = 300;         // adjust based on ambient light
unsigned long lastPrint = 0;
int particleCount = 0;
int lastValue = 1023;              // start high (no light blocked)

void setup() {
  Serial.begin(9600);
  pinMode(sensorPin, INPUT);
}

void loop() {
  int value = analogRead(sensorPin);

  // Detect a dip: value drops below threshold and then rises again
  if (value < threshold && lastValue >= threshold) {
    particleCount++;
  }
  lastValue = value;

  // Print count once per second
  if (millis() - lastPrint >= 1000) {
    Serial.print("Particles per second: ");
    Serial.println(particleCount);
    particleCount = 0;
    lastPrint = millis();
  }
}

Tweaking the Threshold

The threshold value depends on how bright your LED is and how dark the surrounding room is. Run the sketch, watch the serial monitor, and adjust the number until you see a steady baseline with occasional spikes when you wave a piece of dust or a tiny piece of tissue across the beam.

Calibrating Your Counter

A true lab instrument would be calibrated with known particle sizes, but for most hobbyist needs a simple relative measurement is enough.

  1. Zero the baseline – run the device in clean filtered air and note the “particles per second” reading.
  2. Introduce a known source – for example, lightly blow a puff of smoke from a match. The count should jump noticeably.
  3. Record the change – this gives you a sense of how many particles correspond to a visible event.

If you need more precise data, you can add a second photodiode to measure the intensity of the dip, which correlates with particle size. That’s a fun extension for later.

Common Pitfalls and How to Fix Them

  • Ambient light leaks – stray sunlight or room lights can swamp the detector. Paint the housing interior black or use a narrow tube to keep only the LED’s beam inside.
  • Noise spikes – electrical noise can look like a dip. Adding a small capacitor (0.1 µF) across the detector’s power pins smooths things out.
  • LED overheating – if you run the LED continuously for hours, it may get warm. Adding a small heat sink or pulsing the LED (turn it on only when reading) reduces heat.

Next Steps: Adding a Display or Data Logger

Once you’re comfortable with the basic count, you can attach a small OLED screen to show the number in real time, or log the data to an SD card for later analysis. Both upgrades are inexpensive and fit nicely on the same breadboard.

I once added a 0.96‑inch OLED to a particle counter I built for a school workshop. Watching the numbers scroll while kids waved around glitter was pure joy—and a great way to spark curiosity about air quality.

Wrap‑Up

Building a low‑cost Arduino particle counter is a hands‑on way to explore light scattering, electronics, and data analysis—all with a budget that won’t scare the accountant. The project is modular, so you can start simple and grow it into a more sophisticated sensor suite. Most importantly, you’ll end up with a tool that lets you see the invisible dust that’s always buzzing around us.

Happy building, and may your air be as clear as your data!

Reactions