Play audio when GPIO pin changes state

I have a project where when a GPIO input pin on an Arduino changes state, I wish my cell phone to play a sound (an MP3). Is this something that might be possible with Blynk? If not, can anyone think of an alternative mechanism (eg. an alternate Android based app) that might play a sounds. I can transmit a TCP packet to an app running on my phone manually if that helps … but I need a way to play sounds on the phone when the external event (GPIO changes state or TCP packet sent) has occurred.

You can do this by setting up a push notification for that pin and then use tasker to play your specific media file.

You may also be able to simply set the notification sound to the file that you want and skip tasker…

@priorguy Many thanks for the response. Would you have a link to “Tasker” … I am not familiar with that app/concept.

I read about the concept of “Push Notifications” here:

http://docs.blynk.cc/#widgets-notifications-push-notifications

But I’m afraid I’m missing a concept. If I understand correctly, I can send arbitrary data from my hardware (phone) to device (MCU). But I don’t seem to have a need for that. Instead what I want is to play a sound on my hardware (phone) when a GPIO pin changes state on my device (MCU) … so it seems that push notification is backwards from what I need. I’m also not seeing a use … it seems that a GPIO change on a device (MCU) can already propagate a signal to the hardware (phone) … what I am missing is what I can do on the hardware (phone) to detect that and play a sound.

You can configure blynk to send a push notification to your phone whenever the pin state changes. You can then setup tasker to monitor your notifications and play yourawesomesound.wav when you receive the blynk notification

We don’t have a specific sound widget yet. But we do have a way to send data from hardware(MCU) to the Blynk App on your smartphone. Virtual pins are made for that. I never played with Tasker, but some blynkers here built some cool stuff with it.

So basically, you can write a code on MCU that will send a push notification to your smartphone if GPIO state changes, and then use tasker to start an MP3 player app with specific track.

It’s my assumption only :smile:

@priorguy Thank you sir, that’s what I needed. I will now go and study Tasker to learn how it can be “interfaced” with Blynk. My next puzzle is decoding " … you can then setup tasker to monitor your notifications …".