Controlling DC motor speed using push button

I need help in completing my project i.e.,
Need to build Button controller which is used to controll the speed of the DC motors
3 buttons to control 5 dc motors
1 button operates 1 motor
other 2 buttons 2 motors each
may be the module might look like the attached picture


1 st button is for power on/of
next buttons to controll the speed of dc motors

Lot of missing informaton. Start be reading the sticky about getting the best from theUse code tags to format code for the forum forum.

What hardware to use? Motors, motor drivers, power supplys?

How do push buttons control motor speed?

What Arduino board?

1 Like

this might be a start
you have to provide the code executed for each button

// check multiple buttons and toggle LEDs

enum { Off = HIGH, On = LOW };

byte pinsLed [] = { 10, 11, 12 };
byte pinsBut [] = { A1, A2, A3 };
#define N_BUT   sizeof(pinsBut)

byte butState [N_BUT];

// -----------------------------------------------------------------------------
int
chkButtons ()
{
    for (unsigned n = 0; n < sizeof(pinsBut); n++)  {
        byte but = digitalRead (pinsBut [n]);

        if (butState [n] != but)  {
            butState [n] = but;

            delay (10);     // debounce

            if (On == but)
                return n;
        }
    }
    return -1;
}

// -----------------------------------------------------------------------------
void
loop ()
{
    switch (chkButtons ())  {
    case 2:
        digitalWrite (pinsLed [2], ! digitalRead (pinsLed [2]));
        break;

    case 1:
        digitalWrite (pinsLed [1], ! digitalRead (pinsLed [1]));
        break;

    case 0:
        digitalWrite (pinsLed [0], ! digitalRead (pinsLed [0]));
        break;
    }
}

// -----------------------------------------------------------------------------
void
setup ()
{
    Serial.begin (9600);

    for (unsigned n = 0; n < sizeof(pinsBut); n++)  {
        pinMode (pinsBut [n], INPUT_PULLUP);
        butState [n] = digitalRead (pinsBut [n]);
    }

    for (unsigned n = 0; n < sizeof(pinsLed); n++)  {
        digitalWrite (pinsLed [n], Off);
        pinMode      (pinsLed [n], OUTPUT);
    }
}

hii its little tricky for me to find out the tags as i have neutral knowledge on the arduino things
actually the module in the picture is module of a product

It is used to control the motors

I highly recommend you get a copy of the Arduino Cookbook, parts of what you are trying to do is in there along with hardware and code explanations.

If you have something in front of you that the board you show us goes with, and you want to do something other than use that board

it would speed things up a bit if you just say a bit more about what that thing is and why.

a7

yes i want to make another copy of that

it is button module which is used to change the rpm of ERM motors which is used to produce vibrations in our project

basically it operates motors according to modes

the buttons have two presses 1st press it will operate with less rpm(50%duty cycle)
second press of the button (100% duty cycle)

i dont know how to make circuit diagram and create and implement code in it

i really thankful if you help me with it and very helpful for me

Photograph the bottom of the board.

Tell us the make and model of the device this hooks on to.

It is impossible to say how much control the board has; it might only be the input/output device, and the majority of the logic and control elsewhere.

And if you really

dont know how to make circuit diagram and create and implement code in it

you may be better off finding someone who can be paid to do it here

This and all the other fora are mostly geared to helping, not doing.

a7

2 Likes

The best thing at this point is to follow alto777 suggestion and hire some help. That black chip, what is it. I do not think it is an Arduino. How does the Arduino fit into the picture. I do not know where you are from but it is possible that board is covered by some legal protections such as a copyright or patent. If this is true it will make it harder to find somebody to duplicate it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.