> For the complete documentation index, see [llms.txt](https://guides.mccaskeyrobotics.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://guides.mccaskeyrobotics.org/arduino/printer-jam-sensor-circuit.md).

# Printer Jam Sensor Circuit

### Overview: &#x20;

A printer has many sensors in it to make sure it stops printing whenever there might be a jam, lack of  ink, or other malfunction. This project will simulate how a printer could detect a jam in its document  feeding system. &#x20;

Jam/No Jam Scenarios

![](/files/YVe6CjemLXqp4Mew709G)![](/files/v4q1ulhlN2ooQ9dfGjFH)

### Parts: &#x20;

1 – Arduino Uno

1 – L298N Motor Driver

1 – Printer Jam Simulation Setup

1 – 9V Battery

Assorted Wires

### Wiring: &#x20;

![](/files/idDCNEOBkTroQhQFF4Ih)

### Code: &#x20;

```
//defining the arduino pins for switches 1,2, and 3
int switch_1 = 1;
int switch_2 = 2;
int switch_3 = 3;
//Arduino pin 13 will be wired to IN3 on the motor driver board
int motor_en = 13;
void setup() {
  //define pinmodes
  pinMode(switch_1, INPUT_PULLUP);
  pinMode(switch_2, INPUT_PULLUP);
  pinMode(switch_3, INPUT_PULLUP);
  pinMode(motor_en, OUTPUT);
  Serial.begin(9600);
}
void loop() {
  //read the values of the three limit switches
  int sw1 = digitalRead(switch_1);
  int sw2 = digitalRead(switch_2);
  int sw3 = digitalRead(switch_3);
  //&& stands for logical AND and || stands for logial OR  if (sw1 == LOW && sw2 == LOW || sw2 == LOW && sw3 == LOW)  {
  digitalWrite(motor_en, LOW);
}
else
{
  digitalWrite(motor_en, HIGH);
}
}
```
