PDA

View Full Version : Auto testing bulbs



The Master
- 27th August 2008, 11:32
Hi. Im designing a circuit that uses a 40 pin PIC chip to control a bunch of lights. Each light has its own transistor on the board. I would like some method of testing these lights to be built into the circuit. The bulbs dont have to be working during testing.

Ive come up with a few ways that might work

I thought about having a circuit to measure the current that each board is using (the simple resistor style one Ref: Measuring Volts and Amps digitally (http://www.picbasic.co.uk/forum/showthread.php?t=9206). If i measure the amps its using while all outputs are off then turn each output on individually and measure again. If there is no significant increase in current then the bulb has blown. This one has the added bonus that the bulb being tested can be turned on. The problem i see might be that the bulbs dont use enough current to distinguish between the bulb being on and the chip using a little more power for something etc.

Another idea was to have a relay that switches the common wire of the lights over to an input pin on the chip (with a resistor because the bulbs are about 7-12V). Then turn each bulb on individually and check if the input pin goes low (transistors are NPN). I would need a resistor to make the pin high when no outputs are on. The problem i see here is that the bulbs will effectively become resistors so the biasing resistor needs to be big enough to pull the pin high but small enough to allow it to go low when an output is turned on

The power to the board will be DC 12V (regulated for the chip). There will be capacitors elsewhere to smooth out the DC ripple and some extra on the board itself.

What i want to know is what do you think? Which method would be overall best taking into account number of pins used, reliability, cost etc? Does anyone have a better suggestion?

PICante
- 30th August 2008, 20:24
Without knowing more about the actual circuit it’s hard to give an optimal solution.
What I use to do in similar cases is shunting the “switch” transistor or relay with a high value resistor. Doing this I close the circuit though the bulb causing a very small current to flow. By measuring the voltage drop across the resistor I get a voltage drop if the filament is intact otherwise no voltage.

Melanie
- 31st August 2008, 09:02
In Industry (and also in other areas such as Aerospace), a visual Lamp Test is built into the equipment. Either at Power-On (as in some Aircraft), all Lamps are turned ON for a few seconds and then extinguish, or there is a seperate Button to press that will turn all the Lamps ON. In that way, the operator guages which Lamps are not functioning. Typically for Landing, the pilot needs three Green Lights which indicate that each of his wheels is down and locked. If he doesn't get three Greens, then there is a Button he can press as a Lamp-Test to determine if it's a bulb that has blown, or if it's time to freak-out the passengers.

An Automatic method...

If you have the PIC pins available (one for each Lamp), simply connect the -ve end of the Lamp (the Collector end of your NPN Transistor - assuming the Emitter is connected to 0v and you pull-down for ON-Lamp) via a Resistor (eg 10k) and protection Zener to your PIC pin. A value of say 10K will not be sufficient to turn the Lamp ON, and the Zener will clamp the input to the PIC at 5v. When the LAMP is OFF, a tiny nominal current will flow through the LAMP and you should get a HIGH at your PIC pin.

Naturally you can't detect if the Lamp is blown when it is driven ON, because the driver Transistor will pull the voltage LOW. However, when ON, if out of every Second you turn the Lamp OFF for say 1mS before turning it back ON again, visually you will not see any difference, but you can do a Lamp Test (check if PIC pin High) during that 1mS OFF period.

This will NOT detect Lamps that go SHORT-CIRCUIT when blown (in which case it's back to freaking-out the passengers).

The Master
- 1st September 2008, 10:00
Thankfully i dont have any passengers to freak out. This is one of the circuits for my pinball machine (i dont think i mentioned that yet). I do plan to add a visual test where each bulb can be set to flash by itself and a picture on the screen will show where the bulb should be. I only plan to use that for testing new bulbs when i put them in (or for short circuits). There will be hundreds of bulbs so the automatic testing would really help. If a bulb blows then nobody is at harm so its safe enough to let the circuit decide where the problem is. The bulbs i have dont short out when they blow. They simply break the circuit

PICante, your idea sounds like one of those that i suggested. The basic idea is put an ammeter in the circuit to test if it draws more current when a bulb turns on. In theory it sounds good because the bulbs can be tested while they are in operation. The circuit knows how many bulbs are on and how much current to expect. They would still need turning on individually to identify the blown bulb though. I plan to put the check on startup and run it again every 24 hours and have an option in the operators menu.

Melanie, Im not sure i fully understand your method. I do have 1 pin for each bulb but only to turn it on and off (rather than multiplexing). Are you saying to use those same pins or do i need extra pins? It does sound like it needs a lot of extra components too. Each PCB is designed to control 22 bulbs.

Since i posted this thread i made up a quick design using the relay method because im more familiar with relays than the ammeter way and i didnt know about your way Melanie. Ive uploaded screenshots of the board. I dont mind making it bigger but there can be upto 7 of these plus all the other circuits too. 2 of them are zoomed in so its easier to see and 1 is the actual size of the board. Sorry but its only a PCB layout (not a schematic).

In that circuit the relay gets turned on which switches it into test mode. A resistor holds one of the PIC's pins high. When a transistor is turned on it grounds the pin if the bulb works. If it remains high then the bulb is blown. Ofcourse the bulb will act as a resistor so i will probably have to change the value of the biasing resistor. There are also a few mistakes on it that i know about. It was just a quick version to see how things would fit on a PCB.

When i get some small value resistors im going to test out the ammeter idea because i need that for another project anyway. I would like to test out your way too Melanie but im not quite sure how that would be wired.

It doesnt matter if the lights are on or off during testing. Even if it has the capability i probably wouldnt program it to test during normal operation anyway

Melanie
- 1st September 2008, 12:28
I hate verbal descriptions of circuits... it always sounds more complicated than it actually is...

Consider the attached schematic. The Lamp is driven by the PIC. Pin goes High, Lamp goes ON. A single ULN2004 can drive 7 Lamps. There are driver chips that can can do eight. Doesn't have to be a chip, you can use Transistors, but you need Base Resistors and all kinds of junk, and since the ULN can drive an inductive load (such as a Relay) you don't need Diode back-emf surpression as it's built-in.

Just two components needed. A Resistor and a Zener. Those two parts will prevent the PIC pin from having 12v applied back to it. This example uses two PIC pins, one to drive the Lamp, the other receives a HIGH if the Lamp is Good, and a LOW if the Lamp is Blown.

You can combine both on one PIC pin, but the circuitry would more components. As you have it now you just have one Resistor and one Zener per Lamp.

Actually, as an afterthought, you'll need a second Resistor across the Zener (say 47K) to ensure the pin is Pulled-DOWN when the Lamp blows, otherwise it's technically floating.

Acetronics2
- 1st September 2008, 12:43
Hi

just place an air winded coil around a reed "bulb" ... 10-15 turns * amp ( 20 - 30 turns for 1/2 amp ... 5 - 8 turns for 2 amps.)

in SERIES with your lamp.

reed contacts close when current flows.

Maaaaaagic, you told Maaaaaagic ???

circuits insulation as a bonus ... what else needed ???

Alain

The Master
- 1st September 2008, 13:11
Melanie, That does sound like a clever way of doing it but i think it might be a little over complicated. Using a single pin would be essential. If i can only have 11 bulbs per board then i need more than 7 boards and to address them correctly i need more than 4 DIP switches (taking up more inputs or using multiplexing). You said that i could use 1 pin but that would add even more components to the board. I understand roughly how your diagram works but im not too sure about the resistor. Last time i used a resistor in series with these bulbs i ended up with a fire. The zener probably takes care of that though (aswell as protecting the chip).

Acetronics, That sounds like a good idea. Its like the ammeter version but replacing the resistor/opamp/adc programming with a simple reed switch. Doing it this way instead of the way in my PCB layout means theres no relay so that transistor can be used to drive another bulb. I should probably do some testing first though to see if a single bulb can draw enough current to get a magnetig field strong enough. www.donsbulbs.com says that the smallest bulbs i have are 0.15A. Should that be "10-15 turns divided by amps"?

About the transistors. I used to use some ULN chips which i think were rated at 500mA but im not sure if thats per output or per all 8 outputs. Im sure there was a good reason i changed to transistors but i cant remember what it was. I always prefered the ULN chips. The transistors do seem to be more expensive but i suppose i dont have to have them in groups of 8. I know at first i had some ULNs soldered into PCBs and ended up blowing them up. Eventually i started putting DIL sockets in (should have done this from the start)

Luciano
- 1st September 2008, 23:53
Hi,

With one input pin you can test all your 22 bulbs.

http://img209.imageshack.us/img209/7954/lamptestwt6.th.gif (http://img209.imageshack.us/img209/7954/lamptestwt6.gif)
(Click to enlarge the picture)

Best regards,

Luciano

The Master
- 2nd September 2008, 09:31
I see where your going with that one. It looks similar to my relay idea but instead of switching the common wire for the bulbs over to the pin you are using diodes so it doesnt have to switch anything to run a test, all it has to do is turn 1 bulb on at a time. It looks a little confusing at first but its starting to make sense now. All the bulbs have to be turned on and you only turn off the one that you want to test. If i did use this method then i would have to be carefull how i programmed it. If all the boards turned all the lights on together i think it would be enough to blow the transformer.

To be honest i think i prefer Acetronics' idea. Its very simple and requires less components/board space. As long as a single bulb can draw enough current to turn the switch on then it should work

Acetronics2
- 2nd September 2008, 10:04
Hi,



"the smallest bulbs i have are 0.15A. Should that be "10-15 turns divided by amps"?"


simple: 10 - 15 / 0.15 = ... 70 to 105 Turns.

... Take care for bending Reed bulbs wires ... always use a pair of pliers not to stress the glass !!!

Alain

Luciano
- 2nd September 2008, 10:27
If all the boards turned all the lights on together i think it would be enough to blow the transformer.

Hi,

Flashing all the lights together isn’t the purpose of a pinball machine?

With a 400-Watt ATX power supply you can have up to 15A @ 12V DC and 40A @ 5V DC.

How to Convert a Computer ATX Power Supply to a Lab Power Supply:
http://www.wikihow.com/Convert-a-Computer-ATX-Power-Supply-to-a-Lab-Power-Supply

Best regards,

Luciano

The Master
- 2nd September 2008, 10:32
I know. Ive broken pleanty of them as a kid. They make the wires really thick and strong too! Thanx for clearing up the formula confusion. I cant find any coils on Rapid that would do the job or even be modified to do the job. Im going to have to make my own so i suppose winding it around the reed switch itself would work. Is there any specific type of wire i should use? Ive got a few different kinds out of old transformers and motors etc

The Master
- 2nd September 2008, 10:53
Luciano, Its more about the game really but i know a lot of pinball machines have patterns (mainly in attract mode) that turn on all the lights at the same time. I was going to buy a transformer from Rapid to handle all the bulbs. The one im looking at is 100VA 6V+6V. I was planning to use both of the secondaries to drive the 6V bulbs (split them evenly) and use both together for the 12V bulbs. As far as i understand 100VA means 100W so i should get about 8.3A at 12V. If i only think about the 6V bulbs then i should be able to get 16.6A by using both secondaries for 6V. That gives me about 110 bulbs which is about right for the small ones. There will be a few bigger ones on too and possibly some inverters for EL wire etc.

The idea was to program it so it cant turn on too many lights. I made that mistake before with an old transformer i had laying around. I dont think that was very powerfull though. I did also test an ATX PSU but it didnt work very well at all. Just a few lights at a time seemed to short it out but it was fine on the other transformer (till i tried to turn all the lights on). It could still have been a faulty PSU though. I have a few more laying around now so i might connect some bulbs into it when i get home and see how it goes