Silicon ChipLava Lamp Display - July 2024 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Jamieson 'Jim' Rowe is retiring
  4. Feature: Repairable Electronics by Dr David Maddison, VK3DSM
  5. Project: Automatic LQ Meter by Charles Kosina
  6. Review: The Raspberry Pi 5 by Tim Blythman
  7. Project: 180-230V DC Motor Speed Controller by John Clarke
  8. Project: New use for Mains Sequencer by John Clarke
  9. Feature: Adding solar charging to a van by Roderick Boswell
  10. Project: Lava Lamp Display by Tim Blythman
  11. Project: Digital Compass by Tim Blythman
  12. Project: Workman 1kW Loudspeaker by Allan Linton-Smith
  13. Vintage Radio: One-valve superhet radio by Fred Lever
  14. Serviceman's Log: Computer abuse by Dave Thompson
  15. Subscriptions
  16. PartShop
  17. Market Centre
  18. Advertising Index
  19. Notes & Errata: DC Supply Protectors, June 2024; Fan Speed Controller Mk2, May 2024; Touchscreen Appliance Energy Meter, August-October 2016
  20. Outer Back Cover

This is only a preview of the July 2024 issue of Silicon Chip.

You can view 42 of the 104 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 "Automatic LQ Meter":
  • Automatic LQ Meter main PCB (CSE240203A) (AUD $5.00)
  • 16x2 Alphanumeric module with blue backlight (Component, AUD $10.00)
  • Pulse-type rotary encoder with pushbutton and 18t spline shaft (Component, AUD $3.00)
  • Automatic LQ Meter short-form kit (Component, AUD $100.00)
  • Automatic LQ Meter front panel (CSE240204A) (PCB, AUD $5.00)
  • Firmware for the Automatic LQ Meter (Software, Free)
  • Automatic LQ Meter drilling diagram (Panel Artwork, Free)
Items relevant to "180-230V DC Motor Speed Controller":
  • 180-230V DC Motor Speed Controller PCB [11104241] (AUD $15.00)
  • 180-230V DC Motor Speed Controller PCB pattern (PDF download) [11104241] (Free)
  • 180-230V DC Motor Speed Controller lid panel artwork and drilling templates (Free)
Articles in this series:
  • 180-230V DC Motor Speed Controller (July 2024)
  • 180-230V DC Motor Speed Controller Part 2 (August 2024)
Items relevant to "New use for Mains Sequencer":
  • Mains Power-Up Sequencer PCB [10108231] (AUD $15.00)
  • Firmware (ASM and HEX) files for the Mains Power-Up Sequencer (Software, Free)
  • Mains Power-Up Sequencer PCB pattern (PDF download) [10108231] (Free)
  • Panel labels and cutting diagrams for the Mains Power-Up Sequencer (Panel Artwork, Free)
  • Mains Power-Up Sequencer PCB [10108231] (AUD $15.00)
  • PIC16F1459-I/P programmed for the Repurposed Mains Power-Up Sequencer (1010823M.HEX) (Programmed Microcontroller, AUD $10.00)
  • Firmware (ASM and HEX) files for the Mains Power-Up Sequencer (Software, Free)
Articles in this series:
  • Mains Power-Up Sequencer, Pt1 (February 2024)
  • Mains Power-Up Sequencer, Pt2 (March 2024)
  • New use for Mains Sequencer (July 2024)
  • Mains Power-Up Sequencer, part one (February 2025)
  • Mains Power-Up Sequencer, part two (March 2025)
Items relevant to "Lava Lamp Display":
  • Arduino firmware for JMP002 - Lava Lamp Display (Software, Free)
Articles in this series:
  • Symbol USB Keyboard (May 2024)
  • Thermal Fan Controller (May 2024)
  • Wired Infrared Remote Extender (May 2024)
  • Self Toggling Relay (June 2024)
  • Arduino Clap Light (June 2024)
  • Digital Compass (July 2024)
  • Lava Lamp Display (July 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • No-IC Colour Shifter (September 2024)
  • IR Helper (September 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • BIG LED clock (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • Wireless flashing LEDs (February 2025)
  • Transistor tester (February 2025)
  • RF Remote Receiver (March 2025)
  • Continuity Tester (March 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
Items relevant to "Digital Compass":
  • Firmware for JMP008 - Digital Compass (Software, Free)
Articles in this series:
  • Symbol USB Keyboard (May 2024)
  • Thermal Fan Controller (May 2024)
  • Wired Infrared Remote Extender (May 2024)
  • Self Toggling Relay (June 2024)
  • Arduino Clap Light (June 2024)
  • Digital Compass (July 2024)
  • Lava Lamp Display (July 2024)
  • JMP007 - Ultrasonic Garage Door Notifier (August 2024)
  • JMP009 - Stroboscope and Tachometer (August 2024)
  • No-IC Colour Shifter (September 2024)
  • IR Helper (September 2024)
  • JMP015 - Analog Servo Gauge (October 2024)
  • JMP012 - WiFi Relay Remote Control (October 2024)
  • JMP013 - Digital spirit level (November 2024)
  • JMP014 - Analog pace clock & stopwatch (November 2024)
  • WiFi weather logger (December 2024)
  • Automatic night light (December 2024)
  • BIG LED clock (January 2025)
  • Gesture-controlled USB lamp (January 2025)
  • Wireless flashing LEDs (February 2025)
  • Transistor tester (February 2025)
  • RF Remote Receiver (March 2025)
  • Continuity Tester (March 2025)
  • Discrete 555 timer (April 2025)
  • Weather monitor (April 2025)
Items relevant to "Workman 1kW Loudspeaker":
  • 2-Way Passive Crossover PCB [01205141] (AUD $20.00)
  • 2-Way Passive Loudspeaker Crossover PCB pattern (PDF download) [01205141] (Free)

Purchase a printed copy of this issue for $12.50.

Mini Projects #002 – by Tim Blythman SILICON CHIP Lava Lamp Display Lava lamps have always invoked a fascination due to the seemingly infinite patterns that they produce. The Lava Lamp Display is a simple Arduino project that emulates a lava lamp, creating a soothing view that doubles as a groovy night light. T he lava lamp was invented in 1963 and consists of a glass bulb containing a mixture of liquids like oil and water. An incandescent bulb in the base heats the contents, and the different components swirl around due to their changing densities and surface tensions. The liquids are often coloured and the random, slow movements of their contents can be captivating and hypnotic. And bizarre as it may sound, lava lamps are even used as a source of random numbers for encryption. Companies like Cloudflare use them as part of their encryption process (see https://youtu.be/1cUUfMeOijg). Our Lava Lamp Display is a simulation of a lava lamp, using software to imitate the physics. We can’t simulate things down to the atomic level with an 8-bit processor, but we can create something that looks and behaves similarly. Our Display isn’t actually random, but it looks like it is. The photos shows how the completed Lava Lamp Display uses an 8×5 LED matrix shield mounted on an Arduino Uno board to provide the processing power. Simulation The simulation involves several ‘blobs’. Each has a ‘temperature’ and position within the display. They are analogous to the balls of oil that break off and travel around a Lava Lamp. The temperature determines whether or not the blob rises or falls, mimicking its density changing. The position affects the temperature; when the blob is near the bottom, the temperature increases, as though the blob is being heated. Near the top, the temperature falls, as though by radiating heat to the surroundings. This feedback sets the scene for the constantly changing movement of the blobs. To avoid the blobs overlapping and disappearing, the simulation prevents a blob from moving on top of another. Assembly of the Lava Lamp Display just involves plugging the LED matrix shield into an Arduino Uno (shown above). The blobs in the Lamp drift around like those in a lava lamp. The software can be modified to alter the colour or behaviour if desired. 64 Silicon Chip Australia's electronics magazine siliconchip.com.au Lava lamps are produced in a variety of colours, and they produce unique and constantly changing patterns. Source: https://w.wiki/9TUn (CCA 2.0). To prevent a deadlock, blocked blobs occasionally move in a random direction. This randomness comes from a pseudo-random number generator. The blobs’ colours also change depending on their temperature, adding further variety to the display. The result is a fairly convincing simulation of a lava lamp. Hardware and assembly The construction phase of this project simply involves plugging the XC3730 shield into an Arduino Uno board. The XC3730 LED Matrix Shield uses so-called ‘intelligent’ RGB LEDs. We described how these LEDs work in an article on page 85 of the January 2020 issue of Silicon Chip magazine (siliconchip.au/Article/12228). In summary, we can drive all 40 RGB LEDs on the shield using just one digital output on the Uno. Since the LEDs are already attached to the shield, assembly is simple: plug the XC3730 LED Matrix Shield into the Uno and connect the USB cable between the Uno and a computer. Programming the Arduino You will need to install the Arduino IDE software plus some custom libraries. Adafruit’s NeoMatrix library is responsible for driving the display. It can be installed (along with its other dependent libraries) by searching for “neomatrix” in the Library Manager – look for the version by Adafruit. siliconchip.com.au Download and unzip the software package for this project, which is available from siliconchip.au/Shop/6/396 Next, open the XC3730_LAVA_ LAMP_COLOURS sketch, select the correct board type and serial port from the menus, then upload it to the Uno. Arduino boards like the Leonardo should also work, but we haven’t tested that. If all is well, you should see a display similar to that seen in our photo. There isn’t much that can go wrong; it should just work. A video of it can also be found at siliconchip.au/link/abu8 Software details The software has been written to be configurable, so there are some #defines and variables that you can change to customise your Lava Lamp Display. Remember to upload your sketch again after any changes so that they can take effect. The BACK_COLOUR #define sets the background colour; the default is a dim blue. Changing the number in the line matrix.setBrightness(6) will alter the display intensity. We have set it quite low so that the Lava Lamp Display is suitable as a night light or for nighttime mood lighting. The colour of the blobs is set by the tempColour[] array, based on the blobs’ temperatures. The default is quite subtle; you can try uncommenting one line at a time to see different schemes we have tried, or you can make your own. To speed up or slow down the Display, you can change the delay() function call within the loop() function. A higher value will result in a slower update rate. You can also change the number of blobs with the BLOB_ COUNT #define. The heatMap[] array dictates how the temperature changes based on position. The updateBlob() function encapsulates the physics of how each blob behaves based on its temperature. For more advanced constructors, modifying the code can produce some significant changes to the simulation. All of these changes will have very subtly different effects on the model’s behaviour and lead to so-called emergent behaviour, where a simple set of rules can result in complex outcomes. Another example of emergent behaviour is a set of mathematical rules called Conway’s Game of Life. You can see examples of this at https://w.wiki/3TKJ We have also written an implementation of this scheme in a sketch called XC3730_CONWAY, which you can try out by uploading it to the Lava Lamp Display hardware. It is included in the same download package. There is an array you can use to set the initial conditions, after which you can see how the state evolves. Each LED is either lit or not; its state in the next phase of the sequence depends only on it and its immediate neighbours. The rules are pretty simple, but the animations generated almost look like they are alive, hence the name. Conclusion The Lava Lamp Display takes a simple simulation of lava lamp physics and turns it into a unique and mesmerising display that can be used as a night light or simply for amusement. It shows how simple rules can combine SC to create complex behaviour. Parts List – Lava Lamp Display (JMP002) 1 Arduino Uno microcontroller module [Jaycar XC4410] 1 8×5 RGB LED Matrix Shield [Jaycar XC3730] 1 USB-A to USB-B cable [Jaycar WC7705 or similar] Australia's electronics magazine July 2024  65