I am new to arduino, and based on my search, it is possible to connect Android devices and Arduino board thru bluetooth module. But most solutions i found are either for controlling Arduino board using an Android app, or controlling Android app using Arduino board.
My question is, is there a way to control/interact with the Android OS on the phone using Arduino, thru whatever connection?
I am asking this because I am thinking of building a portable keyboard or touchscreen device for Android devices, and want to see if Arduino is a good platform for prototype.
-
1What do you mean "thru whatever connection"?gre_gor– gre_gor2018年03月21日 22:34:24 +00:00Commented Mar 21, 2018 at 22:34
-
Whatever = TCP/IP?MatsK– MatsK2018年03月22日 05:41:34 +00:00Commented Mar 22, 2018 at 5:41
-
@gre_gor so can be bluetooth, usb, wifi, wifi direct, etc.Yulong– Yulong2018年03月23日 02:16:04 +00:00Commented Mar 23, 2018 at 2:16
-
@MatsK that can work, but i guess it is part of wifi or cellular connection?Yulong– Yulong2018年03月23日 02:16:39 +00:00Commented Mar 23, 2018 at 2:16
-
There is wifi and cellular add-ons to Arduino that can have a TCP/IP stack and thereby you can have a program that is agnostic to what coimmunication layer you have.MatsK– MatsK2018年03月23日 14:18:18 +00:00Commented Mar 23, 2018 at 14:18
1 Answer 1
What you've seen is most usually a bluetooth module which has a "virtual COM port" service -- you connect to the bluetooth module and you can then send a data stream up and down through this COM port, just like you are able to do with a normal Serial
port.
If you want a bluetooth keyboard:
What you want for seamless integration is a bluetooth module which natively exposes a "HID" (Human Interface Device) profile. Keyboard, mice and gamepads are examples of an HID.
There is a multitude of projects which use Arduino + Bluetooth HID module:
- http://www.kobakant.at/DIY/?p=3310 uses an Arduino Pro Mini and and BlueSMiRF HID (from Sparkfun)
- Evan Kale's video: https://www.youtube.com/watch?v=BBqsVKMYz1I (uses HC05 bluetooth module with altered firmware)
- https://mitxela.com/projects/bluetooth_hid_gamepad
- Bluefruit EZ-Key: https://www.adafruit.com/product/1535
When you are a beginner you should buy the more expensive modules which don't require you to do any firmware hacking. Adafruit's product might work for you. As the description page says, you can connect a microcontroller's UART TX to the modules RX pin to send arbitrary keystrokes. You can then add a keyboard matrix, or lots of buttons, or whatever you desire to that microcontroller to make it trigger the keypresses you want.
This should get you started on your own research.
-
super detailed thanks! what about touchscreen device, is that considered as HID too?Yulong– Yulong2018年03月23日 02:18:55 +00:00Commented Mar 23, 2018 at 2:18
-
I have never seen remote touchscreens or displays on Android. I am not sure if it is possible to connect a new screen to an Android wirelessly.Maximilian Gerhardt– Maximilian Gerhardt2018年03月23日 11:02:47 +00:00Commented Mar 23, 2018 at 11:02
Explore related questions
See similar questions with these tags.