Question: I want to drive 24 Flurescent Lights via a PC with a Wiring board that has 40 Digital I/O, the board is connected to the Computer via USB. Now I wonder which hardware I would require in order to use the Hi/Low (is that correct?) of the digital output to turn the fluorescent lights on/off.

Hypothesis: A so called Solid State Relay 'SSR' (e.g. this one) should be able to solve the problem. The relay is connected to 2 circuits, one being the 5V circuit of the Wiring board, the other the 230V of the lights.

Circuit Layout:
[]

Here, the Switch(1) is actually the mentioned SSR and connected to the Wiring Board. The Problem in this case is the way a fluorescent light works (or turns on). Initially the Starter(2) is closed when the light is turned off, thus the current can easily flow through it and not through the gas when it is being turned on. Then, the Starter-Switch opens and disconnects the circuit when it becomes hot (which happens very fast), so the current wants to flow via the conductive gas. This procedure produces just in the moment BEFORE the current can flow via the gas a strong current (>2000V) through the coil(3) which continues on to the SSR (1) and would blow it up.
marc: actually it is the voltage spike that occurs after switching off the SSR that causes the damage. A SSR can die from (at least) 4 different causes:

  1. too high current (I)
  2. too high voltage (U)
  3. too fast change of current (dI/dt)
  4. too fast change of voltage (dU/dt)

When the SSR is closed, the voltage across its terminals is never higher than about 2V (with a mechanical switch it's almost 0V) so the high voltage that ignites the gas doesn't damage the SSR (it's closed at that time). But when you open the SSR (switch off the light), the coil again tries to raise the voltage, and then this voltage is present on the terminals of the SSR and can kill it.

I don’t really understand why it’s not possible to use a diode that prevents the current from flowing back to the Switch, and would be delighted if someone could explain that. I reckon it is because this strong current is actually needed to flow back and turn the light on.
marc: it's because you have a 230V AC signal. The voltage spike can be of either polarity, depending on when the switch was turned off.

Solution: The proposed solution is to use mechanical relays such as a 12V – 250V AC Capacity Relay instead of a SSR, (some reading made me think it is because the SSRs have a small voltage drop (whatever that means), thus resulting in more heat production).
marc: this is true, but normally not a problem. This voltage drop is about 2V, and the current from a 30W lamp at 230V is 30/230=130mA, This current will produce 2V*130mA=260mW of heat in the SSR, which is not that much.

The circuit looks like this:
[]

I will try to explain the components of this circuit:
1) 12V – 230V AC Relay (12V is DC, right?)
2) 6.8 kOhm – 10kOhm Resisitor
3) 1N4001 Diode
4) BC337 Transistor
The signal travels from the Wiring boards digital output (5V) through a resistor to the transistor, where it can switch the 12V circuit. The 12V circuit switches the relay on/off, which controls the 230V circuit for the Fluorescent lights.

Problems: Sounds like a pretty straightforward setup. Nevertheless, somehow due to the rather large amounts of beer at our yesterdays workshop, I can’t remember how to connect the 12V circuit, is it a completely autonomous circuit, for which I need a transformer from 230V AC to 12V DC solely for running the relay?
marc: you can use the 12V power supply that you use to power the board. On the board it is regulated to 5V for the electronics, but you can tap the 12V from the power connector and use it to power the relay.


I already guess that it is not possible to switch 5V > 220V so to say have a 5V/220V relay?
marc: it is possible, but 5V relays require more current to drive the coil. A relay needs a certain amount of power (Watts) to magnetically pull the switch to the coil. If you have a 12V coil, you need less current than with a 5V coil, since power (P) is the product of current (I) and voltage (U): P=U*I

What would be great is to know how the values for the components (especially the resistor and transistor) are being calculated.
marc: the transistor amplifies current by about 100 times, be safe and assume its only 50 times (it varies from transistor to transistor). This means you have to provide at least 2mA in the base of the transistor to switch a relay that requires 100mA (you can find out on the datasheet of the relay). The output of the microprocessor is 5V, and the base/emitter voltage of the transistor is 0.7V, so that leaves 4.3V across the resistor. 4.3V/2mA gives you a value of 2150 ohm, so you should actually use a 2K2 resistor.