Automatic staircase lighting


This is a tricky one… so, get a cup of coffee, lean back in your seat and relax somewhat before beginning reading… ;-))

I use two MK120 IR light barriers to activate an automatic stairway lighting based on LED’s powered through a MAX6956 driver (Tip: Go to to get info on that chip; it is a powerful means to drive up to 28 LED groups with dimming effects and so on…).

The MK120 receivers drive each an input on a PIC12F629. The PIC then communicates with the MAX6956 through a firmware emulated I²C to turn the LED’s on, wait for some time, and then turn them off.

Each output of the MAX commands a pair of white LED’s connected in series and disposed at each side of one step of the stairway. Those LED’s are powered as shown in the MAXIM’s application note found at (figure 6: transisor with a 3.3V driving their base), on a 12V power supply.

The MK120 are also powered by this 12V power supply, but the PIC and the MAX are of course powered through a 78L05.

The PIC and the MAX and the firmware are working very fine. I have one problem with one of the IR barriers (I exposed this in the “Minikits” forum, and will not discuss it here).

But here’s my other problem…

I connected the MK120 receivers to the PIC so that T2 connects the PIC input to ground when the barrier detects a passage. Of course, the weak pull-up of the PIC is activated in software. I also connected a LED (with R) to the +5V to get a means of verifying the good working of all that stuff.
Everything works fine when working at close distance, but when I installed the barriers apart from the master control unit, I got problems… The wire is somewhat 7 meters long, and I get strange behaviour:

The first thing I do in firmware when turning the unit on, is testing all LED’s by turning them on each after the other. At some point in the process, the program appears as frozen in time: the I²C communication stops (I also have a LED installed on the SCL line to visualize the I²C communication) and everything stays as it is. At the same time, the control LED on the command line coming from MK120 goes brighter and brighter each time a LED is turned on, as if a power drain occures on the wire. When I disconnect the command signal from MK120 (the 7 meter long wire), then the program resumes and goes on, until completion. Also, if I disconnect all the LED’s from power supply (see MAX6956 datasheet, and you’ll see that all those LED’s are connected as common anodes, in my case, to the 12V through a transistor as shown in figure 6 of the application note referenced above

I checked the power supplies during this and got a perfectly stable 12V and 5V where it is intended to.

I cannot connect a pull-up between the collector of T2 (MK120 receiver) and +12V, because this would damage the PIC’s input (Remember, the pull-ups are enabled in the PIC, anyway).

I’ve tried with external pull-ups instead of the internal pull-ups of the PIC and went as low as 100 ohms, without a totally satisfying result. The drain in the command line seems to decrease, but not enough…

I also tried with another input on the PIC, just to make sure that the GPIO is not damaged in anyway.

I can understand that false triggering could occur if the command signal voltage goes to an undefined area, but how is it possible that the execution of the program in the PIC gets suspended ???

Unfortunately, I do not know how to upload a schematic draw to make things clearer…

Does someone have an idea to make this work ?

Many thanks in advance.

Why not try some driver/buffer transistors on the output of the PIC between it and the receiver?