Laser Scanner, controlled by Arduino

I am curious about the feasibility and price of such a project. My plan is to have a microphone, or perhaps piezo, to listen for bass in ambient music, and control a servo relative to the bass hits on the music (i.e. servo all the way one way at max bass amplitude, all the way the other at minimum amplitude). Ideally, the min and max would be relative to the volume of the ambient music, so loud music would appear the same as quiet music. Also (or instead of the last comment), the project would have a sensitivity knob (potentiometer on the mic?).

The end goal is to project a laser on a spinning mirror (creating a plane) and then bouncing that off of a mirror attached to a servo, to make the plane bounce up and down to the bass.

Thanks in advance!

I'd imagine that needing to respond quite quickly, and ordinary RC servos may not be fast enough. I'm sure you'd be able to find a solenoid or something fast enough, but I suggest you start by working out what you need to do for the actuator side of it.

Servos won't be fast enough, what you need is a galvanometer. Its a small mirror on a specialized motor assembly

You use two galvos to create the X and Y movement. If you only want a wave you only need one galvo though to control the "amplitude" of the plane

I will keep galvos in mind, I'm familiar with their use in a true laser scanner. The device that would cause the "scanning" per say would be the mirror spinning on motor to create a plane.

I think a servo is still reasonable. This will primarily be for electronic music, likely the fastest being drum n' bass which generally falls around 180 bpm. Each beat is about .33 seconds long at this tempo. I looked up some servo speeds and most are capable of .05-.17 secs for 60 degrees of rotation, which would allow an up and down for each beat at this tempo. Most songs would likely be house at around 130bpm, so a servo would be plenty for that.

I will keep a galvanometer in mind, however, because for example, a build up with 8th notes or 16th notes on the bass drum would likely exceed the capability of a servo. With this in mind, does an Arduino have enough juice to power a galvanometer?

The part I understand far less is definitely the audio input part of the project.

I think I have some code that will work.
I will use as the audio input, with a simple low pass filter.
The output from this will be connected to one of the analog inputs on an Arduino.

I use the Metro library to make a 2 second counter, and every two seconds the code figures the max and min amplitudes of the input, and then maps these to control a servo between 0 degrees and some arbitrary angle (I can change this to improve speed or how it looks).

Any thoughts on my code?

#include <Metro.h>
#include <Servo.h>

int inputAmp = 0;
int servoPos = 0;
int inputPin = A0;
int maxAmp = 0;
int minAmp = 1023;
int lastmaxAmp = 0;
int lastminAmp = 0;
int consAmp = 0;
int maxservoAngle = 40;

Metro ampCheck = Metro(2000);

Servo xservo;

void setup() {

void loop() {
  inputAmp = analogRead(inputPin);
  if (ampCheck.check() != 1) {
    if (inputAmp > lastmaxAmp) {
      lastmaxAmp = inputAmp;
    if (inputAmp < lastminAmp) {
      lastminAmp = inputAmp;
  if (ampCheck.check() == 1) {
    maxAmp = lastmaxAmp;
    minAmp = lastminAmp;
    lastmaxAmp = 0;
    lastminAmp = 1023;
  consAmp = constrain(inputAmp, minAmp, maxAmp);
  servoPos = map(consAmp, minAmp, maxAmp, 0, maxservoAngle);