Arduino-Controlled Temperature Monitoring and Stepper Motor Driver System
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit integrates an Arduino UNO microcontroller with a 28BYJ-48 stepper motor, controlled via a ULN2003A breakout board, and a temperature sensor (LM35). The Arduino UNO is responsible for controlling the stepper motor's steps and reading the temperature sensor's output. The ULN2003A breakout board acts as a driver for the stepper motor, providing the necessary current for its operation. The temperature sensor provides analog temperature readings to the Arduino, which can be used for various control applications.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.
28BYJ-48 Stepper Motor
- Description: A small, 5-wire, unipolar stepper motor.
- Pins: BLUE, PINK, YELLOW, ORANGE, RED.
ULN2003A Breakout Board
- Description: A breakout board for the ULN2003A Darlington transistor array, used for driving stepper motors.
- Pins: In 1-4, In 5-7 (unused in this circuit), 0V, +5V, ON/OFF jumper switch, BLUE wire, PINK wire, YELLOW wire, ORANGE wire, RED wire.
Temperature Sensor (LM35)
- Description: An analog temperature sensor that provides a voltage output proportional to the ambient temperature.
- Pins: +Vs, Vout, GND.
Wiring Details
Arduino UNO
- 5V connected to ULN2003A breakout board +5V and LM35 +Vs.
- GND connected to ULN2003A breakout board 0V and LM35 GND.
- A0 connected to LM35 Vout.
- D8 connected to ULN2003A breakout board In 1.
- D9 connected to ULN2003A breakout board In 2.
- D10 connected to ULN2003A breakout board In 3.
- D11 connected to ULN2003A breakout board In 4.
28BYJ-48 Stepper Motor
- BLUE connected to ULN2003A breakout board BLUE wire.
- PINK connected to ULN2003A breakout board PINK wire.
- YELLOW connected to ULN2003A breakout board YELLOW wire.
- ORANGE connected to ULN2003A breakout board ORANGE wire.
- RED connected to ULN2003A breakout board RED wire.
ULN2003A Breakout Board
- +5V connected to Arduino UNO 5V.
- 0V connected to Arduino UNO GND.
- In 1 connected to Arduino UNO D8.
- In 2 connected to Arduino UNO D9.
- In 3 connected to Arduino UNO D10.
- In 4 connected to Arduino UNO D11.
- BLUE wire connected to 28BYJ-48 Stepper Motor BLUE.
- PINK wire connected to 28BYJ-48 Stepper Motor PINK.
- YELLOW wire connected to 28BYJ-48 Stepper Motor YELLOW.
- ORANGE wire connected to 28BYJ-48 Stepper Motor ORANGE.
- RED wire connected to 28BYJ-48 Stepper Motor RED.
Temperature Sensor (LM35)
- +Vs connected to Arduino UNO 5V.
- Vout connected to Arduino UNO A0.
- GND connected to Arduino UNO GND.
Documented Code
Arduino UNO Code (sketch.ino)
// Arduino stepper motor control code
#include <Stepper.h> // Include the header file
// change this to the number of steps on your motor
#define STEPS 32
// create an instance of the stepper class using the steps and pins
Stepper stepper(STEPS, 8, 9, 10, 11);
int val = 0;
void setup() {
Serial.begin(9600);
stepper.setSpeed(200);
}
void loop() {
if (Serial.available()>0)
{
val = Serial.parseInt();
stepper.step(val);
Serial.println(val); //for debugging
}
}
Description: This code snippet is responsible for controlling the stepper motor via the Arduino UNO. It initializes the stepper motor with the specified number of steps and sets up the pins connected to the ULN2003A breakout board. The loop function listens for serial input and moves the stepper motor accordingly.
Temperature Sensor Code (Not Provided)
Description: There is no specific code provided for the temperature sensor (LM35). However, the sensor's output voltage is connected to the Arduino's analog pin A0, which can be read using analogRead(A0) to determine the temperature.