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).
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.
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:
If the Arduino UNO board is successfully programmed, you can proceed to the next step.
On the Android phone, you need to install the ArduinoTFT.apk. Allow the app to use the Bluetooth and Camera.
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 (!)
Assembly of the device is quite simple:
After turning on the power, the TFT shield's screen should turn red. This means the willingness to receive commands from the Android phone.
Perform the following operations on the Android phone:
Two windows and four buttons should appear on the screen:
Button functions:
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!