File Exchange

image thumbnail

Levitating a Ping Pong Ball Using Arduino and Simulink

version 1.0.0.1 (752 KB) by Brian McKay
Learn how to use Simulink to make an Arduino based fan that levitates a ball at a specified height.

28 Downloads

Updated 13 Sep 2016

View License

Learn how to use Simulink to make an Arduino based blower fan that levitates a ping pong ball at a specified height. An ultrasonic sensor measures the height of the ball and a PID controller adjusts the fan speed to maintain the desired height.
Hardware Used:
Arduino Mega 7.4V Li-po Battery
IRLZ14 MOSFET 1k Ohm Resistor
Fan Blower USB A to B Cable
Ping Pong Ball Tube (3D Printed or Homemade)
Sharp Infrared Sensor GP2Y0A21YK (will need a 3 pin JST connector)

https://www.youtube.com/watch?v=dXYT1-Ft_l4

Comments and Ratings (3)

Good work , it works with me too , using Matlab 2017a , and Arduino Uno (not Arduino Mega) PWM pin9(Make sure you change it if you use arduino uno)
I used 220V to 12V transformer for the fan (12V2A blower) , and I couldn't find the sharp sensor , I used a 4 pins TCRT5000 Infrared Sensor module , MOSFET also same as yours , but a longer Plastic tube , so I had a problem with the sensor (0.5CM to 1.5CM) .
Anyway , good job and I hope my information are helpful too in case anyone cannot find the exact components

What version of Simulink was required? Control design or real time desktop?

Antonin

Great work! Good utilization of the dashboard blocks in External mode with Arduino.

Updates

1.0.0.1

Adding the YouTube link to the description

1.0.0.1

Updated license

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Communities

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor