Arduino Uno limit switch Interfacing and Programming

(Last Updated On: July 26, 2019)

limit switch

Description:

 This is a very detailed tutorial on how to use a limit switch with Arduino or Mega. This Tutorial explains everything from interfacing to the final testing. For the complete circuit explanation and programming watch video tutorial “Click Here”.


Components and tools used in this project can be purchased from Amazon, the components purchase links are given below:

Arduino Uno: https://amzn.to/2tVz1vu
Mega 2560: https://amzn.to/2ze1kdu
limit switch:  Best deal “pack”: https://amzn.to/2KBH1fn
lm7805 Voltage Regulator: https://amzn.to/2IZEl5x
330-ohm resistors pack: https://amzn.to/2NtlAeh
female DC power jack socket: https://amzn.to/2KEo1gt
470 uf capacitors: https://amzn.to/2xDCOzf
5×7 cm vero board: https://amzn.to/2OHGbvn
female headers: https://amzn.to/2zqmtiJ
connection wires: https://amzn.to/2DpBuW7
Super Starter kit for Beginners: https://amzn.to/2KJvmKG
Jumper Wires: https://amzn.to/2KMoVXs
Bread Board: https://amzn.to/2MS4q8X
12v Adaptor: https://amzn.to/2Ntr6h1
PCB plate: https://amzn.to/2IUwpCt
Variable Supply: https://amzn.to/2MT4Qfj
Digital Multimeter: https://amzn.to/2Nvft9i
Vero Board / strip board: https://amzn.to/2MTf9jD
Soldering iron kit: “best” You guys should definitely purchase this: https://amzn.to/2zfoNuJ
Solder wire: https://amzn.to/2ufUMWf
Wire Stripper: https://amzn.to/2KOqxfU
wire cutter: https://amzn.to/2ucIq14
PCB small portable drill machine: https://amzn.to/2Nu62XF

limit switch

Limit switches are one of the most commonly used electronic components, the limit_switches are used in a situation where we need to define the limits. Like for example, the movement of the Pneumatic cylinder can be controlled using the limit switch as demonstrated in the video. Limit switches are most commonly used in industries. If you look at the construction of the limit switch you will find that it’s just like the ordinary push button but with a different design.


In the market we have different types of  switches like roller type limit switches, no matter which limitswitch you use, the basic working principle is exactly the same. This limit switch can also be used with Mega, tinny, 8051 microcontrollers, pic microcontroller, plc,raspberry pi,etc.  for the limit switch interfacing watch this Video Tutorial “Click Here

Arduino Programming:



Watch Video Tutorial:

Recommended For You

About the Author: Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

1 Comment

  1. Hi Fahad,

    What a great presentation! Thank you for the video. You make it seem so simple in writing the codes. Like flow of water.

    I’m Tomi from Thailand and is always fascinated with motors control. Recently, I decided to indulge in wetting my feet in the Arduino lake.

    Actually, I was on the verge of giving up as my code comprehension is so discouraging until I stumbled upon your site. Eureka…! I found a Guru.

    I took up a challenge to build a simple mechanism to further improve the productivity at my workplace. Since the, I have been hunting for appropriate sketches for more than 2 weeks but not very fruitful.

    Highly appreciate if you could shine some light into my undertaking.

    Please allow me to explain my intends.

    1) Press Button A , a carriage (mounted on a linear actuator) travels forward for 180mm (about 4250 steps) at a speed of 2-2.5sec/100mm (delayMicroseconds(800)). As a contingency, in case of over travelled, there will be an installation of a limit switch-Y just after the stop position.

    2) The carriage will only travel back to homing position one second after Button-B is being triggered.

    3) Returning or Homing speed is controlled by a potentiometer. Between delayMicroseconds (400 to 1500)

    4) Home position is determined by steps and a backup limit switch-Z.

    5) LOOP back to (1)

    Hardware:-

    NEMA 17 bipolar Stepper motor + Linear motion lead screw slide actuator
    Arduino UNO R3
    A4988 Driver,Hi Fahad,
    Momentary button switch ….2 pcs
    Limit switch …………………….2 pcs
    12V DC 5A power supply unit
    10K Potentiometer

    I shall be keeping my fingers crossed and hoping for your favourable reply.

    Thanking you in advance and looking forward to hearing from you soon

    I may be contacted at;-
    a) tomigoh@gmail.com
    b) Whatsapp: +66 9913 15151

    Shukraan jazilaan lak

    Warmest Regards

    Tomi GOH

Leave a Reply

Close