Theft of goods is rampant in Indonesia today because it is first influenced by economic factors, then the lack of awareness from the local community in protecting their personal belongings, thus creating opportunities for thieves to be able to act. Therefore, this project was created as an effort to improve the security of goods in close proximity. In this case, the author tries to use the UART protocol on the Arduino and Wemos side. This project has been implemented and took approximately 1 month. There are 2 types of development boards used. Arduino Pro Micro is used to hold the coordinate data obtained from the sensor, then send the coordinate data to Wemos D1 Mini using UART communication protocol: Hardware Serial. While the Wemos D1 Mini is used to accommodate coordinate data from the Arduino Pro Micro using the UART communication protocol: Software Serial. Furthermore, the raw data that has been received is processed into useful information, then sent to the Telegram Bot. This Telegram bot can respond to users if there is interaction in it. The benefit of making this project is none other than to add insight. The result of this project is that the coordinates of personal items can be monitored at any time easily and quickly only through Telegram Bot, so that existing items will not be easily stolen. However, if the item is out of the router's range, it can be completely lost. To overcome this shortcoming, you can add a GSM module that comes with a SIM card in future research.
Part | Description |
---|---|
Development Board | • Arduino Pro Micro Leonardo ATMEGA32U4 • Wemos D1 Mini |
Code Editor | Arduino IDE |
Application Support | Telegram Bot |
Driver | CH340 USB Driver |
Communications Protocol | • Universal Asynchronous Receiver-Transmitter (UART) • MTProto |
IoT Architecture | 3 Layer |
Programming Language | C/C++ |
Arduino Library | • SoftwareSerial (default) • TinyGPS++ • CTBot • ArduinoJson |
Sensor | GPS NEO6MV2 (x1) |
Other Components | • Micro USB cable - USB type A (x1) • Jumper cable (1 set) • Li-ion battery 18650 5V (x1) • 1-Slot battery holder (x1) • Micro USB cable - 2 pin JST (x1) |
-
Arduino IDE
https://bit.ly/ArduinoIDE_Installer
-
CH340 USB Driver
https://bit.ly/CH340_USB_Driver
Block Diagram | Pictorial Diagram |
---|---|
Wiring |
---|
Basically, a device can be communicated with other devices either wirelessly or by cable. Communication between commonly used hardware is Serial Communication
. It can be known that there are three types of Serial Communication
, which include: UART (Universal Asynchronous Receiver-Transmitter)
, SPI (Serial Peripheral Interface)
, and I2C (Inter Integrated Circuit)
. Serial UART communication
allows each device to act as a master
or slave
in a limited way. Master
is the primary device that has full authority over the control of the Slave, while the Slave
is the secondary device that is under the authority of the Master device. There are two kinds of UART Serial Communication
, namely Hardware Serial
and Software Serial
. Hardware serial communication
can be done by connecting the TX
and RX
pins crosswise
on each development board, for example: RX-TX
, then TX-RX
. The TX
pin is for sending data
, while the RX
pin is for receiving data
. Serial Software Communication
is more or less the same as Serial Hardware Communication
in terms of cabling, but there are differences in terms of coding. By using this Serial Software
you can overcome the constraints of the limitations of RX
and TX
pins on the development board. To communicate with this Serial Software
is quite easy, namely by using certain Digital Pins
as a substitute for TX pins and RX pins
.
The Arduino Pro Micro
has several pins that can support Software Serial
which include :
Pin Name | Support |
---|---|
8 | RX and TX |
9 | RX and TX |
10 | RX and TX |
16 | RX and TX |
14 | RX and TX |
15 | RX and TX |
Other Digital pins | TX only |
The Wemos D1 Mini
has several pins that can support Software Serial
which include :
Pin Name | Support |
---|---|
D0 | TX only |
D1 | RX and TX |
D2 | RX and TX |
D3 | RX and TX |
D4 | RX and TX |
D5 | RX and TX |
D6 | RX and TX |
D7 | RX and TX |
D8 | RX and TX |
Wemos D1 Mini Pinout Reference : Click Here
-
Open the
Arduino IDE
first, then open the project by clickingFile
->Open
:•
APmicro_gpstracker.ino
•
WD1mini_bot.ino
-
Fill in the
Additional Board Manager URLs
in Arduino IDEClick
File
->Preferences
-> enter theBoards Manager Url
by copying the following link :http://arduino.esp8266.com/stable/package_esp8266com_index.json
-
Board Setup
in Arduino IDEi
How to setup the
Arduino Pro Micro
boardClick
Tools
->Board
->Arduino AVR Boards
->Arduino Micro
ii
How to setup the
Wemos D1 Mini
board• Click
Tools
section ->Board
->Boards Manager
-> Installesp8266
.• Then click
Tools
->Board
->ESP8266 Boards
->Wemos D1 Mini
.
-
Change the Board Speed
in Arduino IDEi
How to change the speed of
Arduino Pro Micro
boardClick
Tools
->Upload Speed
->9600
ii
How to change the speed of
Wemos D1 Mini
boardClick
Tools
->Upload Speed
->115200
-
Install Library
in Arduino IDEDownload all the library zip files. Then paste it in the:
C:\Users\Computer_Username\Documents\Arduino\libraries
-
Port Setup
in Arduino IDEClick
Port
-> Choose according to your device port(you can see in device manager)
-
Change the
WiFi Name
,WiFi Password
, and so on according to what you are currently using. -
Before uploading the program please click:
Verify
. -
If there is no error in the program code, then please click:
Upload
. -
If there is still a problem when uploading the program, then try checking the
driver
/port
/others
section.
-
Open @BotFather.
-
Type
/newbot
. -
Type the desired bot name, for example:
personalgps_bot
. -
Type the desired bot username, for example:
personalgps_bot
. -
Also do it for bot image settings, bot descriptions, and so on according to your needs.
-
Copy
your telegram bot API token
-> then paste it into the#define botToken "YOUR_API_BOT_TOKEN"
section.For example :
#define botToken "2006772150:AAE6Fdjk3KbiySkzV6CLbd6ClJDzgTfJ5y0"
-
Download and extract this repository.
-
Make sure you have the necessary electronic components.
-
Make sure your components are designed according to the diagram.
-
Configure your device according to the settings above.
-
Please enjoy [Done].
Via Telegram: @personalgps_bot
GPS Device |
---|
Telegram Bot | |
---|---|
You can download the component test file via the following link: Click Here
If this work is useful to you, then support this work as a form of appreciation to the author by clicking the ⭐Star
button at the top of the repository.
This application is my own work and is not the result of plagiarism from other people's research or work, except those related to third party services which include: libraries, frameworks, and so on.
MIT License - Copyright © 2024 - Devan C. M. Wijaya, S.Kom
Permission is hereby granted without charge to any person obtaining a copy of this software and the software-related documentation files to deal in them without restriction, including without limitation the right to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons receiving the Software to be furnished therewith on the following terms:
The above copyright notice and this permission notice must accompany all copies or substantial portions of the Software.
IN ANY EVENT, THE AUTHOR OR COPYRIGHT HOLDER HEREIN RETAINS FULL OWNERSHIP RIGHTS. THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, THEREFORE IF ANY DAMAGE, LOSS, OR OTHERWISE ARISES FROM THE USE OR OTHER DEALINGS IN THE SOFTWARE, THE AUTHOR OR COPYRIGHT HOLDER SHALL NOT BE LIABLE, AS THE USE OF THE SOFTWARE IS NOT COMPELLED AT ALL, SO THE RISK IS YOUR OWN.