Request Guidance on Project Proramming

Dear Sir

I have 7 Nos of 10 RPM 12V DC MOTOR WITH GEARBOX

I need to wire 7 of these motors to seven doors. Now after the first door completely opens, the second one should start opening and so on till the 7th Door. After the 7th Door is opened, after delay of 10 minutes, the doors should start closing from 7th. i.e, after 7th door completely closes, the 6th door starts closing and so on till the 1st door.

I have ARDUINO UNO R3 BASED ROBOT CONTROL BOARD. I request you experts to provide the code and wiring diagram for this hobby project. I am studying X Std School in India.

I request you experts to provide the code and wiring diagram for this hobby project. I am studying X Std School in India.

Management studies course?

We don't write code for you unless you're prepared to pay. We can help you however to fix your code or advise on approach.

You can start by providing links to the hardware so we have a better idea which components you're using.

Have a look at Planning and Implementing a Program

...R

Links to components being used

You're probably going to need a relay board too - that board can only drive four motors.

Can you suggest a relay board for 7 motors and sample code for arduino, Please

Sample code is going to depend on the relay board you decide to buy.

Let’s start with what you want to achieve. It’s useless to get a relay board if you want to control the speed of all motors.

Would like to use this

That looks to be SPDT.

sterretje:

What I want to achieve is

  1. I have seven doors one after another
  2. The First door starts opening.
  3. After it fully opens the second door starts opening.
  4. This goes on till 7th door opens.
  5. Now 7th door is opened
  6. 15 Min Gap
  7. Now 7th Door Closes
  8. After it closes fully 6th Door closes
  9. This goes on till 1 Door closes.
  10. 15 Min Gap
  11. Cycle repeats

PS: All Motors to run at slowest speed possible

That’s reasonably simple to implement (from a software perspective). The PWM outputs (L293) of your Arduino board confused me a bit.

You will probably need a means to detect if doors are fully open / closed to stop the motors. Have you considered that?

I can consider using DPDT or a limit switch

@grcshekar, I get the feeling you are putting the cart before the horse.

Trying to figure out the hardware required is not appropriate if you have no programming experience because the selection of hardware must go hand-in-hand with the software and, more importantly, your understanding of how the hardware and software need to interact with each other.

Spend some time learning about programming an Arduino before you go any further with your hardware selection.

...R

But his project is probably due next week. Ain’t got time to do any of that learnin’ you’re preachin’ about. :slight_smile:

How big are these doors? Do they need to hold anything back? What power source are you working with?

Here is a sample code… I do not know how to control multiple motors
int sw1, sw2, sw3;
const int LM1 = 0;
const int LM2 = 1;
const int LM3 = 6;
const int CW = 10;
const int CCW = 9;
const int Buzzer = 7;

void setup() {
pinMode(LM1, INPUT);
pinMode(LM2, INPUT);
pinMode(LM3, INPUT);
pinMode(CW, OUTPUT);
pinMode(CCW, OUTPUT);
}

void loop(){
sw3 = digitalRead(LM3);
sw1 = digitalRead(LM1);
sw2 = digitalRead(LM2);

if (sw1 == LOW && sw2 == HIGH) {
do {
digitalWrite(Buzzer, HIGH);
digitalWrite(CW, HIGH);// change the direction of rotation (DOWN Movement)
digitalWrite(CCW, LOW);

sw2 = digitalRead(LM2);
} while (sw2 == HIGH);
}
else if (sw1 == HIGH && sw2 == LOW) {
do {
digitalWrite(Buzzer, HIGH);
digitalWrite(CW, LOW);// change the direction of rotation (UP Movement)
digitalWrite(CCW, HIGH);

sw1= digitalRead(LM1);
} while (sw1 == HIGH);
}
}

INTP:
But his project is probably due next week. Ain't got time to do any of that learnin' you're preachin' about. :slight_smile:

How big are these doors? Do they need to hold anything back? What power source are you working with?

This is hobby project. Doors are of styrofoam meausing 6" height and 4" width. motor is 5 V DC

6" x 4" styrofoam?

Get micro servos, save yourself a ton of headache.

INTP:
6" x 4" styrofoam?

Get micro servos, save yourself a ton of headache.

That is hardware part. I need assitance on the code reproduced here to achieve my goal