The relay is operating correctly when the unit is working it then stays on. I do not understand your post about the remote, there is no remote. The sensor switches on the leds when you pass your hand over it or in front of it and off when you pass your hand over or in front of it again.View attachment 66889
Seems to me that the sensor is a simple two pin IR LED transmitter and a three pin IR phototransistor.
Thay make up a proximity sensor.
The IR LED transmitter should be on all the time. You can see it with camras with out IR filters.
The IR phototransistor needs power all the time and changes its output when it sees reflected signal from the IR LED transmitter. IE when you wave your hand in front of it.
This setup can sometimes be effected by other light sources like florescent lights.
Test it in a dark room and see if you can see the transmiter with a camra.
Hi 4pyros
I think you are right as there is 5 wires coming out of the sensor. 2 to one sensor and 3 to the other. I do not think other light sources affect it as it has beed working perfectly well for 2 years.
Problem may well be the designed obsolence in electronic products. they are not made to last anymore and hard to repair with sometimes exotic very hard to get IC's, or just unmarked items.
Take into consideration that a bathroom is a moist and damp environment.
The circuit board looks ok from the photo's but the tiny SMD components may have drifted in value and are a pain to unsolder and test.
I dont think a drift in value of the components would cause this simple circuit to fail.
All this may be true of cheep DVD players and more complex stuff but not so much for a simple IR controlled switch.
Thay all seem to be clearly marked common parts to me.
I dont think a drift in value of the components would cause this simple circuit to fail.
All this may be true of cheep DVD players and more complex stuff but not so much for a simple IR controlled switch.
Try replacing the capacitors. The PIC uC might be getting interference, or it might be going into brown-out mode.
Also, try to remove any possible interference sources (like CFL's, pull down the window shade, etc...)
What voltage is powering the PIC uC?
Yes, a drift in values will indeed cause issues in electronic circuits!!! If the ESR of a capacitor drifts upwards, it won't be able to handle it's rated ripple current, and it will not filter out much AC.