Tag Archives: arduino

Low-cost 8 channel MIDI controller

In one of the recent presentations with Per Hüttner we used TouchDesigner for live visuals. The gradual transitions between scenes were implemented using (invisible) sliders in TouchDesigner. However, making a full and smooth transition just having the MacBook touchpad to slide from one to the other side on screen was not so comfortable. Hardware-based MIDI controllers would have much better tactile feedback, like the Novation LaunchControlXL, the Midi Fighter Twister and the Intech controllers. Looking for more affordable options, we found a nicely looking ParksTool 8P on Etsy.

This triggered me to look into DIY options, and I found the M5Stack 8Angle interface, which consists of 8 knobs that connect over a Grove I2C connection to a microcontroller. I ordered the 8Angle interface online for only €15.00 and a matching M5NanoC6 microcontroller for €8.00 which I used to construct a simple 8-potentiometer MIDI interface.

M5NanoC6 microcontroller connected with a 4-wire grove cable to an 8Angle potentiometer controller

MIDI controller based on M5NanoC6+8Angle

The USB interface of the ESP32-C6 does not (yet) allow to do MIDI over USB, but the Control Surface library for Arduino does support MIDI over Bluetooth for the ESP32-C6. To connect it to your macOS computer, you have to start the “Audio MIDI Setup” application.

In the upper right corner you have to click on the Bluetooth symbol to initiate a connection.

The M5NanoC6 shows up as “Control Surface MIDI” and you can connect.

Subsequently it shows in the main panel of the Audio MIDI Setup panel as a Bluetooth device.

Using the excellent MIDI monitor application you can check that the MIDI signals are arriving, and you can assign them to the controls in TouchDesigner or in Ableton Live.

In my Arduino firmware I mapped the 8 knobs of the controller onto Control Change (CC) messages 0 to 7. The small switch on the controller allows switching between MIDI channel 1 and 2. The individual RGB LEDs on the controller change color along with the respective MIDI values.

12 Volt trigger for audio amplifier – PCB version

Previously I wrote how I designed and implemented a 12 Volt trigger for an NAD audio amplifier. Some time ago I also designed a PCB version of it. Here you can find some photos and the Eagle schematic.

There is one error in the design: the GND pin of the Wemos D1 mini board is not connected to the ground plane. I solved it with an air wire.

Some of the differences to the previous version are that it now has a button, a 12V input trigger, and a status LED. The button allows to manually switch it on and off without having to use my mobile phone. The 12 V input trigger allows the amplifier to be switched on by and off by the Sonos Port that is also connected to the amplifier.

I am using Tasmota as the firmware which – besides the button to switch it on and off – allows control over a web interface and over MQTT. The Tasmota template for the configuration is the following: {"NAME":"12V trigger", "GPIO":[1,1, 1,1,32,288,0,1,256,1,160,1,1,1], "FLAG":0, "BASE":18}.

The MQTT interface makes it easy to implement some automation with Node-RED that I have running on a Raspberry Pi. The automation is the following: whenever the smart TV or the MacMini (used for music) are switched on, as detected by them returning a network ping on their IP address, then the amplifier switches on, and vice versa.

I also have it configured using Homebridge in my Apple Home environment, which allows the Home application on my iPhone or iPad to manually control it, besides the Tasmota web interface.

Combining all of these, the NAD amplifier is switched on and off by either

  • the manual button
  • the smart TV (detected by an IP ping)
  • the MacMini (detected by an IP ping)
  • the Sonos Port (detected by its 12V output trigger)
  • the Apple Home application on my iPhone/iPad
  • the Tasmota web interface

However, the automation is not perfect: when after an afternoon of listening to Sonos we switch on the TV and switch off the Sonos Port, the Sonos Port only falls asleep after a minute or so. Consequently, the last action happens to be the Sonos Port 12V output going low; the amplifier therefore switches off after a minute or so, whereas we just switched the TV on. A quick press on the manual button switches it on again. Also, whenever we switch between MacMini, TV, or Sonos, we still have to walk to the amplifier to toggle it to the right audio input. An idea for the future is to mount an IR blaster that switches between the audio inputs automatically.

12 Volt trigger for NAD-D3020 amplifier

Update 3 January 2021 – mention that I am now using Tasmota firmware.

Update 26 February 2023 – I have followed this up with a PCB version that also includes a button and a 12 Volt input trigger for switching the 12 Volt output trigger.

The NAD D3020 is a hybrid digital audio amplifier with a combination of analog and digital inputs. I have been using it for quite some years now to play the sound of my Samsung smart TV over the living room speakers and for digital radio, iTunes and Spotify from my Mac mini. The Samsung is connected with an optical Toslink cable, the Mac mini is connected with a USB cable.

In the way the D3020 is placed in our media cabinet, its on/off button is not so easy to access. The D3020 remote control is really crappy and I find it anyway annoying to have to use multiple remotes to switch the power of all devices. Also, the status LEDs of the D3020 are dim and got considerably worse over time, especially for the OPT1 and the USB inputs that are for the TV and the Mac mini, and hence on most of the time. I guess that it uses OLEDs, which have degraded over time. Consequently, it happened quite often that we forgot to switch the amplifier off for the night.

However, the D3020 features a 12V trigger input port which allows the amplifier to be switched automatically on/off along with other gear. Of course, neither TV nor the Mac mini has a 12V output port, but both are connected to my home network; hence it is possible to detect over the network whether these are powered on.

Continue reading

Monitoring the central heating with an Arduino and two DS18B20 sensors

This post is part of a series on Arduino-based energy and climate monitoring.

About 40% of our energy bill is spent on electricity and 60% on gas, which we use to heat our house and for hot water. Although we do have a relatively recent HR central heating installation, I don’t think that it has been tweaked for efficiency. After reading this post on optimising the yield of the central heating installation, I decided it would be worthwhile to try and acquire some data.

P1130997

I wired up a Arduino pro mini (3.3V) with a RFM12b and a pair of DS18B20 temperature sensors to measure the temperature of the outgoing and returning water of our central heating system.

P1130995

Power is provided by connecting a rechargeable 18650 LiPo battery to VCC on the programming header of the Arduino. This battery provides nominally 3.7V, which in my experience is close enough for the board to work fine. The whole module is mounted in a battery holder for two 18650 batteries.

Every 66 seconds a temperature reading of both sensors is performed and transmitted it to the central relay module. The central module forwards it to ThingSpeak to acquire a long-term log of the behaviour of our central heating system.

You can find the sketch for the Arduino here.

Arduino kWh and M^3/h energy meter – gathering the components

I am working on an energy meter that is to show the instantaneous electrical power (kWh ) and natural gas usage (M^3/h) in our house. A bit like <a href=”http://juerd.nl/site.plp/kwh”>http://juerd.nl/site.plp/kwh</a>, but with two recordings, data logging to an SD card and with some buttons to switch the display from the instantaneous recording to usage per-minute, per-hour, etc.

I just managed to get all components hooked up to the Arduino nano. See the photo for an impression.

The project includes

  • Arduino Nano
  • RTC
  • CRT5000 Infrared Reflectance 2x
  • SD card module
  • 1602 LCD

I am still waiting for the two pushbuttons. Once those arrive I’ll finalize the electronics and software and transfer it to a perfboard.