Code Monkey home page Code Monkey logo

autonomous-follow-me-cooler's Introduction

Autonomous-Follow-Me-Cooler

Our autonomous cooler has two modes: GPS Streaming and GPS Waypoint. While in GPS Streaming mode, the cooler will follow you by streaming coordinates from your phone. In GPS Waypoint mode, you can send a predetermined set of coordinates that the cooler will travel to.

Disclaimer: When testing the cooler, we noticed that the GPS coordinates streamed from Blynk were often inaccurate. While it works for some locations, it doesn't for others. If you want high precision, we highly suggest creating your own Android app to stream GPS coordinates.

Installation

All files for this project are contained in the /cooler directory. Open the directory and click the cooler.ino. The Arduino IDE should open with all of the files in that directory.

Dependencies

You need to make sure to install the following dependencies through the Arduino library manager (Sketch->Include Library->Manage Libraries...)

Setup

You'll need to configure a few variable definitions for the code to work with your configuration. CoolerDefinitions.h contains variables that you can edit to switch pins, tweak parameters, and configure your Blynk app.

Blynk

The most notable is the char auth[] variable. Replace the auth string (inside the quotes) with the auth token generated by your Blynk app.

Pin Configuration

Most of the components on this robot are connected via Digital I/O pins. These pins can be changed by adjusting the following variables in CoolerDefinitions.h.

#define SERVO_PIN 3

#define GPS_TX_PIN 6

#define BLUETOOTH_TX_PIN 10
#define BLUETOOTH_RX_PIN 11

#define MOTOR_A_EN_PIN 5
#define MOTOR_B_EN_PIN 9
#define MOTOR_A_IN_1_PIN 7
#define MOTOR_A_IN_2_PIN 8
#define MOTOR_B_IN_1_PIN 12
#define MOTOR_B_IN_2_PIN 4

Make sure that the following pins are connected to PWM ports (we had no available PWM ports left when everything was attached):

#define SERVO_PIN 3
#define GPS_TX_PIN 6
#define BLUETOOTH_TX_PIN 10
#define BLUETOOTH_RX_PIN 11
#define MOTOR_A_EN_PIN 5
#define MOTOR_B_EN_PIN 9

Parameters

The following variables were used for configuration. Adjust them as you see fit.

// If one motor tends to spin faster than the other, add offset
#define MOTOR_A_OFFSET 20
#define MOTOR_B_OFFSET 0

// You must then add your 'Declination Angle' to the compass, which is the 'Error' of the magnetic field in your location.
// Find yours here: http://www.magnetic-declination.com/
// Mine is: 13ยฐ 24' E (Positive), which is ~13 Degrees, or (which we need) 0.23 radians
#define DECLINATION_ANGLE 0.23f

// The offset of the mounting position to true north
// It would be best to run the /examples/magsensor sketch and compare to the compass on your smartphone
#define COMPASS_OFFSET 0.0f

// How often the GPS should update in MS
// Keep this above 1000
#define GPS_UPDATE_INTERVAL 1000

// Number of changes in movement to timeout for GPS streaming
// Keeps the cooler from driving away if there is a problem
#define GPS_STREAM_TIMEOUT 18

// Number of changes in movement to timeout for GPS waypoints
// Keeps the cooler from driving away if there is a problem
#define GPS_WAYPOINT_TIMEOUT 45

In order for our servo-driven lid to work, we had to fine tune the start and stop angle so that we could get the right leverage on the lid. They can be given a value between 0 and 180.

// PWM write for servo locations
#define SERVO_LID_OPEN 20
#define SERVO_LID_CLOSE 165

Running the Code

Once you have everything configured property, verify and upload the code to your Arduino. If you are outside, it will take a few seconds for the GPS to acquire a satellite lock. Once it does, it will begin flashing.

Make sure your android device is paired with HC-05 bluetooth module. If it asks for a password, it should be default 1234. Open Blynk and press play!

If your computer is connected via USB, you can also open the serial monitor and observe events on 4800 baud rate.

If you have any problems, please post an issue and we'll try to help solve it.

autonomous-follow-me-cooler's People

Contributors

atainter avatar

Stargazers

amith meledath avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.