Send Image From Arduino to MIT App Inventor via USB OTG(Preferred) or Bluetooth

414 views
Skip to first unread message

Shounak Ray

unread,
Jan 5, 2018, 1:28:59 AM1/5/18
to MIT App Inventor Forum

Hello MIT AI Community!


**I am using [Arduino]:

Microcontroller --> OSEPP UNO R3 PLUS  (essentially the same as the UNO)

Bluetooth Module-> HC-08 Bluetooth Module

USB OTG Connector

7.1.1 Android Phone

**

 

Currently, I only have an Arduino sketch which basically detects whether or not the distance registered from an ultrasonic sensor (hooked to the Arduino) is below 10 centimeters. This works fine.

 

First of all, I want this data to be sent to an app on MIT App Inventor with live results (ex. As I move my hand next to the ultrasonic sensor, if the distance is below 10 centimeters, then it should indicate so on the app's interface (coded through MIT App Inventor).

 

1. Do android phones only recognize BLE devices from an Official Arduino UNO? Becuase my Android detects the HC-08, however, it is unable to connect...


2. How am I supposed to send information from the Arduino Module to the Android Phone via USB OTG (w/o Bluetooth of course)? What does the code in the MIT APP INVENTOR project look like?

Next, another major component of my project requires the transferring of images from the Arduino to the app. I have researched many different ways to transmit the images (although almost all of what I search up is live video transmission) and I have stumbled across two ways:

-   Store on an SD card connected to Arduino, take picture, store it on card, view the picture by plugging

    card into another device (LEAST PREFERRABLE)

-   A direct transmission of the image onto the device (MOST PREFERRABLE)

There may be more methods I have yet to discover...

 

3. How do I send an image from the Arduino to the Android Phone? What camera should I use and what does the [MIT App Inventor] coding look like to receive a picture from a Bluetooth source or via USB OTG and store it in the phone's gallery?

 

Please let me know.

  

Thanks for the support!

Ghica

unread,
Jan 5, 2018, 12:09:02 PM1/5/18
to MIT App Inventor Forum
I do not think that AI2 will recognize whether you have an official UNO.
What does your sketch look like, and how are your trying to connect to the Arduino? Is it following the BLE protocol? Can you show AI2 blocks of what you tried?
Did you try to pair the phone first?
You could try to use one of those debugging apps to see if you can make connection with your phone.
Cheers, Ghica.

gerrikoio

unread,
Jan 7, 2018, 3:28:09 PM1/7/18
to MIT App Inventor Forum
1. You need to configure your HC-08 as a slave device using the AT commands within your arduino uno code and you also need to make sure the BLE device is discoverable by turning on advertising.

2. Search forum for "serial OTG". Your phone needs to be OTG compliant.

3. As per 2. For camera, search online for "serial camera fifo". You would probably need an SD card shield / breakout board to store image, especially if large image, as Arduino not capable (memory constraints). Otherwise, you will have to handle buffering of image data transfer if trying to send a live image via serial OTG cable. Buffer method might be possible for small images with a fifo serial camera.
Reply all
Reply to author
Forward
0 new messages