Using Inductive Proximity sensors with Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2017
  • Using Inductive Proximity sensors with Arduino
    Sketch
    int limitSwitch = 13;
    int state = LOW;
    void setup() {
    Serial.begin(9600);
    pinMode(limitSwitch,INPUT);
    }
    void loop() {
    int val = digitalRead(limitSwitch);
    if( val != state ){
    state = val;
    Serial.print("Sensor value = ");
    if( state == 0 )
    Serial.println( "(0) Target Hit!" );
    else
    Serial.println( "(1) None");
    }
    } ::::::::::: SUPPORT CHANNEL ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    Please Donate To Help Me Afford New Equipment And Software To Make My Videos More : goo.gl/1m8Dg2
    Don't forget to subscribe!
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    OMG - Just what I needed and how specific and clear, Thank you so much ;-)

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

    Thank you so much, this was just what I needed! Great video.

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

    im wondering what the forward voltage on that optocoupler is to be able to wire 12v directly to it?

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

    Can you help me with my DYI project flatbed screen printing. I want to use 2 pneumatic cylinder, 2 nema 23 and proximity sn04 and the sensor you used in your video. How much to pay you for the diagram and the list of materials to be used?

  • @edvaldosantos6400
    @edvaldosantos6400 5 ปีที่แล้ว +2

    Parabéns pelo video!
    Muito explicativo e vai me ajudar a fazer pull up na minha cnc router

  • @cyriljourdan1023
    @cyriljourdan1023 3 ปีที่แล้ว +1

    Great, thanks ! Just something I noticed, if I'm not mistaken Emitter and Collector are inverted on the first slide.

    • @sanjaybatra6593
      @sanjaybatra6593 ปีที่แล้ว

      Do you have modified or improved circuit of for this vedio
      1. I mean instead of using 10K resistor , Can we use INTERNAL PULLUP resistor ?
      2. This proximity sensor is inductive SENSOR , so do we need any DIODE in reverse direction between BLACK and BROWN wire ? Its for safety of PC817??
      3. For safe operation , can we use a transistor to interface at input or output of PC817 ?
      3. What is the current limit of this sensor ?
      4. what is the reason to use 10K resistor as pullup ? current limit has been considered ?

  • @acqurius-gx8lr
    @acqurius-gx8lr 5 ปีที่แล้ว +1

    I have connected only one sensor on analog pin.all other analog pins are not connected to any sensor but when I read other analog pins I get the same reading on them how I can avoid this problem.plz suggest any solution.

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

    Thank you very much. A Liteon LTV-815 can be replaced with PC-817

  • @scottbechdolt6586
    @scottbechdolt6586 7 หลายเดือนก่อน

    The model number for your sensor ends in B. But I don't see any of those sensors on the internet that end in just B . They all seem to have a letter after the B, such as BX or B Y.

  • @sanjaybatra6593
    @sanjaybatra6593 ปีที่แล้ว

    is there any better circuit then this using internal PULLUP resistor ?

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

    Hi. Can this be used with other Type of NPN sensors like contrast sensors from SICK ?

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

    To the point explanation thankyou very much..subscribed

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

    Hi, great video. But just a beginner question: Do i need the optokoppler also, if i use an NPN Sensor? I mean that if i use an NPN sensor and switch the digital input of the Arduino to INPUT_PULLUP --> Can i then directly connect the black signal cable to the digital input and remove R2 (because of the internal pullup)?

    • @sanjaybatra6593
      @sanjaybatra6593 ปีที่แล้ว

      did you got answer for you question ? I am thinking in same way ?

    •  ปีที่แล้ว

      ​@@sanjaybatra6593hi, no i did not get an answer.

  • @christianadanparedescarden3877
    @christianadanparedescarden3877 ปีที่แล้ว

    Thank you so much

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

    Hi can I connect it direct into the arduino without resistors if I use 5V proxmity sensor?

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

    You are awesome bro thank you so much

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

    you should add one npn transistor, so the proximity would be active high..

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

    Hi, please tell me, how can i use an optocoupler with mechanical limit switches.

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

    Is there any way to make this project run as it is without using the optocoupler PC817

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

    Voce consegue me mandar um desenho esquema para eu montar 5 fins de curso na minha máquina?

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

    Very nice explaination 👍👍👍

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

    What is the switching frequency of the inductive proximity sensor

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

    What is the blue thing in your breadboard called? Is that a relay?

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

      it is just connecting to 12v power supply it is not relay

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

    thanks for this the best video

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

    Hi, how can I make a servomotor rotate when I sense?

  • @shogunvanrepi3555
    @shogunvanrepi3555 11 หลายเดือนก่อน

    if the supply voltage is 28 volts, will the output voltage remain stable at 5 volts through this circuit?

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

    your code works well with digital pin D5, Pin D13 may be faulty in my nano..
    int limitSwitch = 5;
    int state = LOW;
    void setup() {
    Serial.begin(9600);
    pinMode(limitSwitch,INPUT);
    }
    void loop() {
    int val = digitalRead(limitSwitch);
    if( val != state ){
    state = val;
    Serial.print("Sensor value = ");
    if( state == 0 )
    Serial.println( "(0) Target Hit!" );
    else
    Serial.println( "(1) None");
    }
    }

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

      PIN13 connects to the defined LED_BUILTIN. Voltage drop exists there.

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

    How would I do this with a cnc shield?

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

    Can I use 9Vin directly to the Inductive Sensor then use 7805 IC to regulate the output to 5V the connect it to the analog?

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

      read the voltage rating of proximity sensor..normally written on its side...apply voltage accordingly to get better results.

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

    n again thanx...!!

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

    Thanks a lot dear.. :)

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

      Digital pins behave strange, analog read with conditions if (val 200) {println("None");} works great, maybe my sensor or optocoupler does not give pure zero volt.

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

    Great video!!

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

    Can i just use a 9V battery for this?

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

    can you help me, could do it without the foto thing?

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

    the program didn't work in my project can u find my problem?

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

    Is the sensor n.o pnp?

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

    excellent vid

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

    What Power Supply should I use?
    Is a 12V and 1A Power Supply enough?

    • @visa5175
      @visa5175 6 หลายเดือนก่อน

      i use battery mount wich has 8x1.5volt aa batteries so its 12volts. battery mount cost like 2 euro

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

    Here is the modified code that worked perfect for me..
    int limitSwitch = A0;
    int state = LOW;
    int val1;
    void setup() {
    Serial.begin(9600);
    pinMode(limitSwitch,INPUT);
    }
    void loop() {
    int val = analogRead(limitSwitch);
    if( val 200 ){
    val1=HIGH;
    }
    if( val1 != state ){
    state = val1;
    Serial.print("Sensor value = ");
    if( state == 0 )
    Serial.println( "(0) Target Hit!" );
    else
    Serial.println( "(1) None");
    }
    }

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

      what changes would it be?

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

    Great Job!!
    Is there a way I can make use of that sensor to measure rotary speed in rpm?

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

      have you found the answer yet? because i need it too

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

    Hi, cant we just use the inductive proximity sensor directly without using optocoupler?

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

      Yes ,if proximity sensor use 5v

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

      @@MakerTutor101 sorry for asking, why you use optocoupler in this video?

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

      The sensor uses 12v power and output is also 12v.Your Arduino board is broken if it input get a 12v power.It is a good reason that you must use Optocoupler to prevent damage from electrical power that is more than 5v

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

      @@MakerTutor101 thankyou for your kind response.. i see now, so you used an external battery as supply to the sensor?

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

      @@MakerTutor101 how can we add 12v supply? using what?

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

    good

  • @sanjaybatra6593
    @sanjaybatra6593 ปีที่แล้ว

    Do you have modified or improved circuit of for this vedio
    1. I mean instead of using 10K resistor , Can we use INTERNAL PULLUP resistor ?
    2. This proximity sensor is inductive SENSOR , so do we need any DIODE in reverse direction between BLACK and BROWN wire ? Its for safety of PC817??
    3. For safe operation , can we use a transistor to interface at input or output of PC817 ?
    3. What is the current limit of this sensor ?
    4. what is the reason to use 10K resistor as pullup ? current limit has been considered ?
    Can anyone else expert share me more information for industrial use ?

  • @mattivirta
    @mattivirta 8 หลายเดือนก่อน

    i just orden promix sensor, need read spindle motor speed, 2 time trickered spindle rod, how change code can show right spindle speed, have 2 hoöe in spindle rod, trick 2 time / rev, and speed maximum have motor 30K rpm. trick 60K time max speed. i try before use IR sensor but not working, show non accurate speed to oled display. spindle rod have ER16 key hole what sensor trick. thanks i search lot how connect prox sensor 12volt to arduino 5volt pin. but code how make read speed.

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

    Can this use on esp32?

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

    Can i use pc817c?

    • @MakerTutor101
      @MakerTutor101  5 ปีที่แล้ว +1

      Yes sure or th-cam.com/video/dD4r5I7h4Xg/w-d-xo.html

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

    my girlfriend. Capacitive sensors are based on the all or nothing principle. Are there any capacitive sensors that change the output signal (analog) according to each material detected?
    I am looking for a capacitive sensor circuit diagram or PCB
    I need an analog sensor, please help me
    girlfriend

  • @03iputuagusrestuastikaputr52
    @03iputuagusrestuastikaputr52 4 ปีที่แล้ว

    What the blue like a terminal?

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

      Yes Terminal Ground
      Standard color coding for 3 wire Proximity switches is Brown=Positive (+), Black=Load, Blue=Negative (-).

    • @03iputuagusrestuastikaputr52
      @03iputuagusrestuastikaputr52 4 ปีที่แล้ว

      @@MakerTutor101 helo what about capacitive proximity sensor, is same?

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

    This is insanely stupid. There is /NO/ need for the optocoupler - the output of the sensor is directly compatible with the Arduino.

    • @viperboych
      @viperboych 6 ปีที่แล้ว +2

      for max sensing distance on none ferrous metals the sensor will need more volts than Arduino can handle.

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

      It makes no sense. The Arduino does not need to "handle" anything. With NPN-sensor, the maximum voltage on the sensor's output is the pull-up voltage on the Arduino - e.g. 3.3 or 5V. If you are using a PNP sensor and are powering it from 12V, you just put a voltage divider on the output (10K+15K resistor) and the 12V is scaled to 5V for the Arduino - You can measure 1000V with the Arduino, you just need a suitable voltage divider - simple!

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

      Not so stupid. The sensor line is tied to the input voltage through a 10K resistor, meaning that if the sensor is energised by 12V, there is 12V going directly to the arduino pin when the sensor is INACTIVE.

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

      The 10K resistor is external to the sensor, so just pull it up to 5V. In some cases the indicator LED is pulling up the line, but so weakly that the internal clamp diodes in the microcontroller will deal with it just fine.

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

      The 10K resistor holds the sensor line HIGH, so when the NPN transistor activates, it pulls the sensor line LOW. If you put a voltage divider (extra resistor to ground) on the sensor line to lower it to 5V, the sensor is activated permanently. (Tested)