Vending machine motor control

Hello.

First, i am software programmer and i am not familier with electronics , this is my first project , maybe my quastion is compleatly wrong. (please check attachment pictures in end of the post)

i am working on a Arduino Project and i want to make some customization on sneck vending machines (i dont want to make / design from A to Z ) .
actualy i have to design my coustom arduino , because my system is compleatly diffrent with normal sneck vending machine
so i just need to use vending machine dc motors and cabin , there is no need to bill acceptor , coin acceptor , credit card reader , keypad and ....

based on my search on internet ,usualy 12v or 24v dc motors are used in these vending machines with 2 pin connector or 3 pin connector.

finally i find some secend hand used 24v dc motors to test.
there are 2 pins on controller board , when i connect it normaly to 24v , motor spins.
there is a micro swich behinde the controller board with a small button , and a plastic trigger pushes and realises this .
after connecting the motor to arduino, i understand when any change happens in this button (press/realse) it sends a 1 to my digitalRead() on that pin. so i guess this is how i can understand a full 360 spin happens.

coud you explain:
-how i have keep turned off all dc motors by defualt and turn on one of them just for a 360 degree spin

note:
-final project have to manage + 60 dc motor
-just one of motors will work on time
-my Arduino is Mega 2560

Pic1
Pic2

Best

Pic3
Pic4

2022-02-04_20-49-05

Did you tie the orange wire to the terminal ?


We need to see a schematic and your complete code.

unfortunately there is not any shematic for these motor controller, hardly i found this one internet ,i am not sure this is like my board , i guess maybe its something like this , maybe you can compair with attachment pictures on post2 (pic3 pic4).

https://ibb.co/tPm0ZkD

btw there is no code yet , i am just get that 1 signal with this code :
https://ibb.co/xXGHtg4

int pushButton = 6;

void setup() {
  Serial.begin(9600);
  pinMode(pushButton, INPUT);
}

void loop() {
  int buttonState = digitalRead(pushButton);
 if (buttonState != 0) Serial.println(buttonState);
   delay(1);        // delay in between reads for stability
}

Hello astarali
Take some time and take a course electronic hardware engineering including soldering.
Have a nice day and enjoy coding in C++.

Hello, @astarali

Not sure you found a solution but it's quite simple. You have to interface a relay between each motor power supply & Everytime you receive a 1 you turn off that particular relay to stop spinning.

Challenge now is how are you going to control 60 motors as the Mega only has 54 I/O pins.
Note that if it had been pwm U could control as many as 900 with a PCA9685.

A little feedback would be good on the solution U implemented.

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