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

Arduino and NodeMCU Controlled Stepper Motors and Servo

View and Edit Project In Cirkit DesignerImage of Arduino and NodeMCU Controlled Stepper Motors and Servo

Circuit Documentation

Summary

The circuit in question appears to be designed for controlling stepper motors and a servo motor using an Arduino Leonardo and a NodeMCU ESP8266 microcontroller. The Arduino Leonardo is connected to two ULN2003A breakout boards, which in turn are connected to stepper motors. The NodeMCU ESP8266 is programmed to control a Tower Pro SG90 servo motor. Communication between the Arduino and the NodeMCU is established via serial connection, allowing for potential coordination or data exchange between the two microcontrollers.

Component List

Microcontrollers

Motor Drivers

Motors

Miscellaneous

Wiring Details

Arduino Leonardo (Rev3b)

ULN2003A Breakout Boards

28BYJ-48 Stepper Motors

Tower Pro SG90 Servo

Documented Code

Arduino Leonardo (Rev3b) Code

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This code is a template and does not contain any functionality. It needs to be populated with the logic to control the stepper motors via the ULN2003A breakout boards.

NodeMCU ESP8266 Code

/*
 * This Arduino Sketch controls a Tower Pro SG90 servo motor connected to
 * pin D6 of an ESP8266 NodeMCU. The servo motor will be moved to different
 * positions in a loop.
 */

#include <ESP8266WiFi.h>
#include <Servo.h>

Servo myServo;  // create servo object to control a servo

void setup() {
  myServo.attach(D6);  // attaches the servo on D6 to the servo object
}

void loop() {
  for (int pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    myServo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (int pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myServo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

This code snippet demonstrates the control of a Tower Pro SG90 servo motor, making it sweep back and forth between 0 and 180 degrees.