Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Temperature-Responsive Stepper Motor

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Temperature-Responsive Stepper Motor

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

Arduino UNO

Temperature Sensor (LM35)

ULN2003A Breakout Board

28BYJ-48 Stepper Motor

Wiring Details

Resistor

Arduino UNO

Temperature Sensor (LM35)

ULN2003A Breakout Board

28BYJ-48 Stepper Motor

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.