Has anyone tried the "Ultrasonic Smart Car Kit" from HobbyKing?

It can be seen here:

I'm expecting delivery of one very soon, shipping from Hong Kong takes a while.

Do these come already programmed right out of the box, to run around, "seeing" obstacles with the sensors, turn away from them etc.?

Or do you have to write your own sketches and program them to do that?

Sorry if it's a dumb question. Inquiring minds want to know! :smiley:

Go back to the info page via the link you posted and read the comments.

pmlapl:
Go back to the info page via the link you posted and read the comments.

That could be a trifle confusing. One comment suggests it comes with a program, others say it does not.

Paul__B:

pmlapl:
Go back to the info page via the link you posted and read the comments.

That could be a trifle confusing. One comment suggests it comes with a program, others say it does not.

Exactly. I'm hoping there is someone on this forum, who hasn't posted there... since everyone who has posted there, evidently has not gotten it to run, or even tried.

In a few weeks, I hope to become the exception to that rule (or actually my son in his High School Robotics club)... but schedule is very jammed between now and then.

Has anybody taken a crack at this "Ultrasonic Smart Car Kit", and made progress?

Seems to me, it's got three pretty standard major parts, apart from the Arduino:

  • A 298 motor driver
  • A servo
  • An ultrasonic sensor (whose make / model you will probably discern when you unwrap it

Each of those three parts (assuming the sensor is a popular make) is well documented on this forum if you do a search. Indeed, you'll probably find a working example of all three hooked up together. So don't worry that your "Ultrasonic Smart Car Kit" may not be documented as a brand-name, you'll surely find what you need. (Or better yet, your son will find it 8) )

I opened the box. Here's a list of parts that came in the kit that HobbyKing sent me:

  • a two-deck plastic chassis
  • an HC-SR04 ultrasonic sensor
  • an L298N H-bridge motor driver board (already mounted to the chassis)
  • a “Funduino Keyes Duemilanove” board (I guess it’s Arduino compatible)
  • a single 9-gram Tower Pro SG-90 servo (used to aim the ultrasonic sensor)
  • a battery box that holds six AA batteries
  • another battery box that hold one 9-volt battery
  • two gearmotors (already mounted to the chassis) that look a lot like the “Arduino 12v 130 Electric Geared Motor” (search in Hobby King for “130 geared”)
  • two main wheels
  • a single castering wheel (already mounted to the chassis)
  • a tiny breadboard1-3/4” by 1-1/4”
  • two small bags of screws
  • a few other plastic parts, probably for mounting the sensor.
  • A USB cable
  • twelve jumper cables, molded together as a ribbon cable

Hobby King doesn't have any files (Manuals, code files etc.) for the Ultrasonic Smart Car itself, and no paper documentation came in the box. But for each part it sells individually (sensor, motor-driver board, gearmotors, etc.), it does have files usually. You have to search Hobby King for each separate part, then scroll down and click on the FILE tab below the ADD TO CART section.

Mechanical assembly will probably be a matter of following your nose....

Electrically and programmingly, as I said above, probably best to tackle the three major pieces one-by-one. I'd start with doing a few simple Arduino exercises from the tutorial page, like blink. Then hook the servo up: there's a tutorial for that too.

LilAbner,
Please post some code and the steps you are making in your progress and we can steer you in the right direction. Right now it sounds to me as if you are wanting someone to give you all the answers to you so that you can give them to your son. How does he (or you) learn that way?

We were wondering - is the rear wheel of the Smart Car like this
http://www.mhobbies.com/brand-new-programmable-robot-mobile-platform-2wd-robot-chassis-kit.html
or a ball caster like this?

oric_dan:
We were wondering - is the rear wheel of the Smart Car like this
http://www.mhobbies.com/brand-new-programmable-robot-mobile-platform-2wd-robot-chassis-kit.html
or a ball caster like this?
http://dx.com/p/multi-function-line-tracking-robot-car-kits-for-arduino-156156

It's like the one in your first link (a full-castering wheel), not the one in your second link (a single ball).

Finally got it together and running, though I haven't hooked up the sensor yet.

Hobby King sent a Funduino Keyes Duemilanove board with the kit instead of an Arduino Uno board. I believe the Duemilanove is supposed to be compatible with the Uno, except the Duemilanove has a pushbutton where the Uno doesn't.

But, using the software environment that we have successfully programmed my son's Uno with, I couldn't get the Duemilanove to program. Kept getting an error message saying it couldn't find it on the USB cable. Apparently the Uno programs on COM5:, and the Duemilanove uses some other COM: port (under "Tools" and "Serial Port" it offered me COM4: and COM1:, I couldn't get either to work).

Finally gave up, lifted the Durmilanove board off the Smart Car, and put my son's Uno board on in its place.

Now it works! I have gotten it to run forward for 1 second, pause 1 second, run backward 1 second, pause, again and again in that loop. That's a pretty good start, although it will have to do much more soon.

Here comes my first attempt at posting code.

/*  Dual Motor Driver  */
int ENA=5;     // BLU connected to arduino's port 5 (output pwm)
int IN1=2;     // GRN connected to arduino's port 2               
int IN2=3;     // YEL connected to arduino's port 3
int ENB=6;     // BRN connected to arduino's port 6 (output pwm)
int IN3=4;     // ORG connected to arduino's port 4
int IN4=7;     // RED connected to arduino's port 7
int led13=13;  // LED on Arduino UNO board, port 13
void setup ()
{
  pinMode(ENA,OUTPUT);     //  Set up pins as outputs
  pinMode(ENB,OUTPUT);
  pinMode(IN1,OUTPUT);
  pinMode(IN2,OUTPUT);
  pinMode(IN3,OUTPUT);
  pinMode(IN4,OUTPUT);
  digitalWrite(ENA,LOW);   // stop motorA
  digitalWrite(ENB,LOW);   // stop motorB
}
void loop ()
{                           // FORWARD
  digitalWrite(IN1,LOW);   // Set forward direction for motorA
  digitalWrite(IN2,HIGH);
  digitalWrite(IN3,HIGH);  // Set forward direction for motorB
  digitalWrite(IN4,LOW);
  digitalWrite(ENA,HIGH);  // Turn on motorA
  digitalWrite(ENB,HIGH);  // Turn on motorB
  delay(1000);             // Let motors run forward for 1 sec
  
  digitalWrite(ENA,LOW);   // stop motorA
  digitalWrite(ENB,LOW);   // stop motorB
  delay(1000);             // Let motors stay stopped for 1 sec
  
                           // BACK UP
  digitalWrite(IN1,HIGH);  // Set backward direction for motorA
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,LOW);   // Set backward direction for motorB
  digitalWrite(IN4,HIGH);
  digitalWrite(ENA,HIGH);  // Turn on motorA
  digitalWrite(ENB,HIGH);  // Turn on motorB
  delay(1000);             // Let motors run backward for 1 sec
  
  digitalWrite(ENA,LOW);   // stop motorA
  digitalWrite(ENB,LOW);   // stop motorB
  delay(1000);             // Let motors stay stopped for 1 sec
}

Hope that comes out OK.

Your code obviously posted OK. You should start now with modularizing your code. go_forward(), turn_left(), etc. Much easier to read, and also when writing the higher level logic. IE, separate control logic from low-level mechanistic details.

Do you have FTDI drivers installed? You need them for the Duemilanove board.

oric_dan:
Your code obviously posted OK. You should start now with modularizing your code. go_forward(), turn_left(), etc. Much easier to read, and also when writing the higher level logic. IE, separate control logic from low-level mechanistic details.

Yep. Do you happen to know if the arduino has interrupt capabilities? If not, I may have to write cycling code, where it checks for the status of EVERYTHING every 1/100 of a second or so.

Haven't yet figured out how to make it curve gently to the right (for example) at medium speed, by pulsing the left wheel at 60% duty cycle PWM while pulsing the right wheel at maybe 50% duty cycle... and still be able to check everything else like the sonar sensor while moving forward and curving.

Do you have FTDI drivers installed? You need them for the Duemilanove board.

Nevah hoid of 'em.

Where can I find them, how do I load them?

I just ordered two more original Arduino Uno boards, my son and I will mostly concentrate on those. Might get back to the Duemilanove board when I have time. But in these beginner stages, I'd prefer to deal with the devil I know.

Do you happen to know if the arduino has interrupt capabilities? If not, I may have to write cycling code, where it checks for the status of EVERYTHING every 1/100 of a second or so

You can read about interrupts here. But perhaps you didn't realise that your code is cycling already: everything in loop() is, well, looping. Otoh, everything in setup() happens once only.

Where can I find them, how do I load them?

I think recent versions of windows either has the FTDI drivers installed, or automatically can find them.

zoomkat:

Where can I find them, how do I load them?

I think recent versions of windows either has the FTDI drivers installed, or automatically can find them.

Right now my desktop PC (Windows 7) can talk to the Arduino Uno board and program it just fine. But it can't talk to the Duemilanove board.

If I load these FTDI drivers, I take it I will be able to talk to the Duemilanove board. But will I still be able to talk to the Uno board too?

Or will I only be able to talk to the Duemilanove, but NOT the Uno?

Would I have to keep switching drivers back and forth, to talk to each different board?

z-k is right. The FTDI drivers are included in the IDE, actually in 2 places in the v.1.0.5 directory, namely \FTDI-2.08.24 and also in \drivers\FTDI USB Drivers. I don't know the difference. I also don't know anything at all about using the IDE under Win7. There should be some way to link up the drivers with the Duemilanove board if it's not already been done.

When I go to the Control Panel > System > Hardware > Device Manager with WinXP, and plug in the Duemilanove board, then the Ports (COM & LPT) line pops up and shows the FTDI port on COM12 (# will vary). When I unplug the board, this line goes away. Get that to work first. Info should be somewheres on the Arduino installation page.

The arduino IDE can talk to both boards, if you tell it, which board is currently adapted.
Check out the IDE tab "Tools > board" and "Tools > programmer ".

You can drive curves, when you change the code for the ENA and ENB outputs from "digitalWrite" to " analogWrite". Check the reference for further details.
Don't become to familiar with the "delay" command, it makes your project difficult. ( e.g. scanning the environment while driving)
Better use the millis() option to do something for a certain time.

I want to know how to connect funduino duemilanove keyes to L298 dual-H motor bridge