New CLass Project

Hey! So in my Robotics class we're looking to make a robot that will find fire, travel to the source and then extenguish it. We have a Pump and we have a HC-SR04 Distance sensor along with a Arduino Motor Shield R3 and a RedBoard. We would like to just make everything work together, We have about 20 days left to the semester so any help would be great :slight_smile:

Top right hand corner of the screen is a search box. 'Robot Fire' yields 580 results. It's a common project.

You are not going to find a fire with a distance sensor.

1 Like

PaulS:
You are not going to find a fire with a distance sensor.

We understand that, We will be getting a 'Fire Sensor' we just haven't gotten that yet

If you only have 20 days then you better hurry.

RolBer00297:
We understand that, We will be getting a 'Fire Sensor' we just haven't gotten that yet

Delta_G:
If you only have 20 days then you better hurry.

We only have 20 class days. We should have the fire sensor(s) soon. Right now our main focus is finding code that will allow the distance sensor and the DC Motors to work together, We found this code but it doesn't read the sensor and it only controls one set of the wheels.

Right now our main focus is finding code

That is the WRONG focus. Your main focus needs to be WRITING code.

That is the WRONG focus. Your main focus needs to be WRITING code.

Aww, gee, Paul. That takes WORK.

We found this code

But you didn't post it?
That's crazy.

Sorry, I thought I meant to post it when I submitted that. Here is the code that we found but I think its for Servo Motors and not for the DC Motors. Arduino Motor Code - Pastebin.com

You'll probably find that you get more responses if you post the code here instead of asking people to go to some other site to find it.

    motor1.run(BACKWARD);      // turn it on going forward

If you got rid of the inaccurate or pointless comments, you'd probably find it wouldn't exceed the post limit.

Delta_G:
You'll probably find that you get more responses if you post the code here instead of asking people to go to some other site to find it.

It wouldn't allow me to post the code here, The error it gave me was "Post is over 9000 characters long"

I got it to under 7000 characters, just by deleting the

//-------------------------------------------------------------------------------------------------------------------------------------

comments.

You can always Reply, then scroll down and use Attachments and other options to Attach your file.

Hi,

What is your combined electronics, programming, arduino, hardware experience?

If its a class project, what have they been teaching you in Robotics class?

A bit of that code tells you a lot.
Lines 1 to 16.

  1. It has an ultrasonic sensor
  2. It has two motors.
  3. It has a servo to make the ultrasonic scan.
  4. There is so much in comments in the sketch, its self explanitary how it works.

The language is C++, have you been taught C++?

We can help you, but you have to do the majority of the work.
You write sketches and we will advise on how effective it is, or do some debugging.
Ask about library usage, as some can be a little light on in the documentation area.

There should be example programs for the motor shield in the IDE, if you have the library loaded.

You need to get your act together and plan your strategy.
First write a sketch to get distance readings from the ultrasonic.
Second write a separate sketch to drive the motors, expand it to do turns and reverse.
Three, when your fire detector arrives, write a separate sketch to get the proper readings from it.
Four, write a separate code to swing the servo motor.
Five, by then you should have enough knowledge of arduino programming to start integrating the sketches together one at a time.

Trying to write one chunk of code to do it all, will fail if you only have 20 working days, plus 10 weekend days which I assume you will also be using.

Structure your code, build it in steps, I would hope Robotics class has at least taught you this.

Tom.... :slight_smile:

You might use the search box in the upper right of this page and search for terms like "obstacle avoidance" and "solar tracker" to find projects where motors are controlled by some type of sensor.

TomGeorge:
Hi,

What is your combined electronics, programming, arduino, hardware experience?

If its a class project, what have they been teaching you in Robotics class?

A bit of that code tells you a lot.
Lines 1 to 16.

  1. It has an ultrasonic sensor
  2. It has two motors.
  3. It has a servo to make the ultrasonic scan.
  4. There is so much in comments in the sketch, its self explanitary how it works.

The language is C++, have you been taught C++?

We can help you, but you have to do the majority of the work.
You write sketches and we will advise on how effective it is, or do some debugging.
Ask about library usage, as some can be a little light on in the documentation area.

There should be example programs for the motor shield in the IDE, if you have the library loaded.

You need to get your act together and plan your strategy.
First write a sketch to get distance readings from the ultrasonic.
Second write a separate sketch to drive the motors, expand it to do turns and reverse.
Three, when your fire detector arrives, write a separate sketch to get the proper readings from it.
Four, write a separate code to swing the servo motor.
Five, by then you should have enough knowledge of arduino programming to start integrating the sketches together one at a time.

Trying to write one chunk of code to do it all, will fail if you only have 20 working days, plus 10 weekend days which I assume you will also be using.

Structure your code, build it in steps, I would hope Robotics class has at least taught you this.

Tom.... :slight_smile:

Hello, I'm can only access the fourm on the school computers so it takes me a little while. Our combimed Arduino experience is the same as potato. We really haven't been taught, the teacher did show us a few pointers with the Arduino Suite. Before we did this project with arduino we did sumobots, but everything was sitting there on the page. all we had to do was copy it from paper to the suite. We have not been taught anything other then this is arduino. I personally have only looked into C# but never actually did a project with it.

RolBer00297:
we did sumobots, but everything was sitting there on the page. all we had to do was copy it from paper to the suite.

You could have taken that opportunity to look up some of the stuff there and learn how that code worked instead of just copying it over.

Delta_G:
You could have taken that opportunity to look up some of the stuff there and learn how that code worked instead of just copying it over.

We only had about a week and a half to copy everything down. We didn't have enough time to look around and explore.