Using optocoupler as actuator in node


  • Hero Member

    Hi,
    If I use some optocoupler like the 4N35, will the actuator sketch work as if it was a relay?
    Thanks in advance



  • @ferpando
    Hye!
    Yes, it will work. I used a led for testing the actuator example and it works great.
    What would you like to command?


  • Hero Member

    I have some Somfi blinds and I's like to build some kind of interface to command the blinds from Vera as I saw on some post (they used relays instead but they are noisy).
    I just tried to hook it up but it does`t respond to Vera's commands.



  • @ferpando
    You can't control blinds motors with an optocoupler. If you tried this connected to your blinds, you opto is dead....
    Use a relay or an optotriac + triac


  • Hero Member

    It's not the motor, it's the remote control.
    The opto simulates the button click on the remote


  • Hero Member

    If I use only one optocoupler it works, but as soon as I put 2 of them, neither work any more.
    I can see the led on the arduino blink as it receives the RF signal but nothing happens.
    I changed the code like this:

    ...
    #define RELAY_1  5  // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
    #define NUMBER_OF_RELAYS 2 
    #define RELAY_ON 1
    #define RELAY_OFF 0
    
    Sensor gw;
    ...

  • Admin

    @ferpando

    Are they power hungry? Possible to feed them separately?


  • Hero Member

    according to specs 10ma each, and each is connected to one pin (3 and 4).
    I did nothing and just started to work.
    I had to reverse what's on and off though.

    One thing I noticed is there's only 3,7v on the pin when on. Shouldn't it be 5v?



  • Hi.

    I've tried to do exactly the same thing with the remotes for my roller blinds, I also started with relays (as they are the most obvious solution), but I found something that works just fine, no noise and low power:

    http://www.ti.com/lit/ds/symlink/cd4066b.pdf

    Just power it with 5V (I think it works from 3 to 18 V) and you have 4 "switches" using pairs from the IC and send a "high" state using a control Output from the arduino to the control pin on the IC, it doesn't really "connect" the two contacts, there is still an small resistance between them (about 500 ohms) but it works just fine with my remotes, they think the button has been pressed.
    And, as a bonus, they only are about 1.50 euros for 10 PCs, that is 40 switches for 1.50... try to do that with conventional relays and you are looking at about 45 euros at least.

    Regards.

    PS: Also, they work with the Relay example from the libraries, just changing the default value from #define RELAY_ON 0 and #define RELAY_OFF 1 to make they active HIGH, (#define RELAY_ON 1 #define RELAY_OFF 0)


  • Admin

    @DNKROZ

    Great input, thanks!


  • Hero Member

    @DNKROZ said:

    http://www.ti.com/lit/ds/symlink/cd4066b.pdf

    Thank you.
    I finally made it work.
    I changes the 330 Ohms resistor I was using for the optocoupler for a 220 Ohms and it started to work.
    Anyway your approach is really nice and more compact.



  • This is what I have been using TLP222.

    TOSHIBA Photocoupler Photorelay
    The Toshiba TLP222G TLP222G-2 consist of a gallium arsenide infrared Emitting Diode optically coupled to a photo-MOSFET in a DIP package The TLP222G series are a bi-directional Switch which CAN replace mechanical relays in many applications. By Toshiba Semiconductor.


  • Hero Member

    I have now the hardware part working with 9 optocuoplers driven by an Arduino micro, using a couple shift registers.
    The problem now is from the software point of view.
    How to address the optos.
    When using relays or opts directly, the sketch uses digitalWrite to have the pin HIGH or LOW.
    When I set the number of relays, VERA creates that number of light switches.

    Now with the shit registers, I use only pins 4, 6 and 7 of the arduino.
    I don't know if this will work just by telling the sketch I have now 9 relays, and then change a bit the program to address the shift register correctly.
    Will the pins I use (4,6,7) conflict with the ones used by the sketch for the relays? (3, 4, 5, 6, 7, 8,.... 9,10,11 for the 9 relays) The mini only has 3-8 free pins.
    I don't know how to start with this.


  • Contest Winner

    @ferpando

    the key is mapping the bit in your register to a device you create.

    you can use your bitwise operators to determine if you should toggle a device's status.

    which shift register are u using?


  • Hero Member

    @BulldogLowell
    I'm using 74HC595.
    I solved it changing the sketch from relay to servo, and them making some modifications to it.
    It works very nice now.


  • Contest Winner

    @ferpando said:

    @BulldogLowell
    I'm using 74HC595.
    I solved it changing the sketch from relay to servo, and them making some modifications to it.
    It works very nice now.

    so, pulsing the optocoupler with 'pushbutton' front end on vera's UI, good idea.


  • Hero Member

    @BulldogLowell
    Works pretty well.
    The servo sketch installs a blind control device on vera with allows me to control stop, up and down buttons with one device per blind.



  • Please show us some photo of the Servo into the Blinds 🙂


  • Hero Member

    @Hoffan
    No servo in the blinds.
    The blinds have somfi motors.
    I just use the sketch of a servo to control it.


  • Hero Member

    Had this problem myself, controlling Somfy blinds using my computer/smartphone.

    Did read in a forum on a Somfy RS-485 solution (way to expensive) and about somebody that took his remote control and replaced the buttons by relays and had those relays controlled by a zWave (dual) binary switch. Also quite expensive solution to my opinion and not that supported.

    Recently, but before I knew mysensors, RFXCOM came with the RFXtrx433E so I went for that. Quite nice, you can pair the Somfy blinds with the RFXtrx433E and control everything.

    Knowing mysensors, taking the remote control and replacing the buttons using relays controlled by an Arduino Pro Mini would also be a good option.


  • Hero Member

    @daulagari said:

    Knowing mysensors, taking the remote control and replacing the buttons using relays controlled by an Arduino Pro Mini would also be a good option.

    Or better still, optocouplers or an analog switch as described above...


  • Hero Member

    @Zeph said:

    Or better still, optocouplers or an analog switch as described above...

    Yes, that's a better option as relays are quite power hungry and bulky.


Log in to reply
 

Suggested Topics

  • 87
  • 6
  • 2
  • 5
  • 10
  • 7

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts