Circuit Documentation
Summary
This circuit is designed to monitor temperature using an LM35 temperature sensor and control a 28BYJ-48 stepper motor using an Arduino UNO and a ULN2003A breakout board. The motor's rotation direction is determined by the temperature reading: if the temperature exceeds a certain threshold, the motor rotates clockwise; otherwise, it rotates counterclockwise.
Component List
Resistor
- Description: A passive two-terminal electrical component that implements electrical resistance as a circuit element.
- Properties: 220 Ohms resistance.
Arduino UNO
- Description: A microcontroller board based on the ATmega328P. It has digital input/output pins, analog inputs, a USB connection for programming the board, a power jack, an ICSP header, and a reset button.
Temperature Sensor (LM35)
- Description: A precision integrated-circuit temperature device with an output voltage linearly proportional to the Centigrade temperature.
- Properties: Outputs 10mV per degree Celsius.
ULN2003A Breakout Board
- Description: A board that contains the ULN2003A driver chip which is an array of seven NPN Darlington transistors capable of driving a wide range of loads, including solenoids, relays, DC motors, and stepper motors.
28BYJ-48 Stepper Motor
- Description: A small, 5-volt geared stepping motor that can be used whenever precision movement or positioning is required.
Wiring Details
Resistor
- Connections:
- One end connected to the 5V output of the Arduino UNO.
- The other end connected to the +Vs pin of the Temperature Sensor (LM35).
Arduino UNO
- Connections:
- 5V output to the Resistor and ULN2003A breakout board.
- GND to the Temperature Sensor (LM35) and ULN2003A breakout board.
- A0 to the Vout pin of the Temperature Sensor (LM35).
- Digital pins D9, D10, D11, and D12 to the input pins In 1, In 2, In 3, and In 4 of the ULN2003A breakout board, respectively.
Temperature Sensor (LM35)
- Connections:
- +Vs to the Resistor (connected to 5V of Arduino UNO).
- Vout to the A0 pin of the Arduino UNO.
- GND to the GND of the Arduino UNO.
ULN2003A Breakout Board
- Connections:
- +5V from the Arduino UNO.
- 0V to the GND of the Arduino UNO.
- Input pins In 1, In 2, In 3, and In 4 connected to the Arduino UNO digital pins D9, D10, D11, and D12, respectively.
- Output pins BLUE, PINK, YELLOW, ORANGE, and RED wires to the corresponding pins of the 28BYJ-48 Stepper Motor.
28BYJ-48 Stepper Motor
- Connections:
- BLUE, PINK, YELLOW, ORANGE, and RED wires to the corresponding output pins of the ULN2003A breakout board.
Documented Code
#include<Stepper.h>
int steps = 2048;
int RPM = 15;
int threshold = 50;
int tempPin = A0;
Stepper assignStepper(steps, 9, 11, 10, 12);
void setup() {
assignStepper.setSpeed(RPM);
Serial.begin(9600);
}
void loop() {
int readValue = analogRead(tempPin);
float mVout = readValue * (5000.0 / 1023.0);
float temC = mVout / 10;
Serial.print(temC);
Serial.print(" : ");
if (temC > threshold) {
Serial.println("Over threshold: Clockwise rotation");
assignStepper.step(steps);
delay(1000);
} else {
Serial.println("Under threshold: Counterclockwise rotation");
assignStepper.step(-steps);
delay(1000);
}
}
Filename: sketch.ino
Description: This Arduino sketch reads the temperature from the LM35 sensor and converts it to Celsius. If the temperature is above the threshold, the stepper motor is rotated clockwise; otherwise, it is rotated counterclockwise. The stepper motor is controlled via the ULN2003A breakout board.