|
| 1 | +# Auto-following Suitcase Application |
| 2 | +This application is designed to show how to develop an **Auto-following Suitcase** using embARC.A person holding a tag in hand,three ultra-wideband anchors should be installed inside the suitcase in an equilateral triangular shape with a side length of 20cm. The distance information measured by the UWB module is transmitted to EMSK through UART.Based on the principle of three-point positioning,the azimuth between the person and the suitcase can be obtained to achieve following.This suitcase can also monitor ambient temperature and air conditions.When the distance between the trunk and the owner exceed the preset ,the trunk will stop automatically,and then sound the alarm or call the mobile phone, so you don't have to worry about losing the trunk.This design is mainly suitable for flat and open indoor applications such as airport waiting halls. |
| 3 | + |
| 4 | +* [Introduction](#introduction) |
| 5 | + * [Function](#function) |
| 6 | + * [System Architecture](#system-architecture) |
| 7 | +* [Hardware and Software Setup](#hardware-and-software-setup) |
| 8 | + * [Required Hardware](#required-hardware) |
| 9 | + * [Required Software](#required-software) |
| 10 | + * [Hardware Connection](#hardware-connection) |
| 11 | +* [User Manual](#user-manual) |
| 12 | + * [Before Running This Application](#before-running-this-application) |
| 13 | + * [Run This Application](#run-this-application) |
| 14 | +* [DemoVideo](#demovideo) |
| 15 | + |
| 16 | +## Introduction |
| 17 | +**Smart Auto-following Suitcase** |
| 18 | + |
| 19 | +### Function |
| 20 | + |
| 21 | +- **Ambient temperature and air condition monitoring** |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | +- **obstacle avoiding** |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +- **Auto-following** |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | +- **Auto-alarm** (The device will sound the alarm when the distance between one and suitcase is longer than 4 meters, and call the mobile phone when it is longer than 5.5 meters) |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | +### System Architecture |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +## Hardware and Software Setup |
| 43 | +### Required Hardware |
| 44 | +- 1 DesignWare ARC EM Starter Kit(EMSK) |
| 45 | +- 1 Digilent PMOD TMP2 |
| 46 | +- 1 Dust Sensor(ZPH01) |
| 47 | +- 1 Display Screen(OLED) |
| 48 | +- 1 Buzzer |
| 49 | +- 1 GPRS Module(SIM900A) |
| 50 | +- 2 Motor Driver Module(TB6612FNG) |
| 51 | +- 4 Positioning Module(DWM1000) |
| 52 | +- 4 Wheel |
| 53 | +- 4 Motor |
| 54 | +- 1 SD Card |
| 55 | +- 3 Ultrasonic Sensor(HCSR04) |
| 56 | + |
| 57 | +The list of hardware is shown in the picture following. |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | +### Required Software |
| 62 | +- Metaware or ARC GNU Toolset |
| 63 | +- Serial port terminal, such as putty, tera-term or minicom |
| 64 | + |
| 65 | +### Hardware Connection |
| 66 | +1. The EMSK implement **Auto-folowing** smart device, it will process the data returned by positioning module and ultrasonic sensor,and send instructions to motor driver module.It can also monitor temperature and dust concentration of air,we can view these data on OLED. |
| 67 | + - Connect **Positioning module** to **J1**(Using UART interface), connect **Motor driver module** to **J3** and **J6**,connect **Ultrasonic sensor** to **J1** and **J3**. |
| 68 | + - Connect **PMOD TMP2** to **J4**(Using IIC interface), connect **ZPH01** to **J5**(Using uart interface),connect **OLED** and **GPRS** to **J2**(Using IIC interface),connect **Buzzer** to **J6**. |
| 69 | +2. Configure your EMSKs with proper core configuration. |
| 70 | + |
| 71 | +## User Manual |
| 72 | +### Before Running This Application |
| 73 | +Download source code of **Auto-following Suitcase** from github. |
| 74 | + |
| 75 | +The hardware resources are allocated as following table. |
| 76 | + |
| 77 | +| Hardware Resource | Function | |
| 78 | +| ------------------- | ------------------------------------------------------------- | |
| 79 | +| PMOD TMP2 | Temperature sensor | |
| 80 | +| ZPH01 | Dust sensor | |
| 81 | +| OLED | Display screen | |
| 82 | +| SIM900A | Send messages or call | |
| 83 | +| TB6612FNG | Motor driver module | |
| 84 | +| HCSR04 | Dust sensor | |
| 85 | +| OLED | Ultrasonic sensor | |
| 86 | +| DWM1000 | Positioning module | |
| 87 | + |
| 88 | +- Modify mux.c (/board/emsk/common/emsk_init.c) |
| 89 | +``` |
| 90 | +line 107: change |
| 91 | + set_pmod_mux(PM1_UR_UART_0 | PM1_LR_SPI_S \ |
| 92 | + | PM2_I2C_HRI \ |
| 93 | + | PM3_GPIO_AC \ |
| 94 | + | PM4_I2C_GPIO_D \ |
| 95 | + | PM5_UR_SPI_M1 | PM5_LR_GPIO_A \ |
| 96 | + | PM6_UR_SPI_M0 | PM6_LR_GPIO_A ); |
| 97 | + to |
| 98 | + set_pmod_mux(mux_regs, PM1_UR_UART_0 | PM1_LR_GPIO_A \ |
| 99 | + | PM2_I2C_HRI \ |
| 100 | + | PM3_GPIO_AC \ |
| 101 | + | PM4_I2C_GPIO_D \ |
| 102 | + | PM5_UR_GPIO_C | PM5_LR_SPI_M2 \ |
| 103 | + | PM6_UR_GPIO_C | PM6_LR_GPIO_A ); |
| 104 | +``` |
| 105 | +### Run This Application |
| 106 | + |
| 107 | +Here take **EMSK2.2 - ARC EM7D** with GNU Toolset for example to show how to run this application. |
| 108 | + |
| 109 | +#### Makefile |
| 110 | + |
| 111 | +- Target options about EMSK and toolchain: |
| 112 | + |
| 113 | + BOARD ?= emsk |
| 114 | + BD_VER ?= 22 |
| 115 | + CUR_CORE ?= arcem7d |
| 116 | + TOOLCHAIN ?= gnu |
| 117 | + |
| 118 | +- The relative series of the root directory, here the path of the Makefile is |
| 119 | + |
| 120 | + # |
| 121 | + # root dir of embARC |
| 122 | + # |
| 123 | + EMBARC_ROOT = ../../.. |
| 124 | + MID_SEL = common u8glib |
| 125 | + |
| 126 | + |
| 127 | +See [ embARC Example User Guide][40], **"Options to Hard-Code in the Application Makefile"** for more detailed information about **Makefile Options**. |
| 128 | + |
| 129 | +#### Driver |
| 130 | + |
| 131 | +Placing the drivers' source code in `driver` folder, you can see there are subfolders for ultasonic,GPRS,ZPH01,buzzer and temperature drivers. |
| 132 | +Placing the C source file and header file in the corresponding subfolder. |
| 133 | + |
| 134 | +| folder/file | Function | |
| 135 | +| ------------------- | ------------------------------| |
| 136 | +| ultrasonic | ultrasonic driver | |
| 137 | +| temperature | temperature driver | |
| 138 | +| GPRS | GPRS driver | |
| 139 | +| ZPH01 | ZPH01 driver | |
| 140 | +| buzzer | buzzer driver | |
| 141 | + |
| 142 | + |
| 143 | +# DemoVideo |
| 144 | + |
| 145 | +[Link](https://v.youku.com/v_show/id_XMzYyOTY0MjcwMA==.html?x&sharefrom=android&sharekey=47f57584b11aa1e3916e149dc1b044aa0) |
| 146 | + |
| 147 | +[40]: http://embarc.org/embarc_osp/doc/embARC_Document/html/page_example.html " embARC Example User Guide" |
0 commit comments