• Power supply

    Keith10/06/2024 at 19:59 0 comments

    A 5 metre 5V cable takes 90W, so it will need 18 amps.

    Examples supplies:

    XP Power Switching Power Supply, LCS100US05, 5V dc, 18A, 90W, 1 Output, 85 to 264 V ac input for £20.40

    A 5 metre 24V cable takes 70W, so it will need nearly 3 amps.

    Example supplies:

    XP Power Switching Power Supply, LCS75US24, 24V dc, 3.2A, 77W, 1 Output, 85 to 264 V ac for £16.24

  • Upgrading to the Pi-5

    Keith10/06/2024 at 03:53 0 comments

    The tutorial used a Pi 4 but the PWM library is incompatible with the Pi 5.

    The Pi 5 uses the SPI port in a clever way to generate the required PWM signal.

    The cycle time is 1250 ns (800 kHz).

    A '0' bit is 0.4 high, 0.85 low (40:85 = 8:17 or roughly 1:2 ratio)

    A '1' bit is 0.85 high, 0.45 low (85:45 = 17:9 or roughly 2:1 ratio)

    This would be like transmitting 100 and 110 binary at 2.4 MHz.

    The SPI sends 8 bits to represent a neopixel bit, so one could transmit 

    11100000 for a 'zero' (469 ns = 400 + 69 ns)
    11111000 for a 'one'  (781 ns = 800 - 19 ns)

    which are within the 150 ns tolerance.

    https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel_SPI/releases/tag/1.0.9 uses:

    frequency: int = 6400000,
    reset_time: float = 80e-6,
    bit0: int = 0b11000000,
    bit1: int = 0b11110000

    which are slightly shorter pulses. 

    The R-Pi could use an SPI clock rate between  5.715 and 7.272 MHz to satisfy the neopixel cycle times. The code snippet above indicates 6.4 MHz SPI clock rate, for  800 kHz neopixel rate.

    I think it might be possible to get better ratios by sending groups of 9-bits which overlap the 8-bit bytes. If 3 bits = 400 ns, 9 bits are 1200 ns, 8 bits are 1067 ns = 937.5 kHz byte rate and 7.5 MHz SPI clock rate. The price is more work bit packing.

    If one is prepared to pay that price, one might as well reduce the SPI clock rate to just three times the neopixel bit rate and reduce the packing from 9 to 3 SPI bits per neopixel bit.

    There are 24 neopixel bits per RGB chip, 8 neopixel bits per primary colour LED.

    The library has only one demo, neopixel_spi_simpletest.py which is not as impressive as the PWM library demos.

    The WS datasheets seem to be a bit vague about timing, so this person did some research to see what exactly did work:

    https://cpldcpu.wordpress.com/2014/01/14/light_ws2812-library-v2-0-part-i-understanding-the-ws2812/

  • Light output

    Keith08/06/2024 at 15:42 0 comments

    Programmable LED strips provide a large array of lights for very few control pins.

    There are two common serial buses used; SPI (two wires) and PWM (one wire).

    The latter are simpler and cheaper to make, so most LED strips are this type.

    Choices of LED strip

    Voltage

    Individual LEDs need less than 5V forward voltage so 5V is used for individually programmable LED strips.

    The higher-voltage strips (12V or 24V)  wire LEDs in series so that each RGB controller chip drives multiple LEDs.

    The benefit is higher light power for the same current.

    The downside is that the LEDs are controlled in groups, rather than individually.

    I wanted individual RGB LED control, so a 5V PSU was needed.

    Structure

    Early LED light bulbs converted high-voltage mains to a lower voltage to drive a few LEDs in series. More recent LED light bulbs use many LEDs in series so they can be driven directly from rectified mains voltage. A 230 volt bulb would typically have four small sub-strips of 57.5 volts each. Some programmable strips use this technology but are programmable in multiples of sub-strip length, typically 10 cm.

    I wanted individual RGB LED control, so a 5V PSU was needed.

    Controller

    I chose the Raspberry Pi.

    Limitations

    The Raspberry Pi uses its PWM audio pin to drive the one-wire bus, so it cannot drive it and PWM audio at the same time.

    Tutorials

    Connect and control WS2801 RGB LED strips (SPI)

    Connect and control WS2812 RGB LED strips (PWM)

    My R-Pi failed to install scons with this line:

    sudo apt-get install gcc make build-essential python-dev git scons swig

    I guessed it was an obsolete thing but it managed to install on my floor-top Linux PC.

    SCons is a software build tool. I don't know why they did not just use 'make'.

    Fortunately there seem to be many other examples so I shall try those.

    I installed a more recent Raspbian OS on an SD card, then tried this one:

    https://core-electronics.com.au/guides/fully-addressable-rgb-raspberry-pi/

    This worked, after disabling sound in the boot config.txt file and running the demos as super user.

  • Music choice

    Keith08/06/2024 at 13:52 0 comments

    Still thinking about what music to use.

    There are examples of the Raspberry Pi controlling musical devices, such as driving air valves controlling the air entering organ pipes.

    Automated PVC Pipe Organ (Raspberry Pi Project) (youtube.com)