Arduino Bluetooth Camera

5,768

25

15

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.

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 (!)

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

This is an entry in the
Arduino Contest 2019

Share

    Recommendations

    • Tape Contest

      Tape Contest
    • Trash to Treasure

      Trash to Treasure
    • Arduino Contest 2019

      Arduino Contest 2019

    15 Discussions

    0
    None
    SzehuaiC

    1 day ago

    can I change the camera? I see there are 18 pins on the camera you used

    1 reply
    0
    None
    A81010SzehuaiC

    Reply 11 hours ago

    Thanks for asking.
    Of course, you can connect various cameras. Directly - if pinout corresponds to pinout OV7670, or by means of wires. 19 and 20 pins duplicate the 17 and 18 pins - this is intended for cameras whose data bus is 10 bits (instead of 8), for example, such cameras:
    http://www.arducam.com/wp-content/uploads/2012/11/OV2640-4.jpg
    https://www.waveshare.com/img/devkit/accBoard/OV9655-Camera-Board/OV9655-Camera-Board-5.jpg
    Of course, you need to write your register initialization file (by analogy with the file ov7670_regs.h).
    At the moment, the following cameras have been tested:
    OV7670, OV2640, OV9653, TCM8210, ADCM2700.
    All cameras managed to successfully connect.

    OV9655-Camera-Board-5.jpg111.jpg
    0
    None
    A81010guedda

    Answer 4 days ago

    Unfortunately, this is not currently possible.

    1
    None
    johweb

    Question 5 days ago

    Hello ! Nice project here. Would you agree to share your android app sources ?

    3 answers
    0
    None
    A81010johweb

    Answer 4 days ago

    Hello. Thank. I will not post the source code for android here. If you have questions - write to the mail.

    0
    None
    gueddajohweb

    Answer 4 days ago

    And thanks for the answer

    0
    None
    gueddajohweb

    Answer 4 days ago

    I do not know exactly. This type of TFT shield:
    ITEAD 2.4 TFT LCD TOUCH SHIELD
    Or
    LCD TFT SPI 1.8 "SD CARD

    11.PNG22.PNG
    0
    None
    guedda

    4 days ago

    Can I use another type of TFT Shield display?