Building Logic Gates Using Industrial Switches: A DigiKey Lab

Introduction

This lab is your first step toward understanding industrial control panels. The signal flow and continuity lessons are directly applicable to lessons in relays-based controls and Programmable Logic Controllers (PLCs). The lab is valuable as it allows you to focus on logic operations without the added complexity of navigating relay coils.

In this lab you will construct logic gates using pushbuttons featuring normally open and normally closed contacts as shown in Figure 1. Given inputs B and A, there are 16 possible output combinations. As shown in Figure 2, many of these combinations are known by their familiar gate names such as AND, OR, XOR, and NAND.

Figure 1: Image of industrial pushbuttons configured as a logic gate.

Tech Tip: The designation of More Knowledgeable Other (MKO) is used throughout this lab to indicate the collaborative relationship between the learner and others who act as instructor, mentor, supervisor, coach, or even the advanced student familiar with the material. A good MKO knows when to provide assistance, when to let the student struggle with independent learning, and anchors the topics into a greater framework of learning.

Learning Objectives

The lab objectives include:

  • use of hand tools to construct a physical assembly
  • to install 22 mm industrial switches and indicators
  • to wire industrial control switches
  • to construct logic primitives using industrial control switches
  • to sketch ladder logic representation of the physical circuit

Measurable Assessment

Students will demonstrate mastery of the lab by constructing at least three MKO selected 2-input logic gates using industrial pushbuttons. They will do so without assistance using only the information contained in Figure 2. They will also present the ladder logic representation of the circuit.

Required Materials

The required materials are shown in Figure 3. A complete description of each component may be found in the Guide to Selecting Components for Industrial Education. The parts checklist for this portion of the project includes:

  • DigiKey trainer with DC power distribution configured as described in this earlier lab.
  • Common hand tools such as screwdriver, nut driver, wire cutter
  • Variety of pre-cut and ferruled wires
  • DC power supply capable of 24 VDC at up to 2 A with ability to automatically shift between constant voltage and constant current mode
  • 1 ea 22 mm industrial switch bodies with green pushbutton assembly
  • 1 ea 22 mm industrial switch bodies with two-positions selector switch
  • 2 ea normally closed switch blocks
  • 2 ea normally open switch blocks
  • 1 ea 22 mm dual color Red/Green indicator

Figure 3: Image of the components as used in the experiment.

Tailgate / Toolbox Safety Brief

Before starting this lab, the student and MKO should conduct a tailgate briefing to review lab safety, objectives, and procedures. This checklist guides the conversation:

  • Ensure that the experiment is conducted using an isolated 24 VDC current limiting bench power supply. While this is generally considered safe, always turn off the power supply when making adjustments to the circuit.
  • Review logic gates such as AND and OR.
  • Review the difference between normally open and normally closed switches.
  • Review the assembly of 22 mm industrial switches with an emphasis on adding additional normally open and normally closed blocks as necessary.
  • Review ladder logic symbology with emphasis on parallel vs serial structures.
  • Review Figure 2 with emphasis on circuits with single vs parallel routes. For example, an AND gate has a single path while the XOR gate has two paths.
  • Review the use of a multimeter to test for continuity across a rung.

Figure 2: Table showing the family of 2-input logic gates.

Procedure

  1. Work with the MKO to construct a functional pushbutton-based AND gate and then sketch the ladder logic representation.

  2. Construct the OR gate with accompanying ladder logic representation.

  3. Work with the MKO to construct a functional pushbutton based XOR gate and then sketch the ladder logic representation.

  4. Construct a NAND gate with accompanying ladder logic representation.

  5. Construct a XNOR gate with accompanying ladder logic representation.

  6. Work with the MKO to complete the measurable assessments.

Related Information

Please follow these links to related and useful information:

Follow up

Please use the space below to share your recommendations, tips, and insights you gained by completing this lab.

Questions

The following questions will help reinforce the content of the article.

  1. What is meant by the expression “continuity across a rung?”

  2. Sketch the optimized ladder logic representation of the NOR gate.

  3. How can you tell the difference between a normally closed and a normally open pushbutton? Hint: Not all pushbuttons feature the distinctive red and green blocks as used in this lab.

  4. Present the switch-based ladder logic for a NAND gate constructed using three parallel branches.

  5. With respect to the previous question, present an optimized NAND gate. Here the term optimized implies a minimum number of switch blocks and wires are used.

  6. Looking ahead, what is a relay?

Critical thinking questions

These critical thinking questions expand the article’s content allowing you to develop a big picture understanding of the material and its relationship to adjacent topics. They are often open ended, require research, and are best answered in essay form.

  1. Research the definition of a glitch as applied to digital logic circuits. Describe how a glitch may occur in your XOR circuit. Speculate how this glitch could be interpreted by fast devices such as a PLC.

  2. This laboratory exercise provides a good learning opportunity. The circuitry is acceptable for simple control panels. However, as implied in the previous question, there may be problems for PLC-based systems. Should a logic operation such as the XOR be performed in software or hardware? Explain Why?

About this author

Aaron Dahlen, LCDR USCG (Ret.), is an application engineer at DigiKey. He has a unique electronics and automation foundation built over a 27-year military career as a technician and engineer further enhanced by 12 years of interwoven teaching experience. With an MSEE degree from Minnesota State University, Mankato, Dahlen has taught in an ABET-accredited EE program, served as the program coordinator for an EET program, and instructed military technicians in the art of component-level equipment repair. Dahlen has returned to his Northern Minnesota home and thoroughly enjoys bridging the gap between application and theory.

1 Like