Projects / Soft noise box

Soft noise box

Beginner1.2 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANO

    Build the filter

    1 kilohm from D9 to the capacitor, the capacitor to GND.

  2. NANO

    Wire the volume pot

    Top to the filter junction, bottom to GND, middle to the amplifier input.

  3. NANO

    Wire the amplifier and speaker

    5V and GND, speaker on its output.

  4. NANO

    Turn the pot right down

    Then upload the sketch.

  5. NANO

    Raise the volume slowly

    A soft hiss appears.

  6. NANO

    Press the button

    Steps to a softer sound and then a rumble.

  7. NANO

    Keep it quiet

    And well away from your ear.

In short

How do you build a soft noise box?

A Nano makes random on-off pulses, a resistor and capacitor smooth them into a soft hiss, and a small amplifier module plays it quietly through a speaker. A knob sets the volume and a button picks between a bright hiss and a duller rumble. Keep the volume low and the speaker away from your ear. You need Arduino Nano, Resistor 1 kΩ, Ceramic Capacitor 100 nF, Potentiometer 10 kΩ, LM386 amplifier module, Speaker 8 Ω 0.5 W, Tactile push button 6 mm, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm). It takes 7 steps and about 70 minutes.

Level
Beginner
Time
About 70 min
Parts
9

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
Nano D91 kilohm resistor to one end of the 100 nF capacitorRandom pulses into the filter
Capacitor other endNano GNDSmooths the pulses into noise
Resistor and capacitor junctionTop leg of the volume potFiltered noise
Pot bottom legNano GNDGround
Pot middle legAmplifier module INVolume control
Amplifier module VCC and GNDNano 5V and GNDPower
Amplifier module outputSmall speakerThe sound
Mode buttonNano D2 and GNDCycles hiss, soft and rumble

Code

Noise is a signal with no pattern. The sketch runs a 16-bit shift register with feedback, which makes a long sequence of ones and zeros that looks random, and sets pin D9 high or low from it. A 1 kilohm resistor and a 100 nanofarad capacitor turn that into a smoothed hissing signal, with a cut-off near 1.6 kilohertz. The time that each pulse lasts decides the sound: short pulses make a bright hiss, and long pulses make a duller, rumbling noise. The button steps through three settings. The pot sets the volume, and the amplifier module drives a small speaker. Start with the pot turned right down and increase it slowly, keep the sound quiet, and keep the speaker away from your ear, particularly for babies and pets, as steady noise at a high volume can harm hearing. The amplifier module's input is meant for line-level signals, so the pot lets you keep the sound gentle. This is a simple noise maker for focus or sleep and is not a medical device. Try adding a second capacitor to make a softer sound, or a timer that fades it out after thirty minutes.

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

const uint8_t OUT_PIN = 9;
const uint8_t BTN = 2;

// How long each random pulse is held, in microseconds. Shorter pulses make a brighter hiss.
const unsigned int INTERVALS[3] = {64, 250, 1000};
uint8_t mode = 0;

uint16_t lfsr = 0xACE1;                    // a 16-bit random bit generator
bool prevBtn = false;
unsigned long lastStep = 0;
uint16_t count = 0;

void setup() {
  pinMode(OUT_PIN, OUTPUT);
  pinMode(BTN, INPUT_PULLUP);
  lastStep = micros();
}

void loop() {
  unsigned long now = micros();
  if (now - lastStep >= INTERVALS[mode]) {
    lastStep += INTERVALS[mode];
    uint16_t bit = ((lfsr >> 0) ^ (lfsr >> 2) ^ (lfsr >> 3) ^ (lfsr >> 5)) & 1;
    lfsr = (lfsr >> 1) | (bit << 15);
    digitalWrite(OUT_PIN, lfsr & 1);       // random high or low
    count++;
    if ((count & 0xFF) == 0) {             // look at the button now and then, so timing stays steady
      bool b = (digitalRead(BTN) == LOW);
      if (b && !prevBtn) mode = (mode + 1) % 3;
      prevBtn = b;
    }
  }
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Mode 1Bright hiss
Mode 2Softer noise
Mode 3Low rumble
PotSets the volume
Filter capacitorRemoves harsh buzzing

If it does not work

Only a buzz

Check the filter capacitor is fitted between the junction and GND.

No sound

Check the amplifier power and the speaker wires.

Too loud

Turn the pot down and check you have the pot in the signal path.

Hiss is too harsh

Add a second capacitor in parallel.

Button does nothing

Check it goes to D2 and GND.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the soft noise box?

Arduino Nano, Resistor 1 kΩ, Ceramic Capacitor 100 nF, Potentiometer 10 kΩ, LM386 amplifier module, Speaker 8 Ω 0.5 W, Tactile push button 6 mm, Breadboard 830 Tie Points and Jumper wires male to male (40 pcs, 20 cm).

How long does the soft noise box take to build?

About 70 minutes for a beginner maker, in 7 steps.

How do I know the soft noise box works?

Mode 1: Bright hiss. Mode 2: Softer noise. Mode 3: Low rumble.

Only a buzz: what should I check?

Check the filter capacitor is fitted between the junction and GND.

No sound: what should I check?

Check the amplifier power and the speaker wires.

Too loud: what should I check?

Turn the pot down and check you have the pot in the signal path.

Hiss is too harsh: what should I check?

Add a second capacitor in parallel.