Air Button for Volumio using ultrasonic sensor

I place my hand in the air and itís my music player I have full control of. I change volume of the music and play or stop songs just by putting my hands high or low. I can program how ever I want to control the features of Volumio, the app for personal jukebox on cloud. However, it does not end there. It goes beyond the music app and controls just about any apps with my bare hands.

If you havenít looked at my prior project using GPIO, check out from my related project on your right side. If itís not there, try this link. It goes into details of what GPIO app does and how it is different. It also gives you instructions on how to build a traffic lights.

http://www.instructables.com/id/GPIO-for-Raspberry-Pi-B-B-Pi-2-running-PROTA-Pi-OS/?utm_source=base&utm_medium=related-instructables&utm_campaign=related_test

This is the bottom line.

I mesh an ultrasonic sensor and Volumio and I get levels of invisible buttons that I can customize how ever I want.

NOTE for your understanding
You need to download the app first on PROTA Pi to follow this Instructables. Install the app from AppRepo. By any chance, if you donít have a copy of the OS, you can get your hands on it from the download. if youíre looking for a shortcut, thisís the one: Where-can-I-download link.

Step 1: What do I need?

Air Button for Volumio using ultrasonic sensor
Air Button for Volumio using ultrasonic sensor

What I need to prepare:

  • LED
  • ultrasonic sensor
  • breadboard
  • cables for GPIO
  • post it or notes(not mandatory if youíre good at rough estimates of heights)

    As shown in the picture, I made connections with TxD, RxD, GND, and 5V. LED in the first picture is there to check if theyíre properly working or not.

    Step 2: Configure UART from the GPIO app

    Air Button for Volumio using ultrasonic sensor

    Configure your settings as shown in the guideline of UI.

  • Baud rate : 38,400 bps
  • Data bit : 8 bit
  • Stop bit : 1 bit
  • Buffer size : 100
  • The buffer size means the number of letters that can be delivered at one transfer.

    Step 3: Test the ultrasonic sensor

    Air Button for Volumio using ultrasonic sensor
    Air Button for Volumio using ultrasonic sensor

    The above two pictures in png format are actual automation rules that have been applied to my system and sharing with you all so that you can also apply to your system. Download the picture files and apply with a drag-and-drop on your app. If properly configured, the LED will turn on when you put your hand over the ultrasonic sensor and off when you put away.

    If you want to create the test rules manually, follow the next step.

    Step 4: Configure UART from the GPIO app (part 1/2)

    Air Button for Volumio using ultrasonic sensor

    Thisís what it does.

    "If the distance reading on ultrasonic is less than 10cm, turn on the LED."

  • select GPIO app
  • select UART serial
  • UART Read
  • (check the green checkbox)
  • select and register filter : click '+ Advanced'
    Test True : {{{{{{data!split("\x03\x02^")}}[1]!to_int}}!le(100)}}
    (This may be a bit difficult step to some of us.. in short, le(less than and equal to) 100mm. Try testing by changing the numbers yourself!)

    If youíd like to understand more about how to register code in filter values and build the rule for yourself, please try out the link(blog) below.

    'Learn more about AMBLANG'

  • select GPIO app
  • select Write Digital
  • select GPIO pin$
  • (check the green checkbox), Set '1í(turn on the LED)

    Step 5: Configure UART from the GPIO app (part 2/2)

    Air Button for Volumio using ultrasonic sensor

    Thisís what it does.

    "If the distance reading on ultrasonic is more than 10cm, turn off the LED."

  • select GPIO app
  • select UART serial
  • UART Read
  • (check the green checkbox)
  • select and register filter : click '+ Advanced'
    Test True : {{{{{{data!split("\x03\x02^")}}[1]!to_int}}!ge(100)}}
    (ge(greater than and equal to) 100mm.)

  • select GPIO app
  • select Write Digital
  • select GPIO pin$
  • (check the green checkbox), Set '0í(turn off the LED)

    Step 6: Build an Air Button!

    Heights for Air Button

  • ~ 10cm : volume up
  • 11cm ~ 20cm : volume down
  • 21cm ~ 30cm : play music
  • 31cm ~ 40cm : stop music

    Iíve marked the heights with Post-it so that I know where to place my hands.

    You can follow my examples like above or set your own rules.

    Step 7: Cheat sheet & wrap up

    Air Button for Volumio using ultrasonic sensor
    Air Button for Volumio using ultrasonic sensor
    Air Button for Volumio using ultrasonic sensor
    Air Button for Volumio using ultrasonic sensor

    Wrong. I didnít post them accidentally. They are not the same images and I've posted them in the following order.

  • ~ 10cm : volume up
  • 11cm ~ 20cm : volume down
  • 21cm ~ 30cm : play music
  • 31cm ~ 40cm : stop music

    Drag and drop the png files. I recommend you edit them if youíd like a bit of customization.

    Examples in real-life:

  • "I wish I could turn on and off the bedside lights with Air Button."
  • "Turn on the monitors and notebook cooler with Air Button on my desk!"

    To recap, thisís a button for controlling music but it doesnít have to be. It can be just about anything you can imagine. It can be your button for controlling your Torrent download, robot vacuum cleaner, or even Mindcraft and Mindstorm! Itís up to you to decide.

  •  
     

    Tag cloud

    make build easy simple arduino making homemade solar laser printed portable cheap mini building custom cardboard wooden create super lego turn paracord chocolate your paper light intel