12v motor, relay module, IR sensor wiring

I'm currently working on a project with my son and have a few questions. I have attached a drawing of what I'm trying to accomplish. His project involves a beam scale that when weight is added will allow the beam to move in the upward direction.

81 rpm Mini Econ Gear Motor (Slow Motor
227 rpm Mini Econ Gear Motor (Fast Motor)

I will try to accomplish this by using 2 IR Photo Sensors from a 12v source. The picture attached in the details below show how it is setup.

The Project:

  • main power switch to power on everything from a 12v source.

  • start switch - will be the main switch to operate the system. It will power both Mini Econ motors to drive the beam upward.

  • Mom on Switch - will only be used if fine tuning is needed and will be a (Mom - on) switch that bypasses the IR sensors to get the beam at the precise location.

You'll notice that there is a top IR sensor and bottom IR sensor.

I’m hoping that in theory:

  1. Start switch will power both motors to turn simultaneously.

  2. While both motors are running, the beam sits idle in the fast motor sensor or bottom IR sensor

  3. When the beam starts to move upward and clears the bottom sensor, the faster motor 227 rpm will shut off. I would assume this has to be wired for a NC circuit. So that when the beam clears the IR sensor, the circuit will be broken and thus the motor will shut off.

  4. Now the beam is between the bottom IR sensor and the top IR sensor while only running on the single slower 81 rpm motor. This slower turning motor allows the beam to rise at a much slower pace for a precise stop.

  5. The beam continues to rise on only the 81 rpm motor, until it reaches the top sensor.
    Once the top sensor is breached, power is killed to the 81 rpm motor. I would assume that this need to be wired NO circuit. So that when the beam enters the top IR, the circuit is broken and thus now both motors are off.

  6. The top Sensor can be fine-tuned for precise stops. But if stops are not precise, the Mom on switch will allow “bumping” of the slower motor to get the beam to the precise location. It must override the IR sensors to get to the precise stopping point.

I believe that the motor wiring is my issue.
12v power is converted to 5v for the IR sensors.
5v neg to IR neg
5v pos to VCC
Out signal to the IN1 or IN2 depending on which motor to control.

12v power sent through main switch into start switch which then goes to DC+ on Relay module. DC- goes to battery.

I believe my issues are on the other side of the relay. So any information would be greatly appreciated.

This is an Arduino forum, and I don't see any Arduino on your diagram.

1 Like

Momentary On

There are none. There are "motor sensors" but no indication how a motor is sensed.

How is a sensor tuned to stop a motor? I would think sensors "sense"... and no indication on that either.

1 Like

Sorry, your mechanical connection diagram doesn’t provide enough clarity for me to understand your circuit or what you’re trying to achieve. Could you post an annotated schematic that includes all of your connections? Be sure to show power, ground, power sources, and any other components involved. This will help in providing a more accurate response.

Hi, @titans7
Welcome to the forum.

The link will show oyu how the copy and paste the code in your post.

Thanks.. Tom.... :smiley: :+1: :coffee: :australia:

How do you get the motors to go down?

I ended up figuring it out. Yes, I understand this is a Arduino forum to the response, but this is the general discussion section and was just asking questions. Sorry to step on anyone toes here.

I'm not an electrician but I am a mechanical engineer. So, some of the electric terminology that I used probably isn't understood by the folks on this site. Think of a Labotory beam scale. It has a beam (like a seesaw) with a sliding movable weight on the long end and the shorter end has a fine-tuning weight with a pan hanging from it. As weight is placed in the pan, the beam will rise according to the weight applied.

Here is the scale being used for the project

As weight is applied, the beam will move upward toward the target point of 0.
There is a brass beam plate that extends out the back of the scale. It's a flat brass plate. In this pic, you can get an idea.

My plan is to use the 2 IR optical sensors in order to trigger the relays. Placement of these sensors is critical because accuracy is the upmost importance, thus the adjustment screw that is 3D printed. It was the wiring that I had trouble with. But I finally figured that out.

The beam will go back down to the resting point when the weighted pan is removed. The object of the project is the fill the pan as fast and precise as possible to reach 200g of weight and do this 10 times. Fastest time wins.

The motors will be coupled to a 1/4" brass tube about 4" long that will dispense very small lead BB's. These BB's will exit the brass tube and fall into the pan. Thus, the using of 2 separate rpm motors.
@JCA34F, the motors will not be cranking up the beam, just dispersing the BB's like an auger. So when the relays energize the state in which I want, the motors will stop immediately. Once the pan is removed, dumped and replaced back on the scale, the motor are off awaiting on the start button yet again to be pressed for the next cycle.

There is no code on this.

Where I messed up was the outputs of the relays. I needed to run power to the COM on both relay outputs then wire the motors accordingly to the desired NC or NO contacts.

The relay output changes, now it works. Just need to fine tune the 3d printed part.

Hi, @titans7
Thanks for the explanation.
So the two IR limits are digital ON/OFF and the precision of your measurements will be how fine you can position the IRs to have a dead spot in the middle.
The lower speed motor will adjust the beam to this position.

Another way is to use IRs that have analog output, in other words the amount that the IR is obscured produces a voltage proportional to position.
The IRs are setup with a flag on the end of the beam large enough to obscure part of both IRs, one IR above the other like you have, then you adjust the beam angle to get equal readings from the IR sensors.
This will be the measured balance point.

The motors control the loading of the weighing dish with BBs, not the actual beam, so no reverse needed, you just tip to BBs out of the dish after each successful weighing.

Thanks.. Tom.. :smiley: :coffee: :australia:

I can see a third version with a flag with a series of apertures attached to the arm. The IR sensor would allow counting to confirm the movement of the arm and count to know it's position.

Good to know thanks