fluorescent tubes - arduino stalls

Hello

I have built some controllers for fluorescent tubes.
The script is basically just writing high and low to the control pin.

The arduino stalls at random times. Sometimes straight away, sometimes after 10 minutes.

I have tried several minis as well as a duemilanove.

The duemilanove unfreezes when I pull the control pin, so there must be some kind of current rolling back through the circuit. Also, when I set the ons and offs to close, the stalls occur. Sometimes the minis even reboot. I am chasing the blinking on/off effect of the tubes. I am aware of fluorescent lights kicking back dirty when switching them on and off but I thought this circuit would be protecting the arduino.

I am using this schematic

parts:

I am about to build the master controller which will run 64 tubes, so I really need to understand whats bothering the circuit.

Thank you

Fubbi

Can't be sure because we need a little information. A relay offers good isolation between the circuit controlling the relay coil and the circuit that utilizes the relay's switching contacts, so I don't think it's an interferance path through the relay.

Related possiblities:

What is the power source you are using for the Arduino board?
What is the power source you are using for the relay coil power shown in your posted drawing?

Lefty

Hello

The minis are in cases already and are powered by a 220v->5v 3A converter. It is the copper cage in the background of the image below.

The relay gets it's power from the 5v pin on the arduino.

here are the boxes

Thank you

fubbi

you dont think it could have something to do with its shutdown if too hot

If possible a complete drawing of all your wiring might be helpful for us as the 'generic' relay drawing you posted really doesn't reflect what you have built in total.

Lefty

@koalabog: nope, nothig is getting hot

@ retrolefty:

here's a quick and dirty of the duemilanove setup i have on my desk.
I realize the power supply is different in the boxes I built, but since the duemilanove hangs too (not with a bulb by the way) I presume the problem must be with the tubes.

Well nothing jumps out at me as being fundamentally flawed. It might be possible that you are just getting lots of EMI interference from the switching noise of the relay contacts. If you could temporarily remove the relay from the project box to give it some physical separation (say a foot or so) from the Arduino module and low voltage power supply so that all the 220vac wiring is out of the box and then see if the symptom continues or not.

Also the fact that you low voltage power supply may be sharing the same 220vac as the tubes may be a EMI path. As an experimate you might try powering the Arduino module with batteries or USB power or something that isn't sharing the same 220vac circuit that is being switched be the relay contacts.

Lefty

Hi

I am using the duemilanove now. Uploading to the minis in the boxes is a drag. So the parts aren't squeezed up like on the photo.

are there any resistors between the base of the transistor and your arduino?

I may be wayyy off but as soon as I heard you say the failure occurred around 10mins I thought it might be a timer overflow.

Are you using any delay() functions and/or storing timer values? If I'm not mistaken thats known to fail around 9.x minutes.

I take that back... I think the overflow happens at 9 hours, not 9 minutes.

Hi

The time the stall occurs is random. The duemilanove hangs, the mini reboots.

No resistors...

I am getting an increasing amount of random errors uploading to the mini so I think it is slowly getting fried.

fubbi

No resistors...

Why are you not using a series resistor between the Arduino output pin and the base of the transistor as shown in the drawing you posted?

http://www.arduino.cc/playground/uploads/Learning/relays.pdf

While I don't know if that is causing your problem or not, it certainly could damage the Arduino's output pin or the transistors emitter/base junction as there is nothing to limit the base current.

Lefty

Oh

Actually I am using that resistor in the boxes with the minis. My mind wandered

fub

This is a classic case of not enough supply decoupling. please see:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

The flouresent tubes are generating EM spikes that are crashing your arduino. You need more tight decoupling around the supply. I would also add decoupling to your transistor load (emitter / collector).

Maybe even a small quench cap across the relay contacts.

That sounds just right!

Something like this?

Yes just replace the motor with the Arduino. :slight_smile:

How do I know what size choke coil to use?

Thank you very much

by the way, this solution is no problem for my little boxes, there is room. I am however building a 64 tube controller on a custom A3 sized PCB. There is no more room there, can this solution be added further down the line somewhere? On the cable coming in or going out for example...

work in progress (!):

How do I know what size choke coil to use?

Without looking with an oscilloscope you don't. However, too small and it won't work too much and it is just a big inductor.

can this solution be added further down the line somewhere?

No the point about decoupling is that it has to be physically close to the component that is being upset. On your A3 board this decoupling must be applied close to the ATmega chip itself. If you put it any distance away the interference still get in.
Are those 8 ATmega chips?. If so you must carefully decouple each of them close to the chip. The inductor is only going to be the size of a resistor at biggest.

nope, those are shift registers. so I could keep the arduino pretty far away from them. so if I put the decoupler with the arduino on it's own it could work

thank you