Moto Alarm Project (Linkit One Version)

Published

Introduction: Moto Alarm Project (Linkit One Version)

About: iOS developer, Arduino & Raspberry Pi lover. I love 3D printers and everything that revolves around the maker world. Father, husband and very happy. My dog Neo is the best :)

LOCATE YOUR MOTORCYCLE 24 HOURS A DAY AND 365 DAYS A YEAR

All code in GitHub repository

PROJECT FUNCTIONALITIES (For iOS or Android apps):

- You can see the position of your motorcycle at all times.

- You can see the last update date of your motorcycle's position.

- If your motorcycle is moving, speed in meters per second.

- You can activate and deactivate the service via bluetooth.

- You can see the battery status of the device.

- You can activate and deactivate the service through sms from the application.

- If your motorcycle starts to move, you will receive an alert by SMS of the change of position of the motorcycle and the speed.

- You can ask him to send you an SMS or chat to see the status of the battery.

- You can ask for the position of the motorcycle and you will receive an SMS.

- You can also ask how it is and it will send you temperature, humidity and whether it is raining or not ;)

PROJECT FUNCTIONALITIES (For macOS app):

- You can see the position of your motorcycle at all times.

- You can see the last update date of your motorcycle's position.

- If your motorcycle is moving, speed in meters per second.

- You can see the battery status of the device.

UPDATE TIMES (For iOS and Android apps):

- With the service deactivated, the status of the battery is sent every 24 hours.

- With the service activated, all data is sent every 12 hours, but if the motorcycle with MPU650 module detects movement, it is sent every 30 seconds.

- From the mobile application, you can change the default update time and adapt it to your needs, but the MPU6050 sensor will activate the services if necessary and save battery ;)

Step 1: DOWNLOAD IOS VERSION

You need to download the application that I have developed for iOS and thus receive the data of your motorcycle.

Moto Alarm Project iOS version

Step 2: DOWNLOAD MacOS Version

I'm developing this version :)

Step 3: DOWNLOAD ANDROID VERSION

I'm developing this version :)

Step 4: WHAT IS ARDUINO?

Arduino is an open-source electronics platform based on easy-to-use hardware and software. It's intended for anyone making interactive projects.

This is the manufacturer's website:

Arduino web

To program for Arduino, you need to download the Integrated development environment (IDE):

Arduino web for download software

Step 5: LINKIT ONE BOARD

For this project, I found an Arduino board that integrated all the modules I needed and had a good price: Linkit One.

The LinkIt ONE development board is an open source, high-performance board for prototyping Wearables and IoT devices. It's based on the world's leading SoC for Wearables, MediaTek Aster (MT2502) combined with high-performance Wi-Fi (MT5931) and GPS (MT3332) chipsets to provide you with access to all the features of MediaTek LinkIt. It also provides similar pin-out features to Arduino boards, making it easy for you to connect to various sensors, peripherals, and Arduino shields.

This is the manufacturer's website:

SeedStudio web

In order to use this board with the Arduino IDE, you need to follow some steps:

Linkit One Guide web

Step 6: MPU6050

MPU6050 sensor module is an integrated 6-axis Motion tracking device.

It has a 3-axis Gyroscope, 3-axis Accelerometer, Digital Motion Processor and a Temperature sensor, all in a single IC.

It can accept inputs from other sensors like 3-axis magnetometer or pressure sensor using its Auxiliary I2C bus.

If external 3-axis magnetometer is connected, it can provide complete 9-axis Motion Fusion output.

A microcontroller can communicate with this module using I2C communication protocol. Various parameters can be found by reading values from addresses of certain registers using I2C communication.

Gyroscope and accelerometer reading along X, Y and Z axes are available in 2’s complement form. Temperature reading is also available in signed integer form.

Gyroscope readings are in degrees per second (dps) unit; Accelerometer readings are in g unit; and Temperature reading is in degrees Celsius.

This module is used to send movement alert by SMS and not consume battery sending data if they are not necessary to the server.

Connection to Linkit One:

Tutorial for connection MPU6050 to Linkit One

Thanks to:

kmamaniya user

Step 7: SIM CARD

You have to add a SIM card in your Linkit One with the PIN code deactivated in order to use the GPRS connection, in addition, I use a card with SMS to be able to communicate with the motorcycle, as well as over the Internet, by normal SMS.

I use FreedomPop SIM, it is free (in my country) with:

- 200 mb for data

- 300 SMS

- 100 minutes for call

Step 8: OPEN PROJECT FROM ARDUINO IDE

***Always look at the project updates on GitHub :)

Once you have everything configured in the Arduino IDE to use your new Linkit One board, you can already clone this repository on your computer and access the MotoAlarmProject folder and open the MotoAlarmProject.ino file.

You need to download and install two libraries that are used in the project in the Arduino IDE:

ArduinoJson in GitHub

elapsedMillis in GitHub

MPU6050 in GitHub

The only class in which you need to add your data is in the PublicConstants.h class.

Your configuration data is in this class, but you only need to add the following:

- The name of the device to connect by bluetooth with the iOS application. If you do not modify it in the application or in the device code, it will be 'MotoAlarmProject'.

// Device name<br>static char deviceNameForBluetooth[] = "MotoAlarmProject";

- To configure internet access from your Linkit One with your SIM card, you must add your operator's configuration. In my case, the APN property is orangeworld and the username and password are empty.

// APN<br>static char apnName[] = "apnName";
static char apnUser[] = "";
static char apnPassword[] = "";

- To receive SMS from your Linkit One, add your phone number in userPhone property.
- Once you download the app for iOS (iPhone and iPad) and register as a user, you must put your registration email and your password in the userMail and userPassword properties respectively, so that your Linkit One can get a session token and do requests sending the data to the server. Also, look at your user id in the application profile and put it in the userId property.

// User<br>static char* userPhone = "+34600000000";
static String userMail = "\"mail@mail.com\"";
static String userPassword = "\"userPassword\"";
static String userId = "userId";

- You can also translate the texts for the SMS sent by your motorcycle to the language of your choice.

// Text for SMS and request POST<br>static String textForStatusSMS = "My coordinates on map: ";
static String textForStatusErrorSMS = "Sorry, my coordinates on map contain errors...";
static String textForBatterySMS = "Right now, I have this battery percentage: ";
static String textForFeelSMS = "I'm fine. Thank you very much! :)";
static String textForResetSMS = "Wait, I'm restarting now...";
static String textForResetSMSDisabled = "Sorry, this functionality is not in use yet...";
static String textForActivateSMS = "Perfect! My location is active :)";
static String textForDesactivateSMS = "Oops... Now my location is disabled :(";
static String textForWetSMS = "I'm very wet... ";
static String textForColdSMS = "I'm very cold... ";
static String textForHotSMS = "I'm very hot... ";
static String textForAlarmSMS = "Hey! I'm moving! Speed: ";

You can now upload the code to your Linkit One!

Step 9: ​BOX FOR LINKIT ONE AND BATTERY WITH 6000mAh (Battery Size: 19x54x54mm)

If you have a 3D printer or know someone who has it, here are the .stl files to print that I designed for the project:

STL files in Thingeverse.com by me

Step 10: BATTERY WITH 6000mAh

I have changed the battery that comes with LInkit One of 1000mAh for one of 6000mAh.

Step 11: INSTALLING IN YOUR MOTORBIKE

I have changed the original battery with 1000mAh for a battery with 6000mAh, so it lasts a lot longer without charging.

I added a usb charger to the battery in my motorcycle but in positive, that means that when I turn off the motorcycle it has no current, it only charges the powerbank when the motorcycle is on.

Step 12: BATTERY BAG FOR SECURITY (OPTIONAL)

If you do not like the batteries like me, you can use a bag of fire protection for batteries.

I could disable the GPS :(

Step 13: UPDATES FOR CODE

All the updates for the project code will continue uploading them to the public repository in the following link:

Code in GitHub repository

Step 14: DO YOU CAN'T THE DEVICE? ASK FOR MY HELP!

Don't worry, write me to my email and I can build it for you at the price of materials and shipping :)

Step 15: LEGAL CONDITIONS FOR USE MY APP (Android, IOS and MacOS)

General regulation of data protection and terms of use:

- This application needs a user registration through his email and a password.

- All the data that can be requested in the user's profile, such as: name, surname, address, telephone, etc., are optional and therefore, are not needed for the normal use of the application.

- This application is used to, by means of a device that the user constructs and places on his motorcycle, to locate it at any time by sending his location to his user account.

- The last coordinates of the motorcycle are stored in the server and no history of them is saved.

- The user has at his disposal a button in the settings of the application to delete his account and all the data associated with it.

- This application does not use analytics and does not transfer user data to third parties, nor does it exploit usage data for its benefit.

- The developer of this project is not responsible under any circumstances, that the position of the vehicle is not registered correctly.

Step 16: LICENSE

This project is free and use CC BY-NC-SA.

This license lets others remix, tweak, and build upon your work without for commercial purposes, as long as they credit you and license their new creations under the identical terms.

Step 17: THANK YOU

Nothing else, if you want to improve the Linkit One code, do not hesitate to share it with me. For any question you have, you can write me to my email in the iOS application.

Thank you very much! I hope you like it!

Microcontroller Contest

This is an entry in the
Microcontroller Contest

Share

    Recommendations

    • Casting Contest

      Casting Contest
    • Make it Move Contest

      Make it Move Contest
    • Microcontroller Contest

      Microcontroller Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    2 Comments

    Very cool. I would be seriously tempted to give this to one of my kids so that I can find them.

    1 reply