/       /       /    Non-contact sensor for controlling lighting
Support the project on Patreon


Non-contact sensor for controlling lighting

$8.61 (5шт)
Go to store
A brief look at a non-contact sensor for controlling various loads, although its main use is still controlling lighting.


Some time ago—or, to be precise, six years ago—I built kitchen cabinets for my home and needed a convenient way to control the lighting. The thing is, the kitchen is a place where you sometimes have to turn on the lights with wet or even dirty hands, for example while cutting up meat, so ordinary switches aren't very convenient.

The second reason was that I wanted hidden switches, and I managed to make that work. I got help from my namesake in Belarus, who posted an article about this kind of switch online (if I remember correctly, this is it). I got in touch with the author, and later he modified the circuit at my request. The circuit looks different now, but I'll talk about that later.
It all works almost normally. Why I say “almost” is something I'll also explain as we go through the review—in context, so to speak.

The photos were taken almost six years ago, on September 4 (you could call it an anniversary). The quality is awful, and unfortunately I can't get to the switches to take new photos.
As you can see, there was a small board with a microcontroller and a pair of LED and phototransistor.
It was all installed inside a false panel in the kitchen. I drilled a recess 35 mm in diameter and about 8 mm deep with a Forstner bit, then cut a groove for the wires. I didn't have a router back then, so I did it with a crowbar and a lot of swearing. It came out rough and crooked :(


But once everything is assembled, you can barely see anything. From the outside, there's just the light fixture itself and a couple of holes, visible at the top of the photo.
One of the two switches works almost perfectly. The other stopped working properly fairly quickly and now only responds to something more reflective than a hand.


Since I'll be doing a similar kitchen build and installing switches soon, I got a ready-made version to review. It's sold individually or in packs of 5–10; in my case, it's a lot of 5.


Small, neat boards, and the quantity checks out. No complaints so far :)


The circuit board measures 40 × 10 mm and is about 8–8.5 mm tall.
The board is designed to fit inside a profile for LED strips, although the sensor module itself protrudes slightly beyond the diffuser, which spoils the appearance a little. Also, be careful: the strip can only be connected correctly from one side. Install it the other way around and the polarity will be reversed. Nothing will burn out, but you'll have to cross the wires over.


The design is extremely simple: a small board with a reflective photosensor, a microcontroller, a voltage regulator, and a MOSFET to switch the load.
The specifications state a 12 V supply and a load current of up to 3 A, while the load power is listed as 36–72 W, which suggests it can also run on 24 V.
A closer inspection showed that the input voltage regulator is rated for 40 V, while the switching transistor is rated for 30 V, so the supply range is probably 12–24 V. I wouldn't go any higher. You can go lower, though—the board works fine from about 6–7 V.


The microcontroller is an HT68F002, the voltage regulator is an SE8550, and the MOSFET is an AO3400. The maximum switching current is 5.8 A.

There are no components on the underside of the board, so you can stick it on with double-sided tape, just like an LED strip.


I included links to the datasheets above, but I thought the circuit diagram might be useful to someone too, especially since it's simple.



There's not much to measure here. The stated current consumption is 10 mA; in reality it's about 1 mA, rising to 7–10 mA when switching on or off.
I also checked with an oscilloscope what was happening at the sensor LED control output. The LED operates in pulses to keep the circuit economical; with continuous power, current consumption would be around 60 mA.
The LED flashes at about 33 Hz, with a pulse duration of 230 µs.


The operating principle is extremely simple: bring your hand close and the light turns on; bring it close again and the light turns off. Keep in mind that this isn't a motion sensor. It doesn't matter whether you move your hand or not; it responds to reflected light.
There's a jumper position on the board marked J1 R0, connected to pin 5 of the microcontroller. Installing the jumper disables trigger mode, and the load stays on as long as the sensor is triggered.
There is also a little blue LED that lights up when the unit is off, which is very handy.


But as they say, a picture is worth a thousand words, so I made a few GIFs to demonstrate how it works.

With ordinary ambient lighting, everything works very conveniently, although I did notice the switch turn on by itself once. I couldn't even figure out why.
The trigger distance depends on ambient light and is 6–8 cm under normal conditions.
<img src="https://pic.mysku-st.ru/uploads/pictures/02/55/13/2019/09/03/a946f3.gif" alt="" rel="lbox" />

Light from an LED strip has practically no effect on the trigger distance.
<img src="https://pic.mysku-st.ru/uploads/pictures/02/55/13/2019/09/03/7965ad.gif" alt="" rel="lbox" />

A desk lamp with a halogen bulb, however, completely blocks it from working. That's because it uses the infrared range and has neither automatic gain control nor continuous-light rejection or a carrier frequency, as found in IR receivers for ordinary remote controls.
The person who posted their design a long time ago has since switched to a model with an IR receiver rather than a regular phototransistor. That circuit doesn't have this drawback, but the receiver is larger.

Light from its own LED can also block operation. That's exactly why one of my sensors started working poorly: I had drilled holes in the chipboard, but apparently one of the boards lifted slightly over time for some reason. Now, to turn it on, I have to bring something reflective close to it, such as a metal lid.
<img src="https://pic.mysku-st.ru/uploads/pictures/02/55/13/2019/09/03/bea2fc.gif" alt="" rel="lbox" />

You can partly address the problem by narrowing the photodiode's field of view, for example with a simple piece of heat-shrink tubing.


The circuit starts working properly, but direct bright light is still a problem. For example, when the sun shines directly onto my countertop, the light can turn on and off by itself.


There's one more "quirk"—it's not a fault, it's just how it behaves. If you hold your hand at a certain distance, the switch starts turning on and off. I don't know why; it happens even when nothing is connected to it and the status indicator LED is covered.
<img src="https://pic.mysku-st.ru/uploads/pictures/02/55/13/2019/09/03/705a79.gif" alt="" rel="lbox" />


So, what can I say about it?
Let's start with the good. It works: the sensor turns on and off, draws little power, fits in a standard aluminum profile, and is assembled reasonably neatly.
But there are downsides too. Because the circuit is so simple, it is affected by light fixtures that emit a lot of infrared radiation—in other words, ordinary incandescent bulbs.

At one point I had an idea for a simple way to address the problems mentioned above: separate the phototransistor from the microcontroller with a capacitor to block DC, then use the LED to transmit a simple code to filter out interference. When the reflection is good and the microcontroller sees that the code is correct, it turns on the lights. But I'm not a programmer, so I couldn't implement it.
There is also a similar switch made from discrete components. If I remember correctly, it uses a DTMF decoder IC.

In short, you can use it and it works, but keep the "quirks" described above in mind when installing it.

That's all from me. I hope this short review was useful.
$8.61 (5шт)
Go to store
This page was found when searching for:
https://www.kirich.blog/obzory/radiolyubitelskoe/791-beskontaktnyy-datchik-dlya-upravleniya-vklyucheniem-osvescheniya, ht66f002 схема подключения, ha8121c datasheet, datasheet ha8121c, схема подключения cx2812, ha3089 datasheet на русском, ha8121c переделать с5в на 12в схема, ha8121 datasheet, ha 8121, datashet ha8121c, cx2812 чем заменить, даташит ha8121c, cx2812 datasheet, kw68f92c даташит, hh004f datasheet, ht66f04c, микросхема se8250, se8250 datasheet на русском, ht68f002 плавающий ключ или нет, ложные срабатывания бесконтактного датчика xk gk 4010a, rf 2520, cx2812 даташит на русском, микросхема ha8121c даташит, xk gk 4010a схема подключения отзывы, ht66f0185 holtek

The figures from this review are in the measurement database: Other devices


Discounted products


You may be interested in


Discounted products


Support the project

All the content on the site and the advice are free, but we’d be grateful for your support of the project and the channel!

Discuss on the forumHave a question or some experience to share? Discuss the article with the author and readers: the forum is a convenient place to share schematics and photos.
Go to the forum

Only registered readers can comment. It takes a minute to sign up, and you can log in with the same account you use on the forum.

Log inRegister