Converting IR Obstacle Sensor into a "waving switch"

Thread Starter

Robert Les Paul

Joined Feb 19, 2018
6
Hey guys, I recently purchased an "IR obstacle" module known as "FC-51".
Sensor, circuit and the rest of the components can be seen here.
_____________________________________________________________________________________________________________________
This is essentially a sensor which detects objects infront of it by emitting IR signals onto an object,
which in turn reflects it and the signal is cought by an IR reciever which then outputs a signal.

I would like to turn this into a "touchless / waving" switch; by that I mean I would like to somehow make the signal
output trigger a relay and latch it so it doesn't change state until a new signal is detected.
_____________________________________________________________________________________________________________________
Practical example of what it does:

Put your hand in front of the sensor and it triggers a relay and turns on a LED strip
Move your hand away and it shuts the relay / led strip off.

_____________________________________________________________________________________________________________________
Practical example of what I want it to do:

Put your hand in front of the sensor to trigger a relay and turn on an LED strip
Move your hand a way and the relay / LED strip will stay on until you put your hand back again.
_____________________________________________________________________________________________________________________
I'm aware that there are bistable / impulse relay modules out there, but I'd rather try and learn something new. I suppose I'm looking for a latching ciricuit that latches a digital signal rather than a mechanical switch input which is somewhat commonly seen.

Trouble is I don't even know where to start as this is the first time I'm encountering something like this and I wasn't educated in the field of electronics. I'm guessing that either transistors or 555 timer or some flip flop circuit is needed to latch the signal.
_____________________________________________________________________________________________________________________
I would appreciate any help with this matter, cheers.
 

ericgibbs

Joined Jan 29, 2010
13,836
hi Robert,
Welcome to AAC.

What you are asking to do, is possible.
There a number of Bi-stable IC's available, the HEF 4013 is one.

Do you have a Bread Board [ solder-less socket board] you can build a test circuit.?

E
 

Attachments

Hey guys, I recently purchased an "IR obstacle" module known as "FC-51".
Sensor, circuit and the rest of the components can be seen here.
_____________________________________________________________________________________________________________________
This is essentially a sensor which detects objects infront of it by emitting IR signals onto an object,
which in turn reflects it and the signal is cought by an IR reciever which then outputs a signal.

I would like to turn this into a "touchless / waving" switch; by that I mean I would like to somehow make the signal
output trigger a relay and latch it so it doesn't change state until a new signal is detected.
_____________________________________________________________________________________________________________________
Practical example of what it does:

Put your hand in front of the sensor and it triggers a relay and turns on a LED strip
Move your hand away and it shuts the relay / led strip off.

_____________________________________________________________________________________________________________________
Practical example of what I want it to do:

Put your hand in front of the sensor to trigger a relay and turn on an LED strip
Move your hand a way and the relay / LED strip will stay on until you put your hand back again.
_____________________________________________________________________________________________________________________
I'm aware that there are bistable / impulse relay modules out there, but I'd rather try and learn something new. I suppose I'm looking for a latching ciricuit that latches a digital signal rather than a mechanical switch input which is somewhat commonly seen.

Trouble is I don't even know where to start as this is the first time I'm encountering something like this and I wasn't educated in the field of electronics. I'm guessing that either transistors or 555 timer or some flip flop circuit is needed to latch the signal.
_____________________________________________________________________________________________________________________
I would appreciate any help with this matter, cheers.
A good place to start would be to investigate gesture sensors. See the chip (APDS-9960) on this experimenter board for example, which also has support and software. https://www.sparkfun.com/products/12787
 

Thread Starter

Robert Les Paul

Joined Feb 19, 2018
6
Thanks for the welcome! And yes, I do have a breadboard and a bunch of "basic components".
I've checked if the mentioned component is available in my country, no hits, however, I found something called "SN 74HC74".
Would that be a suitable alternative, seeing as it's also a dual d type flip flop IC ?

Raymond, I'm aware of the gesture sensors, however it generally takes 30 days for the items I order to arrive so I'd like to avoid
them. I also do own an Arduino which I can use to perform the intended task but I'd rather do it without a micro-controller.

Thanks for answering guys!
 

ericgibbs

Joined Jan 29, 2010
13,836
hi Robert,
That LS373 is an 8 bit Latch with a common Enable.
It would be messy to try to use that in your project, it would require some additional logic, to make a bistable action.
E
 
Raymond, I'm aware of the gesture sensors, however it generally takes 30 days for the items I order to arrive so I'd like to avoid
them. I also do own an Arduino which I can use to perform the intended task but I'd rather do it without a micro-controller.

Thanks for answering guys!
I sometimes under appreciate the difficulty in getting parts. Not sure this will be of much help, but ....

The FC-51 operates on ~5v. Th OUT pin is High (~5V) when there is no obstacle and goes low (~0v) while there is an obstacle.

Looking at the two descriptions of what you want "it" to do:

1. Put your hand in front of the sensor and it triggers a relay and turns on a LED strip
Move your hand away and it shuts the relay / led strip off.

2. Put your hand in front of the sensor to trigger a relay and turn on an LED strip
Move your hand a way and the relay / LED strip will stay on until you put your hand back again.

In the case of 1, as long as OUT is low, operate the relay (and light). That is pretty easy. See the diagram below from https://engmousaalkaabi.blogspot.com/2016/02/220v-avoidance-switch-using-fc-51.html

I would think that a capacitor on 5v regulator should be used, but you get the idea. Also note that OUT is going to the relay GND pin.

Now, for 2, a high to low transition on OUT triggers the relay and it stays energized until another high to low transition on the OUT line takes place. Then, the next high to low operates it again and so on. It's a little more complicated.

For me, I would simply program a cheap PIC e.g., a .68 cent 10F202 to do the job easily.

I don't think that is what you want, so I will step aside because there are others here that can guide you how to do it with 74 logic far better than I can.
 

Thread Starter

Robert Les Paul

Joined Feb 19, 2018
6
Understood Eric, I figured it wouldn't do the trick but I wanted to be sure. In the event that I do get a Dual D-Type Flip Flop IC, how would I proceed though ?

Raymond, thanks for bringing that 10F202 to my attention! As for that circuit, I've connected that in the past, it's rather simple and useful for
closet lighting or alike, but not what I need. Seeing as not too many ideas found this topic, I might have to resort to a micro-controller option.

Would you mind telling me if additional components would be required if I used the 10F202 (caps, resistors and alike) ? I've generally always used Arduino in the past, never a standalone micro-controller. The one you mentioned seems to be readily available around here.
 
Understood Eric, I figured it wouldn't do the trick but I wanted to be sure. In the event that I do get a Dual D-Type Flip Flop IC, how would I proceed though ?

Raymond, thanks for bringing that 10F202 to my attention! As for that circuit, I've connected that in the past, it's rather simple and useful for
closet lighting or alike, but not what I need. Seeing as not too many ideas found this topic, I might have to resort to a micro-controller option.

Would you mind telling me if additional components would be required if I used the 10F202 (caps, resistors and alike) ? I've generally always used Arduino in the past, never a standalone micro-controller. The one you mentioned seems to be readily available around here.
Well, here is the thing...you need a programmer and knowledge of a programming language for the chip (likely ASM, but there are probably some alternatives like XC8 C, PICAXE and their Basic). Those programs are free, but not the programmer.

As far as additional components, well not many, a bypass cap for the PIC chip and that's basically it. The ports on the PIC will directly drive or be driven by whatever IO (edited out GPIO) that will work with the Arduino (such as the FC-51 and the relay board).

It is an investment. Whether it is worthwhile for you depends, in part, on what you want and what other projects you might see using the little PIC chips for.
 
Last edited:

Thread Starter

Robert Les Paul

Joined Feb 19, 2018
6
I see. These languages are definitely not ringing any bells. Could I pull off the same thing with an Attiny85-20PU (standalones) and alike ?
And thanks for going into details!
 
I see. These languages are definitely not ringing any bells. Could I pull off the same thing with an Attiny85-20PU (standalones) and alike ?
And thanks for going into details!
I don't see why not, but I have almost no experience with them - still, those need to be programmed using a language like ASM pretty much in the analagous way as the PIC chip. BTW: Both are made by the same company, Microchip.
 

Thread Starter

Robert Les Paul

Joined Feb 19, 2018
6
I believe I have one Attiny lying around somewhere, I'll just try with a simple blinking LED code from Arduino library on a breadboard, if it works with C/C++ (I'm guessing it will since variations of these chips are integrated in Arduino) then I could work my way up.

Thanks for helping out!
 
Top