# Two edge-triggered signals to control a small DC motor

#### Emse

Joined May 1, 2020
9
Hi all

This is my very first post in this forum.
And I probably have to state, that my experience with circuit designing is very limited. I had a couple of courses 5+ years ago - so I am a bit rusty. So please be patient with me. Furthermore I am not a native english speaker, so if something is unclear, please let me know

Let's get to the case. See my simple sketch for reference.
I am trying to design a fairly simple circuit, where two signals shall control a small DC motor (Output).
One signal will be from an IR sensor (Input B) and the other one will be from a switch (Input A).
My idea is to trigger the output with the positive edges from the two input signals.

I have tried searching and thereby seen a lot of somehow similar problems, where e.g. a "bistable latching relay" or a "dual positive edge triggered flip flop" has been utilized. But in all the examples I have read there is always a small difference to what I need, and I simply do not have the experience to modify it to my needs.

So all in all could you help me with some ideas for how this could be solved?
Suggestion to diagrams and specific components of everything except from the supply and the load will be highly appreciated.

Thanks !

#### Attachments

• 16.2 KB Views: 13

Joined Jul 18, 2013
23,115
When you say 'trigger the output' do you mean you want to trigger an output to remain on, when Either inputs occur?
When or what do you want to switch it off?
Max.

#### Emse

Joined May 1, 2020
9
Hi Max

Thank you for replying. Did you see my sketch?
I want to turn on the motor when a rising edge occurs from the IR sensor (input B) and then the motor should be on until a rising edge occurs from the switch (input A). Then the motor should be off until the next rising edge occurs from IR sensor (input B) and so on.....

Hope this clarifies a bit.

Joined Jul 18, 2013
23,115
You could use the IR sensor into a 2n7000 mosfet gate, which in turn would pick up the motor relay, a N.O. contact on the relay would be in paralel to the mosfet to latch it in, also in series with the coil would be the Switch, but N.C contact.
This is the normal Stop/Start circuit.
Info needed on the IR sensor
Max.

Last edited:

Joined Mar 10, 2018
4,057
Here is an alternative approach using one of the graphical programming languages
for Arduino.

You drag and drop programming blocks from 2 window to third, config, like picking
pin number for specific pin, and then hit upload and mBlock generates the Arduino
code you see in right hand window. Note I did not show debouncing the pin with mechanical

Arduino Nano board, $2, more than sufficient to do this. Regards, Dana. #### Attachments • 150.5 KB Views: 2 Thread Starter #### Emse Joined May 1, 2020 9 You could use the IR sensor into a 2n7000 mosfet gate, which in turn would pick up the motor relay, a N.O. contact on the relay would be in paralel to the mosfet to latch it in, also in series with the coil would be the Switch, but N.C contact. This is the normal Stop/Start circuit. Info needed on the IR sensor Max. Hi Max Thank you for your efforts. I have tried visualizing what you mentioned, but I am not certain about all of it. Could you take a look and point me in the right direction? See attached picture. #### Attachments • 26.1 KB Views: 4 Thread Starter #### Emse Joined May 1, 2020 9 Here is an alternative approach using one of the graphical programming languages for Arduino. You drag and drop programming blocks from 2 window to third, config, like picking pin number for specific pin, and then hit upload and mBlock generates the Arduino code you see in right hand window. Note I did not show debouncing the pin with mechanical switch, thats easily added. Arduino Nano board,$ 2, more than sufficient to do this.

View attachment 206302

Regards, Dana.
Hi there

I actually already made my project with an Arduino (see attached picture of the prototype).
Now I just wanted to try to make it with simpler components - and also in order to improve my circuit designing skills (which truly need some practice....hehe).

But thanks again for you input.

#### Attachments

• 136.3 KB Views: 7

Joined Jul 18, 2013
23,115
Hi Max

I have tried visualizing what you mentioned, but I am not certain about all of it. Could you take a look and point me in the right direction? See attached picture.
Not all there, the switch across Mosfet is a contact on the motor relay., I could mock it up if you need.
What is the part No. of the IR sensor?
Max.

Last edited:

#### Emse

Joined May 1, 2020
9
Not all there, the switch across Mosfet is a contact on the motor relay., I could mock it up if you need.
What is the part No. of the IR sensor?
Max.
That would be great, thanks!
IR sensor is: E18-D50NK

Joined Mar 10, 2018
4,057
Hi there

I actually already made my project with an Arduino (see attached picture of the prototype).
Now I just wanted to try to make it with simpler components - and also in order to improve my circuit designing skills (which truly need some practice....hehe).

But thanks again for you input.
What external components are you trying to get rid of ?

Regards, Dana.

Joined Jul 18, 2013
23,115
@Emse I see it is normally open, so NPN conducts when a object is sensed?
Max.

#### Emse

Joined May 1, 2020
9
The arduino board just thought it was too excessive to have a board there to control such simple tasks. So wanted to try with another type - and yearh, as mentioned, I also wanted to get better in circuit design.

#### Emse

Joined May 1, 2020
9
@Emse I see it is normally open, so NPN conducts when a object is sensed?
Max.
The output of the IR sensor is normally high. And when an object is observed it goes low

Joined Jul 18, 2013
23,115
Ok I figured that, I see what I can do.
Max.

#### Danko

Joined Nov 22, 2017
1,083
One signal will be from an IR sensor (Input B) and the other one will be from a switch (Input A).
My idea is to trigger the output with the positive edges from the two input signals

Last edited:

Joined Jul 18, 2013
23,115
Per post #3 , Something like this maybe.?
Forgot the reverse EMF diode across the relay coil.

Max.

Last edited:

#### Emse

Joined May 1, 2020
9
@Danko : That looks exactly what I need. Thanks a lot!

@MaxHeadRoom : Thank you for your efforts. I will try to sketch up your suggestion in LTspice and see ifI can make it work.

Thank you both. So far it has been a great start to this page. Great support on my first topic.

#### Emse

Joined May 1, 2020
9
@Danko
Is it possible that you could send me your simulation file (assume you made it in LTSpice)?
I have used a built in model of a Schmitt trigger (which might be the issue), but I do not get the same curves as you. I only get 'spikes' on the output.

#### Danko

Joined Nov 22, 2017
1,083
Is it possible that you could send me your simulation file (assume you made it in LTSpice)?
I sent you 2 files:
A. 2front_standard.asc - with standard LTspice models:

B. 2front_74HC132.asc - with model from
@Bordodynov collection (3 files), which you can