Build it step by step
0 of 7 doneBuild the filter
1 kilohm from D9 to the capacitor, the capacitor to GND.
Wire the volume pot
Top to the filter junction, bottom to GND, middle to the amplifier input.
Wire the amplifier and speaker
5V and GND, speaker on its output.
Turn the pot right down
Then upload the sketch.
Raise the volume slowly
A soft hiss appears.
Press the button
Steps to a softer sound and then a rumble.
Keep it quiet
And well away from your ear.
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
Wiring
| From | To | Why |
|---|---|---|
| Nano D9 | 1 kilohm resistor to one end of the 100 nF capacitor | Random pulses into the filter |
| Capacitor other end | Nano GND | Smooths the pulses into noise |
| Resistor and capacitor junction | Top leg of the volume pot | Filtered noise |
| Pot bottom leg | Nano GND | Ground |
| Pot middle leg | Amplifier module IN | Volume control |
| Amplifier module VCC and GND | Nano 5V and GND | Power |
| Amplifier module output | Small speaker | The sound |
| Mode button | Nano D2 and GND | Cycles 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.
| Check | Expected |
|---|---|
| Mode 1 | Bright hiss |
| Mode 2 | Softer noise |
| Mode 3 | Low rumble |
| Pot | Sets the volume |
| Filter capacitor | Removes 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 →
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.
