how to tell arduino if some component is ON or OFF

Discussion in 'General Electronics Chat' started by Hussain Shabbir, Apr 10, 2018.

  1. Hussain Shabbir

    Thread Starter New Member

    Mar 5, 2018
    18
    0
    I want to connect several components to my arduino project.
    4 12v lights, 1 ac appliance. I am thinking that I will use simple relays to connect them to 12v lights and on the COM and NC leads I will connect a seperate 5v supply that will act as an input signal and arduino will know if any of the individual 4 lights are on or off.

    I do not have an idea of knowing about the AC appliance because the relay will not work with an AC system.

    Any suggestion to improve this method and for the AC appliance is highly appreciated.
     
  2. cmrincon

    Member

    Oct 25, 2017
    38
    2
    hi! have you thought about use optocouplers?
     
  3. Hussain Shabbir

    Thread Starter New Member

    Mar 5, 2018
    18
    0
    Would an optocoupler work with one side on 12v and other on 5v?

    Very frankly, I am completely uneducated in this field, I do not know much about electronics. Mostly my projects have different voltages, and when using arduino I always face difficulty because of different voltages.
     
  4. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    8,280
    1,445
    Your choice of relay is probably wrong, or you can use opto-coupler and Triac,
    Zero crossing Opto-couplers work on low voltages on the led side, and mains voltage on the other side.
    There are Solid State relays.

    pin.png
     
    cmrincon likes this.
  5. Hussain Shabbir

    Thread Starter New Member

    Mar 5, 2018
    18
    0
    Could you please tell me why would relays be a bad option
     
  6. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    8,280
    1,445
    Relays are fine for slow switching on/off but no good for high speed, like light dimmers, motor speed controls.
     
    -live wire- likes this.
  7. Hussain Shabbir

    Thread Starter New Member

    Mar 5, 2018
    18
    0
    Thats fine, speed is not an issue. I just want to know weather the connected component is on or off, because then the arduino will perform its function through if statements. I just want an input into arduino that tells it that if a component is using electricity or not.
     
  8. Dodgydave

    AAC Fanatic!

    Jun 22, 2012
    8,280
    1,445
    Then use a relay to switch on, with an opto-couper to monitor the mains side, this can feed back into your micro and give you an indication the mains is present.
    You would need a capacitor on the output side to filter out the zero crossing.

    P6B1h.png
     
    Last edited: Apr 10, 2018
  9. LesJones

    Well-Known Member

    Jan 8, 2017
    2,304
    693
    Hi Dave ,
    You can get photocouplers that will work with AC (Or either polarity DC ) input. Thye have two IR LEDs cross connected for the input.
    This is one example.
    They would need a capacitor on the output side to avoid pulses at the zero crossing point with an AC input.

    Les.
     
    Dodgydave likes this.
  10. danadak

    Distinguished Member

    Mar 10, 2018
    3,493
    785
    If you need to know a load is actually present, after having turned it
    on via Arduino, there are a number of techniques. V, I, Light, Speed.....
    detection schemes.

    For example one could use a number of techniques to detect if a motor
    has spun up, rpm via magnetic (Hall Effect) or optical techniques, V & I
    current and phase detection.....

    If switching on high power LEDs then simple V detection or photodetector
    to detec brightness....

    There is a plethora of sensors out there for position detection, strain, stress,
    heat, optical.......to handle insuring your load is energized, in many cases also operating
    properly.

    Regards, Dana.
     
  11. 128ITSH

    Member

    Jul 20, 2017
    101
    16
    Would you like to control these appliances from the arduino, or let the arduino know whether they are energized, or both?
    It would be good if you give us the current rating of the appliances too.
    Like Dana said there might be several ways to do this, but a question would be if you want to measure when there is voltage or current.
    Checking for voltage would be easier but you will not know if the appliance is faulty or working, you will only know that it has voltage across it and should work. But when you check for current, however, you will know if the appliance is actually working and spending energy.
     
  12. mcgyvr

    AAC Fanatic!

    Oct 15, 2009
    5,394
    1,194
    What is this AC device?
    Is it turned on via a wall switch?
    A relay can be used to turn devices on/off but its not going to be able to tell you if the device is on without tapping into something inside the device..

    Are you planning on hacking into this AC device?
     
  13. Phil-S

    Member

    Dec 4, 2015
    125
    11
    May not be relevant to this project, but the HCPL3700 optocoupler is a nice way to interface mains AC with LV microcontrollers.
    I find them useful for getting older lamp timers and programmers working with low energy loads - these are the type of controllers that have no neutral and rely on leakage current through the lamp.
     
Loading...