Absolutely noobie questions from the beginner

Hello, all

I`m from Russia, so do not beat me for my English :slight_smile:

I have an idea - create motorized vehicle with camera which can be controlled via wifi from my macbook, picture from camera should be broadcast to my laptop.

Is it possible to do it with ardunio?

I have read a lot of information about ardunio and stuck a little.
From what i should start?

First thing i need it is ardunio itself, than wifi shield and motor shield, right?

Which camera can i use?

What you are attempting to do is create what is known as an "unmanned ground vehicle"; aka, a "UGV" - so if you do some searching on that term, you might find some information of relevance to your project (at worst, you'll find some inspiration - UGVs are typically used by industry, rescue, and military for various jobs).

As far as using an Arduino - yes, you can do this, with the exception of one part (unless you want really low resolution): the camera. You can easily set up an Arduino to control motors and a pan/tilt mechanism for the camera, but the Arduino itself (or more specifically, the ATMega168/328 upon which it is built) does not have the processing horsepower to process a video stream from a camera and send it wirelessly to your PC.

Instead, what you should look into is using an IP camera; depending on how you set things up, this camera can be either wireless (802.11 wifi) or wired ethernet (thru an on-board wifi router).

One thing you will need to determine is the size of vehicle you are planning on controlling, because the size of that vehicle will determine how much battery you can load on it, to power the vehicle, Arduino, camera, pan/tilt, GPS, etc. Whatever parts you do get as off-the-shelf components, you are going to want to strip down to reduce weight (ie, remove plastic casing, etc).

If I were doing this (ah, heck - actually - I -am- doing it; only my vehicle is based on a PowerWheels H2 ride-on, so weight and space isn't an issue; in my case, the Arduino will be for motor control and pan/tilt control initially, the cameras will be USB Logitech Orbit AF units, with a custom servo pan/tilt system, plus a on-board Mini-ITX Intel Atom motherboard - but we're talking about your project, which likely won't be as big), I would look for a large R/C car or platform; if you can swing it, a custom platform made of welded steel thin-wall square tubing, with a custom on-board generator for hybrid-power would work great, but you would likely need a larger motor system and controller - which isn't really suitable for a beginner...

So - get a large R/C car; something like a large radio-controlled 2 or 4WD truck chassis is ideal - something with 4-5 inch diameter tires (sorry about the non-metric units). If you check my site, you will see a toy I used as a early tester kit; it was a New Bright Toys "Raminator" truck - nice and big:

http://www.phoenixgarage.org/show_article/51

A more expensive alternative would be something like a large Traxxas or similar grade chassis; just be aware that such vehicles are anything but cheap to purchase...

So - take something like that, add several 9.6V R/C battery packs for power, set up your camera and Arduino, etc - and you should be able to get something to work. Something you might want to think about is not processing the video or using wifi for the video at all; instead, get one of those cheapo 900 MHz or 2.4 GHz wireless video camera kits like you see all over Ebay for video surveillance, then on the PC end, route the output of the receiver into a video capture card/port; then process the video from that point. Not quite as slick, but it will work, and save you a ton on battery usage (more run time).

You can then use wifi (via a wifi shield or similar) or whatnot for controlling the Arduino (and thus the motors and pan/tilt unit), and receiving other telemetry data (GPS, orientation, etc) back.

Good luck on your project, hope this helps!

:slight_smile:

Great thanks cr0sh.

Using wifi camera its good idea, im thinking about it 10 min ago before reading your post. :slight_smile:

One more question - which ardunio board will be more suitable for my purpose ?

You can also take a look at this project: http://veter-project.blogspot.com/ . It uses BeagleBoard connected to Trainer Board which has Arduino compatible AVR micro-controller running Arduino software. I've also heard that authors are looking for contributors so feel free to contact them if you are interested :wink: .

One more question - which ardunio board will be more suitable for my purpose ?

It kinda depends on where and what kind of processing you are planning on doing; if this is to be only a basic UGV with some simple external control from a PC interface, then a standard Arduino would probably be OK.

If you are planning to gather GPS data and only relay that back to the PC, a regular Arduino with the ATMega328 would probably be fine. If, however, you are planning on having the robot autonomously navigate between waypoints, you might find the 328 cramped for space (of course, you could set up multiple units - one master, and several slaves, to expand the system as needed, using the I2C bus).

You could offload this processing to the PC, of course - the PC would store the waypoints, the GPS on the robot would be serialized and sent by the Arduino back to the PC, where it would do all the calcs, then send the commands for movement back to the Arduino to control it.

Same/similar would be done for any possible vision or sensor processing. You could also expand to a larger Mega, if you wanted to add more code (for waypoint finding and other sensor processing)...

This question was ultimately why, on my current machine, I decided to go with an on-board PC (which will run a LAMP stack interfaced with the Arduino); at that point, all processing is done on the more powerful PC for waypoints and vision processing (will be using OpenCV) - the only off-board access will be over a secured 802.11g mac-address locked connection; if you have wifi and a browser (and have a registered mac-address), you'll be able to access the interface for control.

Unfortunately, this setup wouldn't really fit on the smaller platform in the link I posted, so I (well, at the time - "we" - I used to have a partner helping on this project, but he left to pursue other avenues) used a larger platform, a Hummer H2 PowerWheels ride-on toy. The thing had no problem hauling my butt around, and I weigh over 200 lbs, so the extra weight and battery needed for the system won't be an issue. If this beta-test platform works out in the end, I plan on migrating to a larger, likely engine-powered platform (maybe even a hybrid approach - I have a large 24V dual-motor transaxle from a powerchair that would work great for such an application).

:slight_smile:

Thanks again cr0sh

Can you look at my choice. Can i connect these devides together?

Arduino Duemilanove 2009 AVR ATmega328 p-20PU USB board
(http://cgi.ebay.com/Arduino-Duemilanove-2009-AVR-ATmega328-p-20PU-USB-board-/270622533609?pt=LH_DefaultDomain_0)

Arduino Motor controller Shield V2 L298N drive 2 motors
(http://cgi.ebay.com/Arduino-Motor-controller-Shield-V2-L298N-drive-2-motors-/190430032915?pt=LH_DefaultDomain_0)

Arduino WiFi Shield WiShield V2.0
(http://cgi.ebay.com/Arduino-WiFi-Shield-WiShield-V2-0-/120601928154?pt=LH_DefaultDomain_0)

4WD robotics car Mr Basic maze line follow DAGU Arexx
(http://cgi.ebay.com/4WD-robotics-car-Mr-Basic-maze-line-follow-DAGU-Arexx-/190428973054?pt=LH_DefaultDomain_0)

Hi i am using Arduino Duemilanove 328 and wifly shield from sparkfun http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=50_76&products_id=456
and for car itself i use http://www.coolcomponents.co.uk/catalog/product_info.php?cPath=46&products_id=233 robot rover kit
so far i can sort of control my car using web broser it just a bit to laggy didint start to work on servos just yet my code is

/*
 * Web Server
 *
 * (Based on Ethernet's WebServer Example)
 *
 * A simple web server that shows the value of the analog input pins.
 */

#include "WiFly.h"
#include "Credentials.h"
#include <WString.h>
String readString = String(100);



Server server(80);
 
//const int ledPin = 4;

// set the output pins
int baseMotorEnablePin = 2;
int baseMotorPin1 = 3;                             
int baseMotorPin2 = 4;                           
int shoulderMotorEnablePin = 14;
int shoulderMotorPin1 = 15;                             
int shoulderMotorPin2 = 16;        
///////////////////////////////

void setup() {
  WiFly.begin();
  if (!WiFly.join(ssid, passphrase)) {
    while (1) {
      // Hang on failure.
    }
  }
  // set the SN754410 pins as outputs:
  pinMode(baseMotorPin1, OUTPUT);
  pinMode(baseMotorPin2, OUTPUT);
  pinMode(baseMotorEnablePin, OUTPUT);
  digitalWrite(baseMotorEnablePin, HIGH);
  pinMode(shoulderMotorPin1, OUTPUT);
  pinMode(shoulderMotorPin2, OUTPUT);
  pinMode(shoulderMotorEnablePin, OUTPUT);
  digitalWrite(shoulderMotorEnablePin, HIGH);
  //++++++++++++++++++++++++++++++++++++++++++++++
 //pinMode(ledPin, OUTPUT);
  Serial.begin(9600);
  Serial.print("IP: ");
  Serial.println(WiFly.ip());
  
  server.begin();
}

void loop() {
  Client client = server.available();
  if (client) {
    // an http request ends with a blank line
    boolean current_line_is_blank = true;
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
             Serial.print(c);
       if(readString.length() < 100)
       {
         readString.append(c);
      //   Serial.println(readString);
       }
        // if we've gotten to the end of the line (received a newline
        // character) and the line is blank, the http request has ended,
        // so we can send a reply
        if (c == '\n' && current_line_is_blank) {
          // send a standard http response header
          client.println("HTTP/1.1 200 OK");
          client.println("Content-Type: text/html");
          client.println();
          client.println("<title>Motor Control</title><h2><center>TEST</center></h2>
<hr>





");
          
         /* // output the value of each analog input pin
          for (int i = 0; i < 6; i++) {
            client.print("analog input ");
            client.print(i);
            client.print(" is ");
            client.print(analogRead(i));
            client.println("
");
          }*/
         client.println("<table  width=50   cellpadding=-2 cellspacing=5  align=right>");
         client.println("<tr><td></td><td><form method=get name=L><input type=submit name=L value=Forw></form></td><td></td></tr>");
         client.println("<tr><td><form method=get name=L><input type=submit name=L value=Left></form></td><td><form method=get name=L><input type=submit name=L value=Stop></form></td><td><form method=get name=LED><input type=submit name=LED value=Right></form></td></tr>");
         client.println("<tr><td></td><td><form method=get name=L><input type=submit name=L value=Down></form></td><td></td></tr>");
         client.println("</table>");
             if(readString.contains("L=Forw"))
         {
      digitalWrite(baseMotorPin1, LOW);   
      digitalWrite(baseMotorPin2, HIGH);  
      digitalWrite(shoulderMotorPin1, LOW);   
      digitalWrite(shoulderMotorPin2, HIGH); 
         }
         if(readString.contains("L=Down"))
         {
      digitalWrite(baseMotorPin1, HIGH);   
      digitalWrite(baseMotorPin2, LOW);
      digitalWrite(shoulderMotorPin1, HIGH);   
      digitalWrite(shoulderMotorPin2, LOW); 
         }
                  if(readString.contains("L=Stop"))
         {
      digitalWrite(baseMotorPin1, LOW);   
      digitalWrite(baseMotorPin2, LOW);
      digitalWrite(shoulderMotorPin1, LOW);   
      digitalWrite(shoulderMotorPin2, LOW); 
         }
         readString = 0;
          break;
        }
        if (c == '\n') {
          // we're starting a new line
          current_line_is_blank = true;
        } else if (c != '\r') {
          // we've gotten a character on the current line
          current_line_is_blank = false;
        }
      }
    }
    // give the web browser time to receive the data
    delay(1000);
    client.stop();

  }
}

By the way i using Motor Driver (L293D) (Dual H-Bridge) http://www.oomlout.co.uk/motor-driver-l293d-dual-hbridge-p-215.html for motors