Project tutorial

Mini Acoustic Levitation © CC BY-NC-SA

This project uses an ultrasonic distance sensor to create a pocket of wave interference where a small object can be levitated.

  • 3,349 views
  • 1 comment
  • 26 respects

Components and supplies

Apps and online services

About this project

View this project on my website to see a circuit simulation and more!

Acoustic levitation is made possible through the fact that sound behaves as a wave.  When two sound waves intersect each other, they can either constructively or destructively interfere with each other.  (This is how noise - cancelling headphones work.)

This project uses an ultrasonic distance sensor to create a levitation effect. This works by creating "pockets" where two opposing sound waves interfere with each other. When an object is placed in the pocket it will stay there, seemingly hovering in place.

Materials needed:

As an Amazon Associate I earn from qualifying purchases.

Step 1: Get Ultrasonic Transmitters

You will need to sacrifice a distance sensor for this step (don't worry, they're relatively cheap):

  • De-solder and remove both transmitters from the board
  • Remove and save the mesh screen from one
  • Solder wires to both transmitters

Step 2: Create Circuit

Create the above circuit and note the following:

  • You may not necessarily need to include the two 100nF capacitors.  (only if your board is for some reason not able to handle the circuit and it keeps shutting itself down)
  • The 9v battery is a stand-in for any DC power supply - mine worked fine with a 7.5v LiPo battery

Step 3: Code

Upload this code to your Arduino:

//original code from: https://makezine.com/projects/micro-ultrasonic-levitator/
byte TP = 0b10101010; // Every other port receives the inverted signal
void setup() {
  DDRC = 0b11111111; // Set all analog ports to be outputs
  
  // Initialize Timer1
  noInterrupts(); // Disable interrupts
  
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1 = 0;
  OCR1A = 200; // Set compare register (16MHz / 200 = 80kHz square wave -> 40kHz full wave)
  
  TCCR1B |= (1 << WGM12); // CTC mode
  TCCR1B |= (1 << CS10); // Set prescaler to 1 ==> no prescaling
  TIMSK1 |= (1 << OCIE1A); // Enable compare timer interrupt
  
  interrupts(); // Enable interrupts
}
ISR(TIMER1_COMPA_vect) {
  PORTC = TP; // Send the value of TP to the outputs
  TP = ~TP; // Invert TP for the next run
}
void loop() {
  // Nothing left to do here :)
}

Step 4: Mount Transmitters and Calibrate

You can really use anything to do this, but I ended up using a set of helping hands (buy some here: https://amzn.to/2TPifsW):

  • Start by positioning the transmitters about 3/4" apart from each other
  • Get a small piece of Styrofoam about half the size of a pea (it doesn't need to be round)
  • Place the Styrofoam on the mesh screen from step 1
  • Using tweezers or pliers, position it in between the two transmitters (it should start to wiggle when you get close)
  • Move the transmitters around (closer and farther apart) until the Styrofoam stays still

Troubleshooting

It took me about fifteen minutes to get it working the first time, but after that it was pretty easy to get it going again.  Here are some things you can try if it doesn't work at first:

  • Make sure you wired everything correctly
  • Increase the voltage to the H-bridge (different battery)
  • Get a smaller piece of Styrofoam
  • Try a different position for the transmitters
  • Try adding the capacitors (if you didn't already)
  • If it still doesn't work, maybe something is broken: try a different set of transmitters or a new battery. 

Code

Code snippet #1Arduino
//original code from: https://makezine.com/projects/micro-ultrasonic-levitator/

byte TP = 0b10101010; // Every other port receives the inverted signal

void setup() {
  DDRC = 0b11111111; // Set all analog ports to be outputs
  
  // Initialize Timer1
  noInterrupts(); // Disable interrupts
  
  TCCR1A = 0;
  TCCR1B = 0;
  TCNT1 = 0;
  OCR1A = 200; // Set compare register (16MHz / 200 = 80kHz square wave -> 40kHz full wave)
  
  TCCR1B |= (1 << WGM12); // CTC mode
  TCCR1B |= (1 << CS10); // Set prescaler to 1 ==> no prescaling
  TIMSK1 |= (1 << OCIE1A); // Enable compare timer interrupt
  
  interrupts(); // Enable interrupts
}

ISR(TIMER1_COMPA_vect) {
  PORTC = TP; // Send the value of TP to the outputs
  TP = ~TP; // Invert TP for the next run
}

void loop() {
  // Nothing left to do here :)
}

Schematics

Schematic
Mini acoustic levitator 5qcr2ltsxt

Comments

Similar projects you might like

Mini Firefighter Robot

Project in progress by Alberto Ben

  • 6,348 views
  • 11 comments
  • 23 respects

Mini Me 1.5 - Adafruit HUZZAH Robot Doll

Project tutorial by Kitty Yeung

  • 5,346 views
  • 2 comments
  • 26 respects

Magnet Levitation with Arduino

Project tutorial by jsirgado

  • 37,540 views
  • 94 comments
  • 152 respects

How to make mini CNC 2D plotter using scrap DVD drive, L293D

Project tutorial by Sandeep Sharma

  • 31,978 views
  • 20 comments
  • 72 respects

Arduino Mini Shields Construction

Project tutorial by Patel Darshil

  • 1,704 views
  • 0 comments
  • 19 respects

Arduino Tutorial : Mini Piano

Project tutorial by the lonely programmer

  • 6,280 views
  • 2 comments
  • 8 respects
Add projectSign up / Login