Controllers in series

I'm trying to create a code to control three motors in series. Can someone help me get an idea of how to start. I was looking at an example for one controller but I couldn't tell what to change to add more controller and furthermore on how to make it run in series. Each controller should have a timer that stops before the next timer for the second controller.

I couldn't tell what to change to add more controller

Why do you need more than one? One Arduino can turn several motors off and on.

and furthermore on how to make it run in series.

First, you define what "in series" means to you.

Have a look at how millis() is used to manage timing without blocking in Several things at a time

The examples use LEDs but they could be adapted to control the on/off of motors.

Please post a link to the datasheet for the motors you are using and to the datasheet for the motor drivers.

And post the example code that you are trying to extend.

...R
PS. I have been assuming that you will only be using one Arduino.

I don't think you mean electrically in series because that hardly ever works. Perhaps you mean one motor runs for a time and then another starts etc.?

So what code have you tried? Please post it and the type of motor and what sort of controller you plan to use (links would be best).

You have to provide some details if you hope to get useful answers.

Steve

PaulS:
Why do you need more than one? One Arduino can turn several motors off and on.
First, you define what "in series" means to you.

Im trying to have three pumps and a motor to be controlled by an arduino board. But i dont want them to run at the same time. I want the first pump to run and then when it stops, i would like to add a wait time of few seconds and the rotating motor would run. Then i want the second pump to run and have the rotating motor to work in the same manner as the fist time after the second pump. Does that make sense?

Robin2:
Have a look at how millis() is used to manage timing without blocking in Several things at a time

The examples use LEDs but they could be adapted to control the on/off of motors.

Please post a link to the datasheet for the motors you are using and to the datasheet for the motor drivers.

And post the example code that you are trying to extend.

...R
PS. I have been assuming that you will only be using one Arduino.

I'll take a look at your link. And I havent started the code. Im learning the language and I have an idea but i would like to see a similar code so I can have a concept to start

slipstick:
I don't think you mean electrically in series because that hardly ever works. Perhaps you mean one motor runs for a time and then another starts etc.?

So what code have you tried? Please post it and the type of motor and what sort of controller you plan to use (links would be best).

You have to provide some details if you hope to get useful answers.

Steve

Yeap, That's what i mean. I haven't tried any codes yet. I'm trying to follow the idea of the LED light switch but mine is slightly different because the example of the LED turns on and off and then on again. I want mine to stay off once the time already passed.

Does it only have to do the sequence once with no controls or switches? So you switch the power on and it goes:

Start motor 1 at full speed, wait a while, stop motor 1
Start motor 2 full speed, wait, stop motor 2
Start motor 3 full speed, wait, stop motor 3
End of program, nothing else to do.

If not describe EXACTLY what you want the program to do. And I'll ask again, show us the datasheets for whatever motors you want to use.

Steve

slipstick:
Does it only have to do the sequence once with no controls or switches? So you switch the power on and it goes:

Start motor 1 at full speed, wait a while, stop motor 1
Start motor 2 full speed, wait, stop motor 2
Start motor 3 full speed, wait, stop motor 3
End of program, nothing else to do.

If not describe EXACTLY what you want the program to do. And I'll ask again, show us the datasheets for whatever motors you want to use.

Steve

Hi Steve,

Thank you for your help. The Project is about a sequence of actions that involve four peristaltic pumps and a rotating motor. I have attached the specifications of the pumps and the motor below.

The program should run once.
First the first pump will turn on for certain amount of time
The first pump turns off
There is a wait time
The rotating motor will turn on for certain amount of time
The rotating motor stops
Wait time
Then the second, third and fourth pump should follow in the same manner.

I created a code attached below with this concept. I haven't been able to test it but before I do i would like to add a few features to the code that i'm not sure how to do it. First I would like to add variables that are input by the user such as the time they run. For example if I name it T1 for the time of the first pump and it'll equal to an input entered by the user. In the same manner of the time I would like to create prompt inputs so the user can decide which pumps should run just in case the user doesn't want to use all pumps.

Pump Specifications:
Volts: DC 12V.
current: 80mA
working condition: 0-40
relative humidity <80%
flow rate: : 0-100 ml/min
rotate speed: 1-500 rpm
driver size(x H): Dia.27.6 x Height 37.9 (mm)
powerhead size(x H): Dia. 31.7 x Height 20.1(mm)
silica gel tube(IDxOD): outer diameter 4mm,inside diameter 2mm
flow direction: you can control the flow direction by the positive and negative connect
Pump head designed for easy disassembly type for easy cleaning and maintenance.

Motor Specifications
Model NO.: 59TYD-6B
Structure: Motorize
Signal: Discrete
Model Number: 59tyd-6b
AC Voltage: 24 / 110 / 220 V
Output Power: 4W
Speed: 1rpm~99rpm
Output Shaft: Customized
Origin: Ningbo
Task: Auto Control
Mathematical Model: Linear
Brand Name: Fengtech
Type: Synchronous Motor
Frequency: 50 / 60 Hz
Phase: Single-Phase
Rotate Direction: Cw / Ccw / Bi-Directional

Project.ino (1.19 KB)

Google "arduino medical projects pump" or similar and look at the images. See if anything looks like what you want to do.

Paul

Paul_KD7HB:
Google "arduino medical projects pump" or similar and look at the images. See if anything looks like what you want to do.

Paul

Thank you, some of the projects have similar features which is helpful!