Need help with a project, relay to control a DC motor

Thread Starter

circuitpachi

Joined Feb 8, 2024
40
That shouldn't happen.
Are contacts 87 and 87A connected to anything?
Do you have another relay to test?
87 is connected to positive motor. 87A is disconnected.

I have positive DC connected to 86. Positive DC to 30. Positive motor to 87. Black sensor to 85. Brown sensor to positive DC. Blue sensor to negative DC. Black motor to negative DC.

I have another relay but it is the same model.
 

sghioto

Joined Dec 31, 2017
8,643
OK.
Try this, leave the motor and the relay connected as described but connect pin 85 to the negative supply. Leave the black wire from the sensor not connected.
Problem may be in the sensor.
 
Last edited:

Thread Starter

circuitpachi

Joined Feb 8, 2024
40
OK.
Try this, leave the motor and the relay connected as described but connect pin 85 to the negative supply. Leave the black wire from the sensor not connected.
Problem may be in the sensor.
Sensor completely disconnected now I am getting only one click
 
Last edited:

sghioto

Joined Dec 31, 2017
8,643
Then the relay coil is OK, but the contacts may not be.
Try the other relay with the complete setup.
Can you post just a clear HD photo of the wiring and setup?
 

Thread Starter

circuitpachi

Joined Feb 8, 2024
40
Then the relay coil is OK, but the contacts may not be.
Try the other relay with the complete setup.
Can you post just a clear HD photo of the wiring and setup?
You were right. It was the contacts. Im thinking there was a gap somewhere on the contact and there wasn't a solid connection.
 

Irving

Joined Jan 30, 2016
5,167
How would I set up an auto-reverse for 1-3 seconds if the motor were to stall/jam?
Thats a much more complex problem and not one you're going to solve with a simple relay. Basically it needs something to monitor motor current to determine stall, another relay to change the direction and something to time 3s.. You might find something off the shelf though I doubt it.

I'll have a think on the simplest way to achieve it.
 

Irving

Joined Jan 30, 2016
5,167
Here's one way to do it - its not the only way, and its not how I'd do it but I'm showing it to explain whats happening... explanation below...

1720209170655.png

You will recognise the sensor (X1), relay RLY1, and diode D1 as in your existing setup. I show your 12v supply as a battery V1. The clever stuff starts with the seond relay, RLY2. Unlike your existing relay this has 2 sets of changeover contacts and is shown, as usual, in the OFF state. If you look carefully you'll see the lower common contact is connected to the battery -ve and the upper common contact to your motor feed from the original relay. You will see RLY2 is wired to swap the motor + and - connections over when it is turned on. This is how the motor is reversed, when RLY2 is OFF the motor runs forward, when its ON the motor runs backwards, but in both cases it only runs when RLY1 is ON. To turn RLY2 on an NPN transistor Q1 is used, just like inside your sensor, with diode D2 to protect it. Diode D3 will allow Q1 to turn RLY1 on as well. This ensures the motor supply remains uninterrupted while running in reverse. The next thing to notice is the low-value resistor in the -ve feed to the motor, but only in the forward direction. The value of this resistor, 0.1ohm, means that for each amp flowing in the motor 0.1v is generated across R1. U1 is an amplifier with a gain of 20, so for each amp taken by the motor its output will increase by 2v, and 5 Amps will give approximately 10v. VR1 is a potentiometer; this allows a sample from 0 to 100% of the output of U1 and allows us to chose the current that triggers the reversing action. U2 is set up as a comparator. When U2's -input goes above its +input its output will rapidly fall from around 10v to 0v. Since U2+input is fixed at 3v by the voltage reference diode D4 we can choose a stall current from around 1.5A to approx 5.5A. The low going output from U2 triggers the NE555 timer IC. This is configured as a monostable - a single input pulse triggers an output pulse whose duration is set by R6 and C1. The output goes high, turning on Q1 and subsequently RLY1 and RLY2, driving the motor in reverse for the desird duration.

How would I do it? Two relays as before, but a single 8-pin microcontroller monitoring the voltage on R1 and triggering Q1, everything else done in software! But that's another story....
 
Last edited:

Thread Starter

circuitpachi

Joined Feb 8, 2024
40
For starters,since I just saw this post, a link to a catalog page is not a data sheet. NOR in most cases does it provide adequate information.
Here's one way to do it - its not the only way, and its not how I'd do it but I'm showing it to explain whats happening... explanation below...

View attachment 326250

You will recognise the sensor (X1), relay RLY1, and diode D1 as in your existing setup. I show your 12v supply as a battery V1. The clever stuff starts with the seond relay, RLY2. Unlike your existing relay this has 2 sets of changeover contacts and is shown, as usual, in the OFF state. If you look carefully you'll see the lower common contact is connected to the battery -ve and the upper common contact to your motor feed from the original relay. You will see RLY2 is wired to swap the motor + and - connections over when it is turned on. This is how the motor is reversed, when RLY2 is OFF the motor runs forward, when its ON the motor runs backwards, but in both cases it only runs when RLY1 is ON. To turn RLY2 on an NPN transistor Q1 is used, just like inside your sensor, with diode D2 to protect it. Diode D3 will allow Q1 to turn RLY1 on as well. This ensures the motor supply remains uninterrupted while running in reverse. The next thing to notice is the low-value resistor in the -ve feed to the motor, but only in the forward direction. The value of this resistor, 0.1ohm, means that for each amp flowing in the motor 0.1v is generated across R1. U1 is an amplifier with a gain of 20, so for each amp taken by the motor its output will increase by 2v, and 5 Amps will give approximately 10v. VR1 is a potentiometer; this allows a sample from 0 to 100% of the output of U1 and allows us to chose the current that triggers the reversing action. U2 is set up as a comparator. When U2's -input goes above its +input its output will rapidly fall from around 10v to 0v. Since U2+input is fixed at 3v by the voltage reference diode D4 we can choose a stall current from around 1.5A to approx 5.5A. The low going output from U2 triggers the NE555 timer IC. This is configured as a monostable - a single input pulse triggers an output pulse whose duration is set by R6 and C1. The output goes high, turning on Q1 and subsequently RLY1 and RLY2, driving the motor in reverse for the desird duration.

How would I do it? Two relays as before, but a single 8-pin microcontroller monitoring the voltage on R1 and triggering Q1, everything else done in software! But that's another story....
Thank you for this! This is very well thought up and may be a bit out of my league at the moment :) What if I wanted to do something as simple as install an additional sensor, and when triggered, tell the DC motor to stop even if the sensor already displayed in the diagram is being triggered? Almost like an override kind of thing? And possibly even a buzzer letting the user know that the sensor stopping the DC motor is being triggered?
 
Last edited:

sghioto

Joined Dec 31, 2017
8,643
What if I wanted to do something as simple as install an additional sensor, and when triggered, tell the DC motor to stop even if the sensor already displayed in the diagram is being triggered? Almost like an override kind of thing? And possibly even a buzzer letting the user know that the sensor stopping the DC motor is being triggered?
Sensor #1 is the override.
1720627591581.png
 

Irving

Joined Jan 30, 2016
5,167
Thank you for this! This is very well thought up and may be a bit out of my league at the moment :)
Appreciated, and yes it was, yet its not that complex once you have some understanding. I did it to show its not that hard to find a solution, when broken down into standard building blocks.
 

Thread Starter

circuitpachi

Joined Feb 8, 2024
40
Im working on one last project and have exhausted all of my other sources trying to figure out the wiring diagram... So I will tell you what I have and where I am stuck. I am using the same NPN NO 3 wire proximity sensors along with a 5-pin automotive relay. I built a ball bearing distribution system that takes thousands of ball bearings and distributes them along 6 different tubes.

My goal: to have 6 3 wire proximity sensors that monitor 6 lanes with steel bearings in them. At any time when one proximity sensor is not triggered (bearings have left that lane), I need that sensor to trigger the motor to run (same for any of the other lanes/sensors).

Where I am currently at: The motor runs but at any time one sensor is triggered the motor turns off rather than all of them except for one..

Ive read that I need to run the proximity sensors in a series, but I dont quite understand why or how. Would a 6 module control relay work as well? Any help or advice would be greatly appreciated :)
 
Last edited:

sghioto

Joined Dec 31, 2017
8,643
In a parallel format like this should accomplish the goal.
If all 6 sensors are detecting the ball bearings then the relay is in the OFF mode, Motor not running.
1738468142250.png
 
Last edited:

Thread Starter

circuitpachi

Joined Feb 8, 2024
40
In a parallel format like this should accomplish the goal.
If all 6 sensors are detecting the ball bearings then the relay is in the OFF mode, Motor not running.
View attachment 341735
Do you think it would be easier to use 6 NC proximity sensors and run those to a relay? So that all the sensors will constantly send a signal to the relay until they start to switch off one by one. Once the last one is triggered then they will all be in the open position and the motor will stop? Would that work?
 

MisterBill2

Joined Jan 23, 2018
27,708
At this point I would recommend changing to an inexpensive PLC (Programmable Logic Controller), since I am guessing that this is a production system and not a hobby project. With a PLC it would be quite simple to adjust the operation of the motors as required, with not much limitation as to the actual number of relays and relay contacts. An added advantage is the availability of timers and counters, if future upgrading demands them.
 
Top