• Problem analysis

    Ayu08/22/2025 at 16:01 0 comments

    Recap: in the last part, the two prominent issues are (1) lights dimming with speaker sounding; and (2) hissing noise in the speaker. We concluded that for (1) we need bulk capacitance, and for (2) it seems to stem from switching noise.

    First, mount the bulk capacitor C11. This is originally intended to resolve the light's dimming, but it actually reduced the hiss, while the dim persisted! What is happening?

    Components on the circuit board.
    I also added a parallel 100 nF at the LDO's input (C12), to no observable effect.

    Let's check the theory. Here is the power supply and the audio filter circuit:

    Circuit diagram of a DC-DC, an LDO, and an amplifier with filter.

    The DC-DC converter works at 320 kHz. The LDO's datasheet specifies 50 dB PSRR without a graph. The amplifier IC specifies a minimum of 60 dB. The filter is a first-order high-pass followed by a first-order low-pass, the passband from 16 Hz to 7.2 kHz, with an overall unity gain.

    Does the hiss come from switching noise? The filter alone provides an attenuation of 20 log10 (320/7.2)) = 33 dB. LDO's PSRR at this high frequency will be lower, but still in the range of bels. This combined attenuation is likely sufficient to supress the switching noise coupled into the audible signal.

    Furthermore, the hiss appear only when the light and the speaker are both plugged in, and not with the speaker alone. This renders the original hypothesis highly improbable.

    Returning to the workbench: our test tone is a 375-Hz sine wave (which comes from the 24 kHz sample rate divided by a wavetable length of 64 samples). Somehow I noticed that, to the ear, the hiss is the same pitch class i.e., it is a few whole octaves above 375 Hz. By simple elimination, the exact frequency is likely at 375 Hz × 24 = 6 kHz which coincides with the PWM frequency of the light. This surely is no coincidence; when the PWM frequency is changed in the program, the hiss changes its pitch accordingly. Hence, we can conclude with confidence that the hiss originates from the LED's high-frequency power draw coupled into the LDO's output, which correctly predicts that the bulk capacitor will reduce this noise.

    Now that the root cause has been identified, we know how to fix the problem. Either add a filter at LDO's input, or increase the PWM frequency beyond the filter's passband. For the dim (power dip), we need more bulk capacitance, of course!

    ... Or do we? Does the speaker take that much current? Let's inspect the current coming out of the battery. In the following tests, all signals are kept running while components are plugged/unplugged. The LEDs are driven with fixed duty cycles (intensity), and audio alternates between sounding, idle, and hard shutdown. The current draw in these three states are measured.

    Plugged inI1 (A)I2 (A)I3 (A)
    None0.02
    LED (1/8 duty)0.11
    LED (1/2 duty)0.28
    Speaker0.530.480.02
    Speaker + LED (1/8 duty)0.540.490.11
    Speaker + LED (1/2 duty)0.540.490.28

    There certainly is a problem. Why is the current draw fixed at 0.48 A when the speaker is plugged in?

    The oscilloscope brings us a step closer.

    Oscilloscope recording. As time passes, loops between: (1) straight 0 V reading; (2) 2.4 Vp-p centred at 0 V, 23.5-kHz triangle wave; (3) triangle wave superimposed by an oscillation at lower frequency.
    Voltage measured between speaker output pins, load plugged in. Amplifier alternates between shutdown, idle, and sounding.

    What is this 23.5-kHz triangle wave?? (To be continued...)

  • Assembly & bring-up

    Ayu08/20/2025 at 08:17 0 comments

    2025-08-18

    The circuit boards have arrived! Large boards are way easier to handle than miniature ones like those for Wind.

      Steps of assembly: (1) empty circuit boards; (2) mounted components; (3) borrowing a component from another board; (4) plugged-in LED and speaker.
    As I've lost track of my IMU stock, I had to borrow one from those previous assemblies (^ ^;)

    The first-ever bring-up succeeded without friction. Both light and sound worked; the light at full intensity consumed around 150 mA at 3.3 V or 500 mA at 1.2 V (from a 1250-mAh AAA-sized NiMH battery).

    Circuit powered by an AA battery, the LED emitting a red light.

    Although light and sound do not appear to work well together: the light dims by a lot when sound turns on. This is due to the voltage drop at the DC-DC regulator with the surge of increased consumption. This has also been a quirk in Wind, but here the light is brighter and hence more noticeable. It remains to be seen whether mounting the bulk capacitor (C11) will resolve the issue.

    In addition, there is a hissing noise from the speaker, supposedly due to noise in the filter. My analogue design capability is currently severely limited, so I think I should seek external consultancy on this.

    The issues aside, I have found an ideal type of lampshades that perfectly manifests my original vision. Paired with the light, the outcome I'd happily call eye candy.

    Box of four lamp shades. Each is a spherical shell with a circular opening.
    Montage of a tabletop light changing colours: blue, red, green.

  • Inception

    Ayu08/10/2025 at 06:20 0 comments

    I was in the middle of a Linux kernel craze when I opened Hackaday and bumped into the One Hertz Challenge. I was suddenly struck by a notion — and the night passed sleepless, sleepless even with the kernel already in oblivion.

    I was late to the scene, but not quite — there were still two full weeks ahead. That would be at least enough for something.

    The basic idea builds on the frequency drift phenomenon: periodic events whose periods are supposedly identical, but actually slightly different and varying, gradually become out of sync (and back into sync again). Normally we would consider this a nuisance and immediately switch to an accurate time source, but as some have demonstrated, it can actually be an artistic artefact. From mitxela's blinking badges to bitluni's blinking superclusters, the desynchronising lights effect has been explored and demonstrated in full detail.

    This project follows this line of thought — if lights can drift, why not sound? For sure, Steve Reich has realized a similar idea in the piece Violin Phase where musical patterns go out of sync to form complex relations. In contrast to Reich's entire phrases interleaving, what if the individual tones themselves drift apart? As each tone moves back and forth in time, the musical phrase itself morphs and evolves. For an interactive installation, I consider a bunch of desynchronising repeated notes: together, they form a short loop that slowly, automatically changes as time passes. In this way, we stress more on the concept of an ever-changing musical short phrase, and harness indeterminacy from the transient physical world.

    In this first incarnation in the series, the physical construction is straightforward: a desktop lamp that "pulses" once per second. Each pulse comprises sound as well as light, yielding a rich and easily observable output. As a simple form of interaction, in response to nudges or pats, the lamp switches to a different tone and colour, and resets its phase (time of pulse). When multiple such lamps are put together, they form a looping musical phrase that spans one second, with each lamp contributing a single note within. These devices are set to run on microcontrollers' imprecise internal RC oscillators, so their clocks naturally drift apart even without external interference, resulting in constant variations in the looping phrase.

    Illustration of the construction: a lamp containing an LED, a speaker, connected to a board and powered by a battery.

    The first revision of the circuit board has been designed and is now on its way from the fabrication house. It will be powered by a NiMH battery; interaction will be sensed by an accelerometer IMU. Let's see how this will turn out.

    Circuit board design screenshot.