What IC or module to use to simplify touchless toggle switch project? - Page 1
Forum section: electronics / beginners

author: Isaac Clarke
author_rank: Newbie
timestamp: February 05, 2022, 01:09:48 pm
content: Need help simplifying this project as arduino is abit overkill for this application. I am abit noob at electronics and wondering if there are any IC's or modules that will simplify or make this project more efficient. Thanks.DescriptionIR-1 and IR-2 are IR obstacle avoidance sensor modules.Relay-1 and Relay-2 interconnect to form a latching relay.Operation:If finger swipes past IR-1 THEN IR-2, Turn ON relay (keep in NO position)If finger swipes past IR-2 THEN IR-1, TURN OFF relay (return to NC position)Pretty much same as a normal light switch.

author: rpiloverbd
author_rank: Regular Contributor
timestamp: February 05, 2022, 01:45:16 pm
content: Do you really need a latching relay for this experiment? How many loads do you have? If you have only one load, switching it with only a single channel relay module will be enough.

author: Terry Bites
author_rank: Super Contributor
timestamp: February 05, 2022, 03:07:29 pm
content: https://www.homemade-circuits.com/simple-touch-sensor-switch-circuit/

author: Ian.M
author_rank: Super Contributor
timestamp: February 05, 2022, 04:43:28 pm
content: Quote from: Isaac Clarke on February 05, 2022, 01:09:48 pmIt depends on your requirements.If you are happy with anything that operates vaguely like a light switch or touch switch, then yes, various logic circuits could be used with your sensors, or they could be replaced by various touch switch circuits. The problem is you may get unexpected activation due to conditions you haven't considered but that still somewhat resemble the above operation conditions. e.g. if IR-1 on its own gets momentarily activated several times by a moth fluttering by, and a day later IR-2 on its own gets activated by the moth landing on it, the relay could turn on as IR-2 has been activated after IR-1However if you specify that it *SHALL* operate *STRICTLY* as described, with no other interaction causing any change of state, and specify the acceptable speed range of the swipe in terms of minimum and maximum times an individual sensor is active for, and minimum and maximum time offset between each of their activations, (and if using analog output sensors, specify a detection threshold) then, although sequential logic could be designed to do the job, a MCU is really the best option, due to the complexity of the logic required to exclude invalid signal sequences.If you want something more compact than an Arduino, you could install an ATtiny core for your Arduino IDE, then use an 8 pin ATtiny, porting your existing sketch to it, and programming it with any hardware programmer capable of AVR ISP, e,g an Arduino running the ArduinoISP sketch. However the ATtiny needs a regulated low voltage supply (typ. 5V or 3.3V) so you will need extra components to provide that.

author: ledtester
author_rank: Super Contributor
timestamp: February 05, 2022, 05:05:42 pm
content: Quote from: Isaac Clarke on February 05, 2022, 01:09:48 pmWhat should happen if IR-1 is activated but not IR-2?What about if IR-1 is activated and only 10 minutes later IR-2 is activated followed by IR-1... which position should the relay be in?These kind of odd cases can easily be handled by a microcontroller but might be very difficult to do in pure hardware.If you are looking for a smaller solution than, say, an Arudino Uno, search for "single chip arduino".Or consider one of these smaller microcontroller boards:- Digispark Attiny85- Seeeduino XIAO

author: Isaac Clarke
author_rank: Newbie
timestamp: February 06, 2022, 01:23:02 am
content: Thanks, I will take a look at these single chip arduino. was thinking about using CD4013 D type flip flop but it might make it abit complex in regards to the logic and timing.

author: Isaac Clarke
author_rank: Newbie
timestamp: February 06, 2022, 01:26:55 am
content: I need a latching relay or something that will hold the relay in the NO position as I need to power 1 240VAC load through that relay.