Giorgos Batzios

← Arduino Projects

Interactive Live Performance System

Arduino sensors that control Ableton through Max MSP.

Interactive Live Performance System

In my 5th semester at Metropolitan College, for the course “Music Technology and Production”, I built a system of an Arduino and sensors that, through Max MSP, drive controls in Ableton. This way, when I interact with the sensors in front of me, I can control the DAW's parameters live.

I used an Arduino Uno Rev3 as the mainboard. The sensors I chose are:

  • The HC-SR04 ultrasonic sensor, which sends ultrasonic pulses and receives their reflection. From the time between sending and receiving, the Arduino returns the distance of the nearest object from the sensor.
  • The MPU6050, a three-axis accelerometer and gyroscope. For this project I use the gyroscope, meaning the sensor's angle on each axis, not its acceleration.
  • The Waveshare liquid level sensor, which uses vertical metal contacts and the conductivity of water so the Arduino can return a value based on how deep the sensor sits in the liquid.

First I read the setup guide for each sensor:

maker.pro: MPU-6050waveshare.com: Liquid Level Sensorprojecthub.arduino.cc: HC-SR04

Wiring

Then I found the diagrams with the correct wiring.

HC-SR04 ultrasonic sensor. I used digital pins 12 and 13 instead of 9 and 10 as shown in the picture.
HC-SR04 ultrasonic sensor. I used digital pins 12 and 13 instead of 9 and 10 as shown in the picture.
MPU6050 accelerometer
MPU6050 accelerometer
Waveshare liquid level sensor
Waveshare liquid level sensor

Unlike the other two sensors, the MPU6050 had no pins ready for connection, so for the first test I connected it with crocodile clips.

First test of the MPU6050
First test of the MPU6050

Then I soldered on the header that came with the sensor.

Soldering
Soldering

Code

I connected each sensor to the Arduino separately and looked for its code. I found example code for each sensor in the Arduino IDE library.

I tested each sensor on its own, and once they all worked I merged the three programs into one so all three sensors could run at the same time.

Based on the photos, I then drew my own diagram with all three sensors connected to the Arduino at once.

The final circuit
The final circuit

As a result, all 3 sensors worked together, and the serial output printed this every 10 ms:

Distance: 400 Water level: 3 angleX: -0.62 angleY: -1.39 angleZ: -36.12

Distance is the ultrasonic sensor's reading in centimetres from 0 to 400, Water level is the water level from 0 to 650, and angle X, Y, Z are the gyroscope's angles on each axis, from about -90 to +90.

The system in use