# 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);
}
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://guides.mccaskeyrobotics.org/arduino/printer-jam-sensor-circuit.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
