Control a Tablet with an Arduino

Hello,

I'm wondering if it's possible to have my Arduino Mega control my Android tablet. My goal is to have the Arduino Mega remotely open apps on the tablet.

(I'm using a Movi Shield (Which is a shield for Arduino that allows me to control stuff using voice commands), so I want to have the Arduino Mega open up an app when I say a certain command).

Is this possible?
If so how would I go about doing it?

Thanks in advance.

You will need a program running on the tablet to read and interpret the command from the Arduino. Do you have such a program ?

You may also require an OTG cable too, to allow two way communications between both devices.
That would allow you to also interpret serial signals which your sketch could generate using the shield.
It may make your life a lot easier.

will need a program running on the tablet to read and interpret the command from the Arduino. Do you have such a program ?

No, I do not have such a program. Where could I find documentation for one?

You may also require an OTG cable too, to allow two way communications between both devices.
That would allow you to also interpret serial signals which your sketch could generate using the shield.

I have the cable it came with plugged into a usb charger, to keep the tablet powered. Although that cable can also be used to import files from my computer onto the tablet Would that be an OTG cable? (Also, right now I'm using a micro SD card to store all the files and memory on the tablet)

If so, would I need a splitter so I can keep the tablet powered and still have two way communications between both devices?

An OTG cable is a different device to a regular charge/sync cable

You might want to research it.

I will, thanks.

But where would I go from there? How would I get the Arduino to actually communicate with the Tablet?

(I know there's apps on the tablet which you can download and they allow the Tablet to control the Arduino, but I'm looking for the opposite. Are there any apps which currently do this? Is there a way to wirelessly (through Bluetooth or WIFI) to have the tablet receive signals from the Arduino?)

Something as simple as a serial terminal would probably provide a good start to get the idea.
There are plenty out there for Android and Apple.

Get used to that then decide where and how you want to progress.

Yes you can also do similar with WiFi and Bluetooth BTW.

Remember, though, that Android is pretty fussy about anything that could present a security risk, hence the relative paucity of remote control programs for Android devices.

Not saying it can't be done, but there will probably be hoops to jump through for the app developer.

I will look into that, but I just though of this now:

Right now, I also have a Rasperry Pi connected to the Arduino, and the Arduino triggers the Raspberry Pi by acting as a virtual button which tells the Pi to play a certain sound FX.

Perhaps I can use the Pi to trigger apps on the tablet, and use the Arduino to trigger the Pi. With all that combined, I'll have the Arduino trigger the Pi by writing the Pi's pins either Low or High, and as a result the Pi would then trigger the tablet apps.

Would that be easier or should I just stick solely to the Arduino?

An OTG device would not break any security on an Android device and even if access was needed it's just a matter of turning on DEVELOPER mode.

Understood - thanks, @Ballscrewbob . :+1:

Ah, yes, so you could emulate a mouse or keyboard? Or, of course, set up some kind of serial data link, as you suggested previously. Very nice. :grinning:

Opening apps can be done using a USB keyboard connected via USB OTG cable to an Android device. An Arduino board emulating a USB keyboard should be able to do the same. However, the best Arduino board for USB Keyboard emulation is one based on the ATmega32u4 chip such as Leonardo, Pro Micro, and Micro. USB OTG cable required.

This article is 10 years old but is still relevant.

https://www.pcworld.com/article/184656/android_keyboard_shortcuts.html

This does sound promising. But, how would I go about programming that, assuming the OTG cable is connected from the Tablet to the Arduino (How do I program a USB keyboard emulation on the Arduino)?

And how would I charge the tablet/give it constant power through the micro USB port (since the OTG cable will go in the Tablet's USB micro port, which is where the charging cable goes)?

Hi.

You can certainly send commands from the Arduino to your Android and vice-versa. That's not hard.

You need to learn how to build apps. Most people start this journey with MIT App Inventor. There are many examples of apps to connect Android and Arduino via Bluetooth you can build on.

There is an app that can check if your Android is OTG compatible (not all devices are). OTG is great for uploading yr app to the Android, but more common is via Bluetooth or the Internet.

Starting an app from within an app is apparently possible with MIT App Inventor, but it doesn't look particularly simple:

Starting app from an app. Read text under "Activity Starter".

There's lots to learn to achieve yr aim, but all good stuff. Good luck.