Using Reed magnetic switch with Arduino and Relay

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ธ.ค. 2017
  • this video shows you how to use reed switch with relay to detect door or window opening to turn on ligh or Alarm using a relay.
    You will learn how to use it without Arduino and with Arduino.
    Get early access to my videos via Patreon and have your name mentioned at end of very videos I publish on TH-cam : robojax.com/L/?id=97
    download code from :
    roboJax.com/learn/arduino
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 59

  • @adamelkoumy5141
    @adamelkoumy5141 6 ปีที่แล้ว

    Shokran . Thank you for the video :)

    • @robojax
      @robojax  6 ปีที่แล้ว

      You are welcome.

  • @danceindia
    @danceindia 4 ปีที่แล้ว +2

    Hey Great Video, I wonder if you have any tutorial for adding SMS on this action with GPS location? Thanks

    • @robojax
      @robojax  4 ปีที่แล้ว +2

      Thank you. I have got the module with but never got a chance to make video. If I get time, I will try to make video on that.

  • @hendriokysafata2779
    @hendriokysafata2779 2 ปีที่แล้ว

    permission to ask sir, if we want to make an object fall timer using a magnetic sensor, what is the program code like?

  • @geeuk
    @geeuk 2 ปีที่แล้ว

    Thank you brother. Your video helped me.

    • @robojax
      @robojax  2 ปีที่แล้ว

      You are welcome. The best thank you for me is to subscribe to my channel. Thank you.

  • @jeffersonjeff1994
    @jeffersonjeff1994 3 ปีที่แล้ว

    You explain really well🙂

    • @robojax
      @robojax  3 ปีที่แล้ว

      I am glad you found it useful. I've got over 400 videos, check them out th-cam.com/users/robojaxTVvideos

  • @PanayiotisMavrokefalos
    @PanayiotisMavrokefalos 4 ปีที่แล้ว

    Great tutorial!!! Am trying to add another reed switch in the loop but am not sure how the code has to be changed so when both reed switches have a magnet it would turn on the light.

    • @robojax
      @robojax  4 ปีที่แล้ว +1

      I have defined pins for the reed switch and pin for output (relay) and explained in code. Just define another pin for 2nd reed switch and another for the output. Watch the video 2 or 3 times I have not left anything unclear. You should be able to do it.

    • @PanayiotisMavrokefalos
      @PanayiotisMavrokefalos 4 ปีที่แล้ว

      @@robojax I got it i had to use the || expression to tell the code that when both of these are active then activate the lamp thank you.

  • @rudyvlog2897
    @rudyvlog2897 2 ปีที่แล้ว

    You still change the relay set-up from nc to no sir
    Youve said earlier that without changing relay set- up you will be able to turn on the light when reed switch being triggered by magnet?
    I think it is not possible, relay no/nc set-up still need to be changed.

  • @amirmosharaf3382
    @amirmosharaf3382 5 ปีที่แล้ว

    nice , thank you . Did you put the relay in the null path ?

    • @robojax
      @robojax  5 ปีที่แล้ว

      what is is UNLL path?

  • @johnnybuoy9551
    @johnnybuoy9551 3 ปีที่แล้ว

    what's the Current rating of these common Reed Switches? Can I use them directly between power source and light bulb without any Relay? In short how much Current can they bear?

    • @robojax
      @robojax  3 ปีที่แล้ว

      they use different types of reed switches. but it is at the level of 1-10mA and even won't turn ON and LED.

  • @alikasim290
    @alikasim290 6 ปีที่แล้ว

    i used the module relay with arduino and lcd 2*16 when the load connected to relay the lcd display strange symbols without load every thing well

    • @robojax
      @robojax  6 ปีที่แล้ว

      Relay has nothing to do with the LCE1602. The error is somewhere else.

  • @rolandopanganiban333
    @rolandopanganiban333 2 ปีที่แล้ว

    Nice👍,... Sir what if. I have one reed switch to determine that the servo motor is already at the position of 90° and then it will go back to 0° posistion automatically in the time i wanted?. What codes i use? I already make the code to to arduino to control it by the IR remote to rotate to 90°... and now sir,. I want the servo automatic to go back to zero...i need your help Sir

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      hello, I have I tones of videos on servo. Search for servo on my channel. Here is how to find Specific TH-cam Video in a channel bit.ly/findTH-camVideo

  • @rinku2004ful
    @rinku2004ful 6 ปีที่แล้ว +1

    Nice help sir. Sir i m facing a prob related with arduino uno, actually i want to connect arduino with l298n motor controller, 2 reed switch and a ldr sensor. But i m unable to connect with arduino. Plz help me.

    • @robojax
      @robojax  6 ปีที่แล้ว +1

      You have to make your project work with the L298N motor controller first. Once it works and you were able to control the motor. Then make another project with reed switch. and make sure it works. then combine both.
      Share you code in this page codeshare.io/ and once you posted the code, we I can make comment or edit it for you to make it work.

    • @robojax
      @robojax  6 ปีที่แล้ว +1

      Please reply here. I understand you want to do the following:
      working with two reed switches n a motor controller. My project is based on:------
      =======================
      If reed switch1 is true
      If reed switch 2 is false
      Then
      Motor will round clockwise
      Else
      Motor will round counter clockwise.
      =========================
      So have do you have code for the motor controller? Please post your the code for your motor codeshare.io/ and then once you post it, that website will have a URL (website address) and post it here.
      Please use reply under this comment (please do not post new comment under the video) so your all your comments are together and easy to follow.
      Once you posted your code, I will fix it so it can work with the reed switch.

    • @rinku2004ful
      @rinku2004ful 6 ปีที่แล้ว

      Robojax -. Ok sir

    • @robojax
      @robojax  6 ปีที่แล้ว

      Post code for motor control and I will help you.

    • @rinku2004ful
      @rinku2004ful 6 ปีที่แล้ว

      Robojax :- sir i m trying to write code but stuck on nested if statement. Acctually i want to check light sensitivity by ldr n if ldr returns 1 then check another condition which is if (reed1=1 && reed2=0) then motor controller plays a roll to move dc motor clockwise n if if (reed1=0 && reed2=1)then motor controller plays a roll to move dc motor counter clockwise . But i wrote a code using nested if statement but isnt working.

  • @CengizGoren
    @CengizGoren 4 ปีที่แล้ว

    Very good thank you

    • @robojax
      @robojax  4 ปีที่แล้ว

      You are welcome.

  • @azlinda0719
    @azlinda0719 3 ปีที่แล้ว

    Hi can this be connected to UV-C light bulb? around 16W

    • @robojax
      @robojax  3 ปีที่แล้ว

      it just turns ON and OFF a load. so load can be anything.

    • @azlinda0719
      @azlinda0719 3 ปีที่แล้ว

      @@robojax I see, do you have a clear circuit diagram anywhere?

    • @robojax
      @robojax  3 ปีที่แล้ว

      yes when you purchase my Arduino course from Udemy, all videos have circuit diagram bit.ly/rj-udemy

    • @azlinda0719
      @azlinda0719 3 ปีที่แล้ว

      @@robojax instead of using the magnetic reed switch that you used, can i use the magnetic door sensor?

  • @Mykhyn777
    @Mykhyn777 5 ปีที่แล้ว

    Can a very small magnet make the switch work?

    • @robojax
      @robojax  5 ปีที่แล้ว

      small or large doesn't matter. Strength of magnet is important. You would have to try specific magnet.

  • @idea-fateh1979
    @idea-fateh1979 5 ปีที่แล้ว

    goooooooooood job

    • @robojax
      @robojax  5 ปีที่แล้ว

      Thank you.

  • @pawelhalarczyk6975
    @pawelhalarczyk6975 4 ปีที่แล้ว

    been on your website the adds on top of the screen stops you from reading or looking for anything really annoying hence I left, very interesting clip do cheers

    • @robojax
      @robojax  4 ปีที่แล้ว

      can you take the screen shot and share it it? When visiting the page, just press "Print Screen" on your keyboard, then visit this website snipboard.io/ and press paste it (Ctrl+V) and this website will make a page for it automatically. Then share the link back so I look at it. I am sorry for that.

  • @sbarifvlogs335
    @sbarifvlogs335 3 ปีที่แล้ว

    how can i use 4 reed switch with one arduino for for doors?

    • @robojax
      @robojax  3 ปีที่แล้ว

      just replicate and define 4 pins for input, 4 pins for output and 4 relays. on the same code. watch it more than one time so you learn.

  • @dilshankasthuriarachchi4737
    @dilshankasthuriarachchi4737 2 ปีที่แล้ว

    Hi sir could you please tell me how to make reed switch control car?

    • @robojax
      @robojax  2 ปีที่แล้ว

      Hello, you should have a car ready to work. then use the battery power of the car go throw the relay. in this video I've shown a bulb, you replace the bulb with your car and instead of connecting to AC connect it to the car battery. very simple.

    • @dilshankasthuriarachchi4737
      @dilshankasthuriarachchi4737 2 ปีที่แล้ว

      @@robojax NO sir i want you to knoe how to make a arduino based 4wd car using magnetic reed switch? so what would i need to make this project?

  • @muhammadzar3002
    @muhammadzar3002 4 ปีที่แล้ว

    do anyone know how to put this on water meter?

    • @robojax
      @robojax  4 ปีที่แล้ว

      I don't think so.

  • @manasimakote42
    @manasimakote42 6 ปีที่แล้ว

    can u provide circuit diagram of all this

    • @robojax
      @robojax  6 ปีที่แล้ว

      Sorry when I prepared the material for this video, I did not draw it because many components have not symbol in the drawing program. I will see if I can draw it. I will inform you once I did.

    • @manasimakote42
      @manasimakote42 6 ปีที่แล้ว

      what if I want to use Reed sw as ip to PLC and at o/p i need to turn on bulb , as PLC operate on 24 v

  • @adamelkoumy5141
    @adamelkoumy5141 4 ปีที่แล้ว

    The code is located in lesson # 18.

    • @robojax
      @robojax  4 ปีที่แล้ว

      where?

  • @PBanduni
    @PBanduni 2 ปีที่แล้ว

    Sorry sir but NC stand for *normally close* not a normally connected. And NO normally open it is currect.

    • @robojax
      @robojax  2 ปีที่แล้ว +1

      Thank you

    • @PBanduni
      @PBanduni 2 ปีที่แล้ว

      @@robojax don't mind sir

  • @novin8280
    @novin8280 4 ปีที่แล้ว

    Message:Hi friend, can U help to me about reedswitch for Arduino. I whant to build wind anemometer. I have arduino nano, reedswitch yust like on this video .
    I tipe code for anemometer, but something is wrong, arduino cant red info from reedswitch.
    My code:
    #include
    #include
    LiquidCrystal_I2C lcd(0x27, 16, 2);
    extern volatile unsigned long timer0_millis;
    unsigned long new_value = 0;
    float RoundsSum=0;
    float PreviousReading=0;
    float CurrentReading;
    float RPM=0;
    float AirFlow=0;
    int MeasureTime=6000;
    void setup()
    {
    Wire.begin();
    lcd.begin(16,2);
    lcd.backlight();
    Serial.begin(9600);
    }
    void loop()
    {
    for (int i=0; millis()

    • @robojax
      @robojax  4 ปีที่แล้ว

      You have to test your code without LCD and just display the information on Serial Monitor. Then use LCD. This way you have smaller code to find . I can't figure this out as this was the first time I heard the word "anemometer" and I have no access to the device.