Arduino Bluetooth Camera

24,317

104

51

Introduction: Arduino Bluetooth Camera

Hello!

Today you can hardly surprise anyone with a mobile phone with a camera, wireless gadgets and other technical advances. Thanks to the Arduino platform, millions of people have discovered the wonderful world of electronics and programming. 100,500 instructions were written on how to exchange data between a mobile phone and Arduino via bluetooth ... What am I talking about? Yes. I want to exchange data between a mobile phone on Android and Arduino UNO through bluetooth in 100,501 times. But I want to transmit not just a set of characters and numbers, but pictures.

Someone will say that this is impossible, Arduino is too slow to process large amounts of data with good speed. And he will be absolutely right. And what if a little bit of help Arduino - to transfer all the "hard" work on the shoulders of other device? And there is such a device!

This is a unique TFT shield for Arduino. Information about this logo is in these articles: article 1, article 2. In this instructables, I will demonstrate how you can connect via bluetooth between Arduino and Android phone, get a picture from the OV7670 camera on Arduino UNO and transfer it to Android phone. Then, on the contrary, transfer the picture (image from the camera) from the Android phone to Arduino UNO and display it on the screen of a unique TFT shield.

A special application was written for the Android phone.

Brief characteristics of TFT shield:

  • Size 3.5 " diagonal,

  • Resolution 320x240,

  • Number of colors 65536 (16-bit),

  • Resistive touch screen (XPT2046 controller),

  • 5 buttons,

  • RTC IC DS1307 with 3V lithium battery CR1220,

  • Slot for connecting a micro SD card,

  • 4-pin (2.54 mm) connector for connecting the Bluetooth module HC-05 (-06), ESP8286 WiFi module.

  • 20-pin (2.54 mm) connector for camera (OV7670).

Step 1: List of Components Needed

Hardware:

  1. Arduino UNO;
  2. Unique TFT shield;
  3. AC-DC power adapter 6-12 volt, >600mA;
  4. Camera OV7670;
  5. Bluetooth module HC-06 (HC-05);
  6. Android phone.

Attention: It is necessary (!) To use a 6-12 volt power adapter to operate the TFT shield, because the maximum current of 500 mA from USB is not enough for normal operation.

Software:

  1. Arduino IDE;
  2. Library for Unique TFT shield;
  3. APK file for Android phone.

Step 2: Preparing

Software

All demonstration sketches are written in the Arduino IDE environment, therefore at the beginning it is necessary to install the Arduino IDE - https://www.arduino.cc/en/main/software.
Then you need to install a library for TFT shield - github.com/YATFT/YATFT (download the library and unpack it into the "libraries" folder in the Arduino IDE directory).

After installing the Arduino IDE, you must program the Arduino UNO board. For simplicity, I recommend flashing it separately, without TFT shield. For this:

  • Connect the USB cable to the Arduino UNO board;
  • Run the Arduino IDE on the computer;
  • Select the corresponding port to which the Arduino UNO is connected;
  • Download the ArduinoBluetoothCamera.ino demo sketch (and file ov7670_regs.h for camera init);
  • Click the button Upload.

If the Arduino UNO board is successfully programmed, you can proceed to the next step.

Android

On the Android phone, you need to install the ArduinoTFT.apk. Allow the app to use the Bluetooth and Camera.

Update 07/25/2020 (Thanks to fano13250)

Hi, i had the same problem with the Android App wich doesn't work.
Solved after authorized the App to access at the smartphone camera. That's it. Bye

Bluetooth module

It is necessary to set the exchange rate in the Bluetooth module to be 115200 (command "AT+UART=115200,0,0"). This is the optimal speed at which Arduino UNO manages to receive and process data. (Theoretically, you can increase the speed, optimize data reception and processing, but this requires a larger amount of RAM).
More detailed instructions on how to set the exchange rate can be found on the Internet, for example, here: https://www.instructables.com/id/Communication-Bluetooth-Module-With-HC-05-HC-06/ .

(!) Please note that the Bluetooth module connects to the debug port of Arduino UNO. Thus, when working with bluetooth, the debug port is not available. And before programming the Arduino UNO (complete with the Bluetooth module) must disconnect the Bluetooth module. And after programming, set it back (!)

Update 05/26/2020 !

I added sourcecode of ArduinoTFT.apk. AS IS! Download ArduinoTFT.zip.h , rename to ArduinoTFT.zip and unzip. Enjoy!

Step 3: Assembly

Assembly of the device is quite simple:

  • Connect together Arduino UNO and TFT-shield;
  • Connect the OV7670 camera to the 20-pin connector on the TFT-shield of the shield (sometimes I use an angled 18-20 pin connector with a 2.54 mm pitch as an adapter);
  • Connect the Bluetooth module HC-06 (HC-05) to the 4-pin connector with the words "Bluetooth" on the TFT-shield;
  • Connect the 6-12V power adapter to the power input on the Arduino UNO board.

After turning on the power, the TFT shield's screen should turn red. This means the willingness to receive commands from the Android phone.

Step 4: Demonstration

Perform the following operations on the Android phone:

  • Launch the ArduinoTFT application on the Android phone;
  • Turn the phone in a horizontal position;
  • Enable the Bluetooth connection, select the detected Bluetooth module (HC-06);

Two windows and four buttons should appear on the screen:

  1. The top right window is the phone's camera viewfinder window;
  2. Large left window - received or sent images.

Button functions:

  1. Transfer single image from Android phone to Arduino;
  2. Continuous transfer of images from the Android phone to Arduino;
  3. Transfer single image from Arduino to Android phone;
  4. Continuous transfer of images from Arduino to Android phone.

The image size is 320x240 pixels (2-5 kB). This chapter has a demo video.

If you like my instructable, I would appreciate an assessment. Perhaps this will give me motivation for new instructables :-)

Thanks for attention!

Arduino Contest 2019

Participated in the
Arduino Contest 2019

Be the First to Share

    Recommendations

    • Microcontroller Contest

      Microcontroller Contest
    • Automation Contest

      Automation Contest
    • Make it Glow Contest

      Make it Glow Contest

    51 Comments

    0
    DeadW
    DeadW

    23 hours ago

    Hi, I'm having a few errors with the code any chance you could help me?

    0
    khushi06pal
    khushi06pal

    4 months ago

    Sir is it possible to send images to phone through ov 7670 camera module without using tft lcd screen ?

    0
    A81010
    A81010

    Reply 4 months ago

    Why not?

    0
    chithirans
    chithirans

    1 year ago

    amazing.... i want to know how to transfer files from android phone to arduino please give me a solutions.

    0
    A81010
    A81010

    Reply 4 months ago

    "Study, study and study again!" Vladimir Ulyanov (Lenin)

    Lenin.jpeg
    0
    ahmedshahjilani
    ahmedshahjilani

    1 year ago

    Mobile app is not working ..
    Error displays 'Unfortunately, Arduino TFT has stopped'

    Any solution ?

    0
    fano13250
    fano13250

    Reply 7 months ago

    Hi, i had the same problem with the Android App wich doesn't work. Solved after authorized the App to access at the smartphone camera. That's it. Bye

    0
    A81010
    A81010

    Reply 7 months ago

    Stephane! Thank you very much!

    0
    A81010
    A81010

    Reply 1 year ago

    Hello! Do you read other comments before writing your own?

    0
    ahmedshahjilani
    ahmedshahjilani

    Reply 1 year ago

    Yes and i tried all. App is not open on multiple devices. I tried on 5 to 6 phones but apk application shows same error on all phones

    0
    A81010
    A81010

    Reply 1 year ago

    Which application do you install? Give the exact name.

    0
    zzigrri
    zzigrri

    10 months ago

    Hello, I download the app for Android, install it, and run it, it won't run due to an error. If you don't mind, could you send me the source code file for Android studio via email? My e-mail address is zzigrri@gmail.com.Thank you very much.

    0
    fano13250
    fano13250

    Reply 7 months ago

    Hi, i had the same problem with the Android App wich doesn't work. Solved after authorized the App to access at the smartphone camera. That's it. Bye

    0
    Muhammad Abdul Rehman
    Muhammad Abdul Rehman

    Question 7 months ago

    Is it possible to send images from ov7670 via bluetooth to an android phone without using the tft shield.?

    0
    A81010
    A81010

    Answer 7 months ago

    Why not?

    0
    bacato234
    bacato234

    Question 1 year ago on Introduction

    What is your alternative hardware if you dont have a unique tft shield ??

    0
    gerarca88
    gerarca88

    1 year ago

    When I open APP Android this message appears "Unfortunately, ArduinoTFT has Stopped"

    0
    A81010
    A81010

    Reply 1 year ago

    What device are you running the app on? Try before starting the application to turn on bluetooth on your device and connect to HC-06. And try to keep the phone horizontal.

    0
    gerarca88
    gerarca88

    Reply 1 year ago

    I have a Samsumg Galaxy S4.
    I'm using CH-05, i's configurated and it work with anotrher code.
    the phone should keep the phone horizontal to it work ????