Silicon ChipDigital white noise generator - September 2018 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Streaming will make broadcast television obsolete
  4. Feature: Augmented GNSS promises accuracy down to mm! by Dr David Maddison
  5. Project: Dipole guitar/PA speaker without a box! by Allan-Linton Smith
  6. Project: Digital white noise generator by John Clarke
  7. Project: Steam loco or diesel engine sound effects module by John Clarke
  8. Subscriptions
  9. ElectroneX Feature by Ross Tester
  10. Product Showcase
  11. Serviceman's Log: The aircon that nearly made me lose my cool by Dave Thompson
  12. Project: Add wireless remote to your motorised garage door by Design by Branko Justic; words by Ross Tester
  13. Project: Super sound effects module – Part 2 by Tim Blythman & Nicholas Vinen
  14. Feature: El Cheapo modules Part 19 – Arduino NFC Shield by Jim Rowe
  15. Review: PICkit 4 in-circuit programmer by Tim Blythman
  16. Vintage Radio: The Ekco Gondola RM 204 Mantel Radio by Associate Professor Graham Parslow
  17. PartShop
  18. Market Centre
  19. Notes & Errata: Wide-range Digital LC Meter, June 2018; Notebook: Low-cost Automotive Ammeter, June 2018; El Cheapo Modules 16 – ADF4351 4.4GHz DCO, May 2018; 6GHz+ Touchscreen Frequency Counter, October-December 2017
  20. Advertising Index
  21. Outer Back Cover: Hare & Forbes MachineryHouse

This is only a preview of the September 2018 issue of Silicon Chip.

You can view 53 of the 112 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Items relevant to "Dipole guitar/PA speaker without a box!":
  • Panel artwork for the Dipole Guitar Speaker (Free)
Items relevant to "Digital white noise generator":
  • PIC12F617-I/P programmed for the White Noise Generator [0910618A.HEX] (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the White Noise Source and Steam Train Whistle/Diesel Horn [0910618A/M.HEX] (Software, Free)
Items relevant to "Steam loco or diesel engine sound effects module":
  • Steam Train Whistle / Diesel Horn PCB [09106181] (AUD $5.00)
  • PIC12F617-I/P programmed for the White Noise Generator [0910618A.HEX] (Programmed Microcontroller, AUD $10.00)
  • PIC12F617-I/P programmed for the Steam Train Whistle/Diesel Horn [0910618M.HEX] (Programmed Microcontroller, AUD $10.00)
  • Pair of PIC12F617-I/P chips for the Steam Train Whistle/Diesel Horn [0910618A/M.HEX] (Programmed Microcontroller, AUD $15.00)
  • TDA7052AT 1.1W audio amplifier IC (SOIC-8) (Component, AUD $3.00)
  • Firmware (ASM and HEX) files for the White Noise Source and Steam Train Whistle/Diesel Horn [0910618A/M.HEX] (Software, Free)
Items relevant to "Super sound effects module – Part 2":
  • Super Digital Sound Effects PCB [01107181] (AUD $2.50)
  • PIC32MM0256GPM028-I/SS programmed for the Super Digital Sound Effects Module [0110718A.hex] (Programmed Microcontroller, AUD $15.00)
  • Firmware (C and HEX) files for the Super Digital Sound Effects Module [0110718A.HEX] (Software, Free)
Articles in this series:
  • Miniature, high performance sound effects module (August 2018)
  • Miniature, high performance sound effects module (August 2018)
  • Super sound effects module – Part 2 (September 2018)
  • Super sound effects module – Part 2 (September 2018)
Items relevant to "El Cheapo modules Part 19 – Arduino NFC Shield":
  • Software for El Cheapo Modules: NFC Shield (Free)
Articles in this series:
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 1 (October 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 2 (December 2016)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules From Asia - Part 3 (January 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules from Asia - Part 4 (February 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 5: LCD module with I²C (March 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 6: Direct Digital Synthesiser (April 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules, Part 7: LED Matrix displays (June 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo Modules: Li-ion & LiPo Chargers (August 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo modules Part 9: AD9850 DDS module (September 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules Part 10: GPS receivers (October 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 11: Pressure/Temperature Sensors (December 2017)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 12: 2.4GHz Wireless Data Modules (January 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 13: sensing motion and moisture (February 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 14: Logarithmic RF Detector (March 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 16: 35-4400MHz frequency generator (May 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo Modules 17: 4GHz digital attenuator (June 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo: 500MHz frequency counter and preamp (July 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El Cheapo modules Part 19 – Arduino NFC Shield (September 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 20: two tiny compass modules (November 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El cheapo modules, part 21: stamp-sized audio player (December 2018)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 22: Stepper Motor Drivers (February 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules 23: Galvanic Skin Response (March 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Class D amplifier modules (May 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: Long Range (LoRa) Transceivers (June 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • El Cheapo Modules: AD584 Precision Voltage References (July 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • Three I-O Expanders to give you more control! (November 2019)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: “Intelligent” 8x8 RGB LED Matrix (January 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • El Cheapo modules: 8-channel USB Logic Analyser (February 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules (May 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • New w-i-d-e-b-a-n-d RTL-SDR modules, Part 2 (June 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital Volt/Amp Panel Meters (December 2020)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: Mini Digital AC Panel Meters (January 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: LCR-T4 Digital Multi-Tester (February 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD chargers (July 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: USB-PD Triggers (August 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 3.8GHz Digital Attenuator (October 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 6GHz Digital Attenuator (November 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: 35MHz-4.4GHz Signal Generator (December 2021)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • El Cheapo Modules: LTDZ Spectrum Analyser (January 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • Low-noise HF-UHF Amplifiers (February 2022)
  • A Gesture Recognition Module (March 2022)
  • A Gesture Recognition Module (March 2022)
  • Air Quality Sensors (May 2022)
  • Air Quality Sensors (May 2022)
  • MOS Air Quality Sensors (June 2022)
  • MOS Air Quality Sensors (June 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • PAS CO2 Air Quality Sensor (July 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Particulate Matter (PM) Sensors (November 2022)
  • Heart Rate Sensor Module (February 2023)
  • Heart Rate Sensor Module (February 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • UVM-30A UV Light Sensor (May 2023)
  • VL6180X Rangefinding Module (July 2023)
  • VL6180X Rangefinding Module (July 2023)
  • pH Meter Module (September 2023)
  • pH Meter Module (September 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 1.3in Monochrome OLED Display (October 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 16-bit precision 4-input ADC (November 2023)
  • 1-24V USB Power Supply (October 2024)
  • 1-24V USB Power Supply (October 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 0.91-inch OLED Screen (November 2024)
  • 14-segment, 4-digit LED Display Modules (November 2024)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • The Quason VL6180X laser rangefinder module (January 2025)
  • TCS230 Colour Sensor (January 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)
  • Using Electronic Modules: 1-24V Adjustable USB Power Supply (February 2025)

Purchase a printed copy of this issue for $10.00.

WHITE NOISE GENERATOR This white noise generator is very simple and cheap to build and produces white noise which does not repeat over any short time frame. It has a variety of uses, as explained below. A white noise signal has equal intensity at all frequencies in the band of interest; for example, 20Hz-20kHz for audio. It’s the hissing sound that you hear if you tune an analog FM radio to a frequency on which there is no transmission. There are many reasons why you may want a white noise signal. For example, you can use white noise to drown out external noises that may interfere with your sleep. If that dripping tap is keeping you awake, don’t count sheep; try a low-volume white noise source with a speaker close to your bed. We can attest: it works wonders! It’s especially effective at helping babies get to sleep since they are used to hearing somewhat similar sounds in the womb. It can also be used to help treat (or at least mask) tinnitus (a persistent ringing sound heard in the ears when there is no sound present). White noise sources can be used to measure the bandwidth or impulse response of a circuit and to check room acoustics or optimise a PA system. They are also used in analog audio synthesisers to help produce the “ssshhhh” sound of various percussion instruments such as hi-hats, snare drums and cymbals. Generating white noise There are several ways to generate white noise. For example, if you reverse-bias a zener diode or transistor emitter-base junction (ie, the baseemitter reversed) with a low DC current level, an AC voltage will appear across it and this will have a white noise characteristic. 32 Silicon Chip This IC is not available any more but with modern components, we can make an even better digital noise source. An even better white noise source Fig.1: the “circuit” could hardly be simpler because everything is done in software within the PIC12F617-I/P. Noise output is taken from pin 7, while a 100nF capacitor bypasses the supply (pins 1 and 8) – pins 2, 3, 5 and 6 are not connected. But the resulting AC voltage level is quite low and typically needs to be amplified by a factor of several hundred times to make it usable. Alternatively, white noise can be generated digitally with a pseudo-random number generator. This has the advantage that the signal level is already high, it is consistent and it is not dependent on a particular transistor or zener diode’s characteristics. National Semiconductor used to sell a digital noise source IC, the MM5837 (designed in the 1970s) that used an internal 17-bit pseudo-random sequence generator to produce white noise for audio applications. Supplied in an 8-pin DIL package, it was designed for musical instruments, synthesisers and for room acoustics testing. Its main disadvantage was a noticeable cyclic repetition. The repetition was due to the full random sequence being produced in less than one second and being continuously cycled. by John Clarke Australia’s electronics magazine Our design uses a low-cost 8-bit PIC12 microcontroller to produce a 31bit pseudo-random sequence, which only repeats after 231 or approximately two billion cycles. That works out to nearly eight hours so the repetition is definitely not discernible. The basic “circuit” for our white noise generator is shown in Fig.1. IC1 is a PIC12F617-I/P which has a 2-5V supply fed into pins 1 and 8. A 100nF bypass capacitor is connected directly between pins 1 and 8 to ensure that it has a stable operating voltage. The noise output appears at its GP0 digital output (pin 7). Pin 4 is the master clear/reset (MCLR) pin. This is held at VDD during normal operation by an internal pullup current. If it is externally pulled low, this will hold the microcontroller in a reset state and so the noise output at pin 7 will cease. When released, the internal pull-up will bring it high again, allowing the processor to run and resuming noise generation. You just need the two components, the programmed IC and a 100nF bypass capacitor, as shown in Fig.1. And it’s dead easy to wire up since only four pins are normally used – the bypass capacitor can be soldered right next to the IC (even right across pins 1 and 8 if you wish!). The other four pins (pins 2, 3, 5 and 6) are not used and should be left disconnected. siliconchip.com.au While we are The noise frequency showing this as distribution is therea mini “project” fore even up to about in its own right 76.923kHz, which is for those who the Nyquist limit for need a dead simthis signal; ie, half ple white noise the sampling rate. source, it will Because the outbe quite familiar put is a square wave, when you read Fig.2: here’s what happens inside the PIC – the 28th and 31st bits are XOR-ed it will have compoand fed back into the first bit while the other 31 are shifted to the right by one. the next project nents at higher frethis month, the quencies than this Steam Train Whistle project, because into Q1, so you can think of this as a but they will have a decreased amplithis is exactly what we used for the modified type of “bit rotate” operation. tude and power level. “steam” component. The measured spectrum from our The Q31 bit value also determines the level on pin 7 and thus becomes prototype is shown in Fig.3. It extends Pseudo-random the noise output; hence we do not want over the entire audio spectrum (20Hzsequence generation to retain its value in one of the other 20kHz) and well beyond at both the Fig.2 shows how the software genera- bits; if we did, this would quickly lead low-frequency and high-frequency tors a pseudo-random sequence genera- to repetition. ends (the measurement bandwidth is tor using three 8-bit shift registers and a This approach has two advantages. only 20kHz). 7-bit shift register. The bits within the One, the 31-bit length leads to a very While the IC generates white noise, four shift registers labelled Q1 to Q31. long time until the sequence repeats it could potentially be used to generate These bits are pre-loaded with a spe- and two, the simple XOR gate used to pink noise with an appropriate filter at cific value when the micro comes out provide the pseudo-random effect is its output. But such a filter is not simof reset, to provide a starting point for very easy to implement in software and ple to design; it is something that we the random sequence; as explained be- takes very little time to process, allow- will cover in a future article. low, this can be any state but all zeros. ing for a high clock rate and thus givPink noise has its own uses, such as Each time a clock pulse occurs, the ing the noise signal a wide bandwidth. for calibrating audio equipment, simuvalue of Q1 is moved into Q2, Q2 into The entire process to update the con- lating background noise and can also Q3 and so on, up to Q30 which is moved tents of the four registers, including help with sleeping. into Q31. This means that all the bit the XOR operation, takes 13 software Ensuring a long values are updated from their neigh- instructions. bour, except for Q1. The internal 8MHz oscillator of the repetition time It gets its value instead from the out- PIC12 gives a 2MHz instruction rate (it You may be wondering how we know put of a two-input exclusive-OR (XOR) takes four cycles to execute one instruc- that the sequence generated by this argate, with its inputs being the values of tion) and this results in a sampling rate rangement won’t repeat for 231 cycles. bits Q28 and Q31. That is guaranteed by using the corof 153.846kHz (2MHz÷13). Once this shifting is complete, the When divided into the cycle length, rect “taps” (in this case, bits 28 and 31) value of Q31 is effectively lost, al- this gives us the approximately eight- to be combined to generate the new though it does control the value loaded hour repeat rate mentioned earlier. value of Q1 for each cycle. The list of taps required for various length shift registers to ensure a maximum length repeat cycle is given on page 5 of the following application note: www.siliconchip.com.au/link/aakr Note that this document refers to the use of an XNOR (exclusive NOR) gate rather than XOR gate. The only difference is with the lock-up state. That is the initial state of the shift registers where the generator stops producing a varying output. The XNOR version has a lock-up state when all values in the shift registers are ones (high output), whereas the XOR has a lock-up state of all zeroes (all low). The lock-up situation is prevented from happening when using either XOR or XNOR gates by starting the Fig.3: the spectrum of the white noise generated by the PIC. The power level is noise sequence with a number other consistent across all frequencies up to about 20kHz. The drop in level discontinuity than all zeroes or all ones. at 20kHz is due to sound card and computer software limitations. SC siliconchip.com.au Australia’s electronics magazine September 2018  33