opto isolators - use

i am using an I2C port expander to drive my relays which in turn drive my motors and pumps.

From the I2C port, the outputs goes to ULN2003 (Relay Driver) and from that it goes to the Relay to drive them.

There is a separate +5v power source for the Relay Drivers and Separate +12v for the ardunio. But both the power supplys transformers are from the same AC. But the Transformers are only 2 Wire, meaning there is no proper ground wire from the mains to the board.

Now, when driving the relays, it happens redundantly the LCD screen blanks out. but the system is operational though.

The LCD is operated using another I2C port expander.

I did put up this post before, but done everything indicated including redoing my PCB and adding 0.1uf at the Vcc and Gnd of all IC's.

Now still it happens now and then. What can be done? i think it is noise that is making the LCD blank out. But the system is operational.

will the use of opto-isolators be of help here? if so how to use them? if anyone has tried can you help me with a circuit diagram.. or if i can ratify my problem somehow or the other, without using opto's kindly help.

You need to post a diagram of what you have before we can offer improvements. When the LCD blanks out does the back light (assuming there is one) flicker as well? Have you got a diode across the relay coil? What is the relay switching in terms of voltage and current? Do you still get the problem if the relay is switching nothing?

here we go

I am mainly using I2C to control my devices.

The main layout is :

The Display of the controller : have another display also attached to the system for secondary viewing.

The controller with the I2C, Clock and with the back of the LCD panel and the Keyboard

The power Module, using ULN 2003 and Relays. The Power module is Connected to the Controller using a 25Pin DB Wire. The Outlook of the power Module

These are the problems: (I think they are related)

  1. When the power module is not connected to the main system, the system works perfectly. There is a mode called FEEDMode, when i am into that mode by press of a key in the keypad, a few of the power modules are to TURN OFF for a period of time and then TURN ON again after that period, this works perfectly when the power Module is not connected to the system. But when i connect the power Module to the system, and go into that FEED MODE it TURNS OFF the devices, goes through the Count and then TURNS on the DEVICES but the moment it turns ON The Devices the LCD goes BLANK with just a display of "1" in the SCREEN and KeyPad is FROZEN.. .so i need to restart the Arduino by powering it down and then ON it again.

  2. Some times when there is a power Outtage, and when the System turns on again, i go into the Blank Screen Mode and Frozen keypad. But all the other controls in the Power Module are WORKING...

I even put diodes across the Relays to protect them, but no USE.

The Arduino Goes into FREEZE Mode when it handles the Power Module that is done using UNL2003/2004 ICs and Relays. The ULNs drive the Relays (+5v) and Relays Output (230vac) control the Motors and Pumps.

the problem of De-coupling was also looked into, and 0.1uF's were placed at all IC's VCC and GND.

The I2C's are all powered by the power from the Arduino. The Arduino is power by a 12V adapter.

The Relay circuits are powered by a seperate 5V Adapter. Both the Adapaters are connected to the same 230vAC.

The Grounds of the Relay circuit and that of the ARduino circuit are connected to make a common ground

totally there are 6 I2C's, 1 Ds1307 (Clock) and 1 EEPRom Memory powered by the arduino. Is this too much? is this why that randomness occurs? but that freeze happens only when the relays are operated.

Mike, the backlight is ON, doens't flicker. The Screen Blanks out. When using a FEEDMODE that turns OFF many relays at one shot, the screen goes bonkers and sends random text on the screen.

the display is power from the +5 and GND of the Arduino, the same way all the I2C's are powered by the Arduino.

I use the I2C to operate the LCD Display which is a 16X4, using the LCDI2C library to run it.

each I2C Draws 20mA (from data sheet i suppose http://www.nxp.com/documents/data_sheet/PCF8574.pdf)

so that is 120ma for the 6 of them, for the DS1307 is operated by the battery..

so i will be drawing 120mA from the Arduino. hopefully i am correct.

no capacitance is added to the display power input. just one 0.1uF at the VCC and GND of the I2C that controls the Display unit - for decoupling as suggested by mike.

oops no idea on how much the LCD Will take. it is the same as http://www.sparkfun.com/commerce/product_info.php?products_id=256

it is actually a 20X4 display, not 16X4 (wrongly mentioned before). in the data sheet it say Current is 240mA and power is 1.01 W for the LED will this info help?

I am not such an expert as you people are, so therein lies the problem. :(

i will power up all the IC's using a separate power source of 5V, 2A, that should take care of the power requirements for the ICs and devices.

Well what do you mean by power Filter capacitance? what should be done? How can i add a power filter capacitance?

i will power up all the IC's using a separate power source of 5V

The power requirement for the LCD modules and associated logic/controller is very modest. So if a new power source means changing "everything", you may want to just change power source for the LCD backlight circuit as a start. Since you already have a 5V source for your relay circuitry, you could try this (the backlight is much more forgiving than the logic supply).

Another option you could try (without redesigning your hardware) is a workaround. You could add an LCD reset everytime you update the display (e.g. after you switch any of the relays). If you suspect EMI issues when switching, you may also opt to delay display update (some milliseconds) after you switch the relays.

I would also try to find out if the microcontroller (mcu) actually resets. If this is the case, you're likely to loose track of what mode you're in and then I would look at the mcu reset circutry as well as brown out setting.

Further still, the LCD modules are quite sensitive to timing. That is if the mcu does not reset, you may try to increase time delays in the LCD library. In short, I think you have a few more things to check/verify before you do major changes (although I would redirect backlight away from the logic power regulator).

Ben, I think the 1st alternative of using my Relay's 5V pwr will be best as reseting the LCD it takes a 5-10 seconds for the screen to be up.. so dont want that.

Will first change the power supply instead of the arduino will use that of the Relays. and check things out.