Arduino Project Hub
Project tutorial

ARDOCAM © GPL3+

Arduino 101 4WD rover and a wireless camera.

  • 3 views
  • 0 comments
  • 0 respects

Components and supplies

Ardgen 101
Arduino 101 & Genuino 101
×1
Adafruit Motor/Stepper Shield V2
×1
car chasiss
×1
Adafruit industries ada62 image 75px
USB-A to B Cable
×1
2x battery pack
×1
m2.5 standoff
×1
826 04
Male/Female Jumper Wires
×1
usb light
×1
2000 MAH power bank
×1
tenvis p2p camera andits powering cable
×1

Necessary tools and machines

09507 01
Soldering iron (generic)

Apps and online services

About this project

This project uses the Intel Arduino 101 board that has built-in IMU and Bluetooth Low Energy (BLE). For the remote control, I used the free Blynk app which is available for Android. It allows you to rapidly drag and drop some buttons to create a user interface; adding a camera makes it a spy like camera.

Wiring

  • Use jumper wires to connect the motors to M1 and M2 headers on the Arduino Motor Shield.
  • Connect the motor shield and the 5 AA battery pack. Leave the motor shield jumper removed to isolate motor power from Arduino power.
  • Remove the top plate and insert some zip ties to hold the USB battery connector.

Blynk App

  • Download the Blynk App for Android and create a new app.
  • Drag four buttons, a slider, and the BLE widget to your new app.
  • Edit the slider, it needs to write 0-255 to V0.
  • The buttons are configured as momentary push buttons; they send 1 while pressed and 0 when released: Left Forward = V1, Right Forward = V2, Left Backward = V3 Right Backward = V4.
  • From the Blynk app configuration, click the button to email the authentication token to yourself; we will use this in the Arduino app.

Arduino Software

  • Open the sketch using arduino web . I used arduino IDE but it dont work with
  • Replace the auth[] token with the one you emailed to yourself from the Blynk app created above.
  • If you have multiple Arduino 101 boards rename the blePeripheral.setLocalName and blePeripheral.setDeviceName variables so the names will be unique.
  • Download the sketch to your board twice for good measure.

Parts

  • Car Chassis
  • Polarized battery connector JST (picture)
  • 4 jumper wires
  • Arduino 101 board
  • Motor driver board (Adafruit Motor/Stepper Shield V2)
  • 4 M2.5 nylon standoffs with nuts and screws
  • 5 AA Batteries (for motors)
  • USB Battery pack (for Arduino)
  • Short USB A to USB B cable
  • 1” heat shrink
  • A few male and female header pins 0.1
  • 2 zip ties
  • 20000 mAh powerbank (I used favolcano)

My motor shield was not working correctly. The m3 and m4 is not working, so I am only connecting the m1 and m2 and disconnected the other motors. 😥😥

Connect one battery pack for motor shield and one to the head light. Connect Arduino 101 to the powerbank, and one to the ip camera using the power jack to USB connecter.

Download new tenvis app from the Play Store and configure your camera.

Using multitasking, control the bot and see what it's capturing on camera.

Schematics

Circuit diadram
2l4uppxgypy8fvpiyssm g1nehseiwk

Code

ARDOCAM BLE Arduino
code for running your BOT
/**************************************************************
 * This sketch is for an Arduino 101 BLE rover using Blynk and Adafruit Motor Shield V2
 * Code was copied from both Adafruit and Blynk librarie examples
 * Full documentation on building this rover yourself on Hackster.IO and electronhacks.com
 * Sketch is released under MIT license
 **************************************************************/


#define BLYNK_PRINT Serial
#include <BlynkSimpleCurieBLE.h>
#include <CurieBLE.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_MS_PWMServoDriver.h"

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "1b393b0f3f4f4245ba98929f225fa9cb";

BLEPeripheral  blePeripheral;

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 

// Select which 'port' M1, M2, M3 or M4.
Adafruit_DCMotor *motor1 = AFMS.getMotor(1);
Adafruit_DCMotor *motor2 = AFMS.getMotor(2);
Adafruit_DCMotor *motor3 = AFMS.getMotor(3);
Adafruit_DCMotor *motor4 = AFMS.getMotor(4);

//######### SETUP ######################################
void setup() {
  Serial.begin(9600);
  delay(1000);

  // The name your bluetooth service will show up as, customize this if you have multiple devices
  blePeripheral.setLocalName("Arduino101Blynk");
  blePeripheral.setDeviceName("Arduino101Blynk");
  blePeripheral.setAppearance(384);

  Blynk.begin(auth, blePeripheral);

  blePeripheral.begin();
  Serial.println("Waiting for connections...");
    
  Serial.println("Adafruit Motorshield v2 - DC Motor");

  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  // Set the speed to start, from 0 (off) to 255 (max speed)
  motor1->setSpeed(255);
  motor2->setSpeed(255);
  motor3->setSpeed(255);
  motor4->setSpeed(255);  

}


//########## LOOP ######################################
void loop() {
  Blynk.run();
  blePeripheral.poll();
}


//######### Subrutines ################################

// This function will set the speed
BLYNK_WRITE(V0)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  // You can also use:
  // String i = param.asStr();
  // double d = param.asDouble();
  Serial.print("V0 Slider value is: ");
  Serial.println(pinValue);
  motor1->setSpeed(pinValue);
  motor2->setSpeed(pinValue); 
  motor3->setSpeed(pinValue);
  motor4->setSpeed(pinValue);   
}

// Motor 1 Forward
BLYNK_WRITE(V1)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 1 Forward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor1->run(FORWARD);
    motor3->run(FORWARD);
  }
  if(pinValue == 0) {
    motor1->run(RELEASE);
    motor3->run(RELEASE);    
  }
}


// Motor 2 Forward
BLYNK_WRITE(V2)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 2 Forward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor2->run(FORWARD);
    motor4->run(FORWARD);   
  }
  if(pinValue == 0) {
    motor2->run(RELEASE);
    motor4->run(RELEASE);
  }
}

// Motor 1 Backward
BLYNK_WRITE(V3)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 1 Backward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor1->run(BACKWARD);
    motor3->run(BACKWARD);    
  }
  if(pinValue == 0) {
    motor1->run(RELEASE);
    motor3->run(RELEASE);    
  }
}

// Motor 2 Backward
BLYNK_WRITE(V4)
{
  int pinValue = param.asInt(); // assigning incoming value from pin V1 to a variable
  Serial.print("Motor 2 Backward: ");
  Serial.println(pinValue);
  if(pinValue == 1) {
    motor2->run(BACKWARD);
    motor4->run(BACKWARD);
  }
  if(pinValue == 0) {
    motor2->run(RELEASE);
    motor4->run(RELEASE);    
  }
}

Comments

Similar projects you might like

Ambient 2 click board on Arduino101

by Team Makers NS

  • 61 views
  • 0 comments
  • 2 respects

Easiest Way to Add A Full Color LCD Display

by Ushijima

  • 5,000 views
  • 3 comments
  • 6 respects

Giftduino - The Perfect Arduino Gift Box

Project tutorial by circuito.io team

  • 416 views
  • 0 comments
  • 3 respects

Happy birthday melody on Arduino Nano with 3-way polyphony

Project tutorial by Liss

  • 1,538 views
  • 6 comments
  • 22 respects

Kaleidoscope Infinity Mirror

Project tutorial by Lucas Ainsworth

  • 3,678 views
  • 0 comments
  • 31 respects
Add projectSign up / Login