Arduino-Optoisolator help

Discussion in 'Embedded Systems and Microcontrollers' started by Letech, Jan 16, 2011.

  1. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
    Hello,

    I want to control 4 solenoid valves that requires 12 volts to operate. I'm using Arduino Duemilanove for control. After doing some reading on the web, I decided to use optoisolator (L9822EPD) as a solenoid driver.
    Data sheet can be found here:
    http://www.datasheetcatalog.org/datasheet/stmicroelectronics/1416.pdf

    Could someone help me figure out how I should connect this type of optoisolator to control at least one solenoid valve?

    The solenoid valve is just like an inductor, it has two wires ( positive and negative )

    Detailed help would be appreciated.

    thanks
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    It's not an opto-isolator, it's an Octal solenoid driver. You need to connect it to an SPI interface.
     
  3. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Your idea of including an opto-isolator is a good one. By galvanically isolating the arduino and the higher voltage associated with the solenoid valve you will insure that the arduino will be protected against damage from the higher voltage.

    Have you selected an opto-isolator device?

    hgmjr
     
  4. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Blueroomelectronics is correct. The link you supplied is not to an opto-isolator.

    hgmjr
     
  5. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
    Sorry, I was mixing up between the both.

    Now, Would the arduino board be burned without using the opto-isolator?
    and if yes, could you explain to me how the opto-isolator will be connected?

    I'm connecting the arduino pins (13, 10, 12, 11) to L922E pins (18, 17, 2, 19) respectively. Is that correct?

    Now, how to control the valves?

    Sorry, I guess there are two different points on my reply (Opto-isolator, and solenoid drivers).

    thanks,
     
  6. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The opto-isolater is not a necessity. It is more of a safeguard against any high voltage spikes that might find their way back into the Arduino.

    It permits you to isolate the +5V and +12V power supplies from each other.

    hgmjr
     
  7. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    There is one snag though. The solenoid driver uses +5V and +12V so the use of an opto-isolator is somewhat of a problem since it would require you to use another regulator off of your +12V to provide the +5V for the serial interface to the driver.

    hgmjr
     
  8. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Is there some reason that you had contemplated an opto-isolator in the first place?

    hgmjr
     
  9. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
    It is because I was looking at a custom designed PCB that can drive the solenoid valves, but I don't have the schematic for it, and it has three opto-isolator on it (4N37).
     
  10. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    How far apart were you planning to locate the Arduino from the solenoid valves?

    hgmjr
     
  11. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
    I think I will mount them close to each other in one box of dimensions 7, 6, 4 cm. Arduino on the bottom side of the box and the Solenoid driver on the top side of the box (the box lid).
     
  12. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Would you be comfortable omitting the opto-isolator since the device you have chosen appears to be intended for use with a microcontroller directly connected?

    hgmjr
     
  13. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
    Thanks hgmjr. I'm thinking of postponing the use of the opto-isolator until I figure out how to control the solenoid.
    But I still don't know how to control the solenoid taking into consideration the pin configuration that I have explained earlier.
     
  14. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Are you not familiar with the SPI serial communications protocol?

    hgmjr
     
  15. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
  16. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    The material will give a good feel for the interface protocol. Be sure to read the device's datasheet for the particulars since many devices have implemented slight variations on the theme.

    hgmjr
     
    Letech likes this.
  17. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    If you go to this link you will find that Arduino already has a library for talking SPI to slave devices such as the driver you are considering.

    hgmjr
     
  18. Letech

    Thread Starter New Member

    Dec 12, 2010
    10
    0
    I have just realized that the SPI library is already included with the most updated version of arduino (arduino 0022).

    Good work arduino, always working a head.
     
  19. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    4,770
    970
    You need to post the specs for the solenoids before you go any further. (specifically the amount of current they require to operate)
    All you might need is a transistor and a resistor to control your solenoids.. Or solid state relays or an optoisolator with a resistor and a relay combination if you wish to have isolation..
    But this all depends on the specifics of the solenoids you wish to control.
    There is really no need to get into SPI.. That's just complicating the subject somewhat.
     
Loading...