Connect with us

wiring up relay with Arduino

Discussion in 'Microcontrollers, Programming and IoT' started by Brentb1, Feb 13, 2016.

Scroll to continue with content
  1. Brentb1

    Brentb1

    12
    0
    Feb 12, 2016
    I am not sure why I am struggling with such an easy task, but non the less I am.

    My goal is to hook up a feed pump and some other things to a relay.

    The Arduino is what controls the relay to trigger, but where I am struggling is what do I use to get the AC volts to power the pump?

    I am probably over thinking this simple task so any help to get me started would be great
     
  2. Brentb1

    Brentb1

    12
    0
    Feb 12, 2016
    I wanted to quickly add, I was able to get the relays to trigger using the Arduino. I really just need to know the next step in connecting it to power up the pump.

    Mainly what should I use for an power source
     
  3. Bluejets

    Bluejets

    4,220
    894
    Oct 5, 2014
    What voltage level AC are you talking about here ?
     
  4. Brentb1

    Brentb1

    12
    0
    Feb 12, 2016
    input 100-240V~/ 50-60Hz/ 320mA output 5V-/2,4A

    I will quickly explain what I am trying to accomplish; My 5 yr old daughter is severely disabled due to head trauma so she has many many medical problems. She is unable to move anything except 1 arm, does not talk and cannot eat hence the pump. She also has a problem with maintaining her temp. she commonly has a temp of 85 degrees. She also just had another hip surgery.

    That brings me to what I want to accomplish; I want to use the Arduino to monitor her temp and when it gets below a specified degree turn on a heat blanket. I also want to be able to control the lights/TV in her room "on/off" with the Arduino. I will also have a sensor on her wheelchair seat that notifies when moisture is detected "many reasons for this".

    The other part of the plan is to make all the things I listed work via tft or lcd screen for when she is at school. I have spoke with the teacher and she said it would be so much easier for them to care for her if I can accomplish the above. Last but not least I want to be able to data log her temp though out the day and if possible look at the info via internet.

    One more thing is I will use touch sensors as an aid to see if we can somehow get her to communicate; for example if she is in pain she can touch a specific sensor and a certain color light would come on. I know I may be reaching and this is far past my skillset but this could be the answer we are looking for.

    Just to be very clear I did not mention her for sympathy or anything like that; I just did not know how else to have what I want to do make sense without giving the reason.

    Please let me know if this can be done or more importantly if it cannot
     
  5. Bluejets

    Bluejets

    4,220
    894
    Oct 5, 2014
    Have no idea what the input output you quoted might be.
    Your expansion of the first instance has, as far as I can make out expanded into at least 8 applications.
    These requiring, as far as I can make out , at least 6 Arduino units and several other interface hardware units all from different locations.
    Each application would require differing levels of ability to select appropriate equipment and programming skills.
    Each application would also bring it's own problems.

    Yes, it could be done but no, not an easy task by any means.

    If you want to get an insight, perhaps try to turn on an LED with an Arduino to start with.
    Then as a modification, use another Arduino to communicate with and turn on the same LED but wirelessly.
     
  6. Brentb1

    Brentb1

    12
    0
    Feb 12, 2016
    I will try to do the wireless communication. So far I have hooked up servos, lcd screen, led's etc. All of that is fairly easy because it is already all mapped out, you just have to look at a picture and do the same thing.

    What I have been doing is trying to get each component I will use working, once I am able to get it all working I will start to put it all together.

    I have 3 Arduino's a mega, uno, and nano so I am going to do what you said and get them to communicate wirelessly.

    Back to the relay; if I want to use the relay and Arduino to control a TV , heat pad, and/or lamp what is the best way to go about that? I have watched videos that have used the relay and Arduino but they do not go into much detail with the wiring itself. I know it is not that difficult but I am drawing a blank.
     
  7. hevans1944

    hevans1944 Hop - AC8NS

    4,536
    2,112
    Jun 21, 2012
    When you need to control an appliance with an Arduino output, a relay actuated by the Arduino is a good intermediate interface. The coil of the relay will typically be low-voltage DC rated at 5 V. The relay contacts will typically be either one Form A, single-pole, single-throw, normally-open contact, or a Form C, single-pole, double-throw contact, meaning there is a moving contact that is connected to a normally-open contact when the relay is energized as well as that moving contact having a connection to a normally-closed contact when the relay is de-energized. If you want a circuit to close when the relay is energized, the normally-open contact and the moving contact are wired in series with the load. If you want a circuit to open when the relay is energized, the normally-closed contact and the moving contact are wired in series with the load.

    The main advantage of the relay is the contacts are isolated and you are free to use them as an Arduino-controlled switch to turn loads on and off. There is a problem, however, when you use a relay with a mains-powered load such as a heating blanket, a TV, or lights in a room. This places dangerous 115 VAC power on the relay contacts thus presenting a shock hazard. If you are breadboarding circuits with the Arduinos, this potentially places 115 VAC power on your breadboard. One little mis-connection and poof! a whole bunch of stuff goes up in smoke. For your safety, it is best NOT to use a relay to switch mains power, especially the tiny "crystal sized" relays with pins spaced to allow their insertion on a solderless breadboard. There is a better, safer, way to switch 115 VAC power with the Arduino as described below.

    Purchase a solid-state AC relay with the capability of handling the current you want to switch. Here is a typical device you should consider, available from Wal-Mart for about US$11.00. This device is capable of switching up to 25 amperes of current, at AC voltages from 24 to 380 V AC. It will easily control your heating blanket, or a TV, or room lighting. This is a four-terminal device. Two of the terminals accept a DC control input, typically in the range of 3 to 32 V DC. The other two terminals are connected in series with a mains-powered load, exactly as you would wire any other two-terminal switch. You can drive the control input terminals directly from an Arduino output pin, paying attention to polarity. The (+) input pin would connect to an Arduino output; the (-) pin would connect to your Arduino common.

    The device should be properly packaged in a metal box with a cartridge-fuse holder in series with the "hot" or black wire of a line cord, attached to the box with a strain-relief bushing, the other side of the fuse connecting to one of the two AC terminals on the solid-state AC relay. A three-prong convenience outlet should be mounted on the box for plugging in the load. Wire the "hot" terminal (dark or brass colored) of the outlet to the other AC terminal on the solid state AC switch. Wire the "neutral" or white terminal (silver colored) to the "neutral" or white wire in the power cord. Connect the green "safety ground" in the power cord to the metal box and to the "safety ground" on the convenience outlet. You can mount an RCA jack on the box to bring in the low-voltage DC control signal, or just drill a hole and install a rubber grommet to feed the control wires into the box and connect them directly to the DC control terminals of the solid-state AC relay.

    Alternatively, you can operate the solid-state AC relay from a relay that the Arduino controls. Just connect +5 V DC power to the moving contact of the relay and connect the normally-open contact to the (+) input of the solid state AC relay. Connect the (-) input of the solid-state AC relay to common. Use low-voltage 24 AWG stranded twisted-pair wires to connect from the relay contacts (or the Arduino output) to the solid-state AC relay. You can also use speaker cable or zip cord cable, but that would be overkill for this application.

    Wireless control is quite ambitious for a novice Arduino user. What shields are you planning to use for wireless communications?

    That statement scares the hell out of me. Looky, makey is okay for lower-order primates, but here on Electronics Point we expect more along the lines of learning and understanding before actually making. Simplifies the troubleshooting if it doesn't work right away.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-