Git Product home page Git Product 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

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

autonomous-follow-me-cooler's Issues

GPS

I used gyneo6mv2 instead of Parallax. But to get the information rx and tx need to be connected. Am I true ?
Can you help me please ?
E mail: [email protected]

please,i need help for massage error

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino/Genuino Uno"

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:4:0:

CoolerDefinitions.h:2:11: error: redefinition of 'char auth []'

char auth[] = "blynk-token";

       ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

C:\Users\Win10\Documents\Arduino\libraries\Cooler/CoolerDefinitions.h:2:6: note: 'char auth [12]' previously defined here

char auth[] = "blynk-token";

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:4:0:

CoolerDefinitions.h:49:8: error: redefinition of 'struct GeoLoc'

struct GeoLoc {

    ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

CoolerDefinitions.h:49:8: error: previous definition of 'struct GeoLoc'

struct GeoLoc {

    ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:4:0:

CoolerDefinitions.h:54:6: error: multiple definition of 'enum CoolerLid'

enum CoolerLid {

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

C:\Users\Win10\Documents\Arduino\libraries\Cooler/CoolerDefinitions.h:54:6: note: previous definition here

enum CoolerLid {

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:7:0:

CoolerDefinitions.h:2:11: error: redefinition of 'char auth []'

char auth[] = "blynk-token";

       ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

C:\Users\Win10\Documents\Arduino\libraries\Cooler/CoolerDefinitions.h:2:6: note: 'char auth [12]' previously defined here

char auth[] = "blynk-token";

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:7:0:

CoolerDefinitions.h:49:8: error: redefinition of 'struct GeoLoc'

struct GeoLoc {

    ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

CoolerDefinitions.h:49:8: error: previous definition of 'struct GeoLoc'

struct GeoLoc {

    ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:7:0:

CoolerDefinitions.h:54:6: error: multiple definition of 'enum CoolerLid'

enum CoolerLid {

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

C:\Users\Win10\Documents\Arduino\libraries\Cooler/CoolerDefinitions.h:54:6: note: previous definition here

enum CoolerLid {

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:20:0:

c:\users\win10\appdata\local\temp\arduino_build_440638\sketch\coolerdefinitions.h:2:11: error: redefinition of 'char auth []'

char auth[] = "blynk-token";

       ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

C:\Users\Win10\Documents\Arduino\libraries\Cooler/CoolerDefinitions.h:2:6: note: 'char auth [12]' previously defined here

char auth[] = "blynk-token";

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:20:0:

c:\users\win10\appdata\local\temp\arduino_build_440638\sketch\coolerdefinitions.h:48:8: error: redefinition of 'struct GeoLoc'

struct GeoLoc {

    ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

CoolerDefinitions.h:49:8: error: previous definition of 'struct GeoLoc'

struct GeoLoc {

    ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:20:0:

c:\users\win10\appdata\local\temp\arduino_build_440638\sketch\coolerdefinitions.h:53:6: error: multiple definition of 'enum CoolerLid'

enum CoolerLid {

  ^

In file included from C:\Users\Win10\Desktop\Cooler\Cooler.ino:1:0:

C:\Users\Win10\Documents\Arduino\libraries\Cooler/CoolerDefinitions.h:54:6: note: previous definition here

enum CoolerLid {

  ^

exit status 1
redefinition of 'char auth []'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

on board GPS no data

With following
hackster.io
https://www.hackster.io/hackerhouse/make-an-autonomous-follow-me-cooler-7ca8bc
(and yes I have attempted to contact the project owners and asked in the comments of the post)
I’ve succeeded in creating the circuit. But I need help with the GPS output.
when I send it “a text” through the blynk app it shows up on the serial monitor as-
Received Text: 746, 5
Waypoint found: 746.005.00
Reading onboard GPS:

But the onboard GPS never sets anything.
the GPS light is blinking [which means its got a fix]
If I plug the GPS TX pin into pin 1 and set the #define GPS_TX_PIN to 1 it gives me the raw GPS data over the serial monitor which is correct if I enter it into google maps. and on u-center, it says its connected to about 7 GPS’s.
But I can’t figure out why the GPS won’t feed this information through.
Any help is appreciated
Thanks

GPS Streamer

Hi,
I have uploaded the code and set up the bluetooth connection with Blynk. But, I could not get any GPS data from GPS Stream of Blynk app. Can you please identify the problem.
Thank you.

Compiling with Platform.io in VSCode Error

Any idea on how to compile the code in platform.io? I already fixed the library issues.

`

  • Executing task in folder AutonomousFollowMe: C:\Users\rnylz.platformio\penv\Scripts\platformio.exe run

Processing uno (platform: atmelavr; board: uno; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/uno.html
PLATFORM: Atmel AVR (5.0.0) > Arduino Uno
HARDWARE: ATMEGA328P 16MHz, 2KB RAM, 31.50KB Flash
DEBUG: Current (avr-stub) External (avr-stub, simavr)
PACKAGES:

  • framework-arduino-avr @ 5.2.0
  • toolchain-atmelavr @ 1.70300.191015 (7.3.0)
    LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 10 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- Adafruit Unified Sensor @ 1.1.14
    |-- Servo @ 1.2.2
    |-- Adafruit HMC5883 Unified @ 1.2.3
    |-- Wire @ 1.0
    Building in release mode
    Linking .pio\build\uno\firmware.elf
    C:\Users\user\AppData\Local\Temp\cc1HPLnT.ltrans0.ltrans.o: In function main': <artificial>:(.text.startup+0x86): undefined reference to setup'
    :(.text.startup+0x8e): undefined reference to `loop'
    collect2.exe: error: ld returned 1 exit status
    *** [.pio\build\uno\firmware.elf] Error 1
    ============================================================================== [FAILED] Took 2.60 seconds ==============================================================================
  • The terminal process "C:\Users\user.platformio\penv\Scripts\platformio.exe 'run'" terminated with exit code: 1.
  • Terminal will be reused by tasks, press any key to close it.
    `

Verifying

The code that you provided will not compile to Arduino coding program. Any suggestions??

GPS Param Error

'GpsParam' was not declared in this scope; did you mean 'param'?

Does not move

i get sat lock and changed the auth and the radians for the declination angle. however i am having trouble finding out how to do the compass will that affect the moving of the project

like i said i get lock
i get bluetooth lock
light is on on the motor driver
i double checked my wiring.

What should i do next.

geoBearing function explanation

Hi, I'm sorry for the improper use of the "issues" page but I didn't find a way to contact you!
I would some explanation concerning the "geoBearing" function because I'm doing a similar project but with two Android (one on arduino and one phone, connected via ESP8266 to Arduino), but I don't understand the calculation that you have done in this function: I mean, I haven't understand why is not as I written in my code , without sin and cos :

  float y = latPhone - latArd;
  float x = lonPhone - lonArd;
  dirPhone = 2 * atan( y / ( sqrt(x * x + y * y) + x)); //gived in Radians
  dirPhone = dirPhone * 180 / M_PI;  //radians to grade

I haven't tested it in an open space, but if you can explain to me why it is wrong to not considerate sin and cos, it would be great!
Thanks in advance!

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.