First Test: Super StarterKit from Elegoo - Motor 3-6V DC

First Test: Super StarterKit from Elegoo - Motor 3-6V DC © GPL3+

This is a project controlling a motor.

  • 8,671 views
  • 1 comment
  • 12 respects

Components and supplies

Apps and online services

About this project

Project

Today we look at the control of a motor and influence the rotation speed via inputs of the serial monitor. In addition, I point out a difference to the Particle Photon.

Following the schematic of the manufacturer from its instruction lesson number 22, the set-up with the additional components in the set can be quickly solved.

Serial Monitor

The speed of the torque can be influenced by the serial monitor and must be at least 50. From this 50, the corresponding voltage is generated at the port of the motor. Let's take a closer look: How does our input reach the engine? Within the loop, the serial is obeyed and the input is converted into an integer; a reaction is triggered by means of a loop:

If (Serial.available())  { Int speed = Serial.parseInt ();

Variant of Particle Photon

As an edge note, I represent the variant with a Particle Photon. Here, the command for reading the inputs is addressed first with Serial.read, and then the variable is checked:

Void setup() {
Serial.begin (9600);
}
Void loop() {
If (Serial.available()) {
Char ch = Serial.read();
If (ch == '?') {
Serial.print ("Hello World - I run since ms()=");
Serial.println (Millis());
}
}
Serial.println ("HelloUser - type in a '?' And press enter);
delay (2000);
}

Information about a servo motor is available here.

You will find more under my account.

Update 23.12.2017

I have found another DC motor in the drawers and this can be problem-free also operate with device and code: the model RF-300CA is sold as a solar engine, since a small solar module is there. I have closed the circuit with crocodile terminals and executed the code: by entering "50" the starting current could be reached. More about this in the network from a supplier as well as information about setting the speed via the gears in the housing.

The very simple case would be to ensure the power supply via a LiPo battery: thus the tiny turns wild.

Code

Original Example Code from ElegooC/C++
int motorPin = 3;
 
void setup() 
{ 
  pinMode(motorPin, OUTPUT);
  Serial.begin(9600);
  while (! Serial);
  Serial.println("Speed 0 to 255");
  Serial.println("But the advice 50 to 255. Because the minimum voltage required to start the motor is 50.");
} 
 
 
void loop() 
{ 
  if (Serial.available())
  {
    int speed = Serial.parseInt();
    if (speed >= 50 && speed <= 255)
    {
      analogWrite(motorPin, speed);
    }
  }
} 

Schematics

dcmotor_schematic_2REo3wiTMJ.JPG
Dcmotor schematic 2reo3witmj

Comments

Similar projects you might like

Check a Stepper Motor From the DVD-ROM

by Ingo Lohs

  • 13,675 views
  • 2 comments
  • 43 respects

Motor Controlled with Arduino

by Benjamin Larralde

  • 25,445 views
  • 20 comments
  • 68 respects

DC Motor Controlling Library

Project tutorial by ambhatt

  • 14,332 views
  • 13 comments
  • 43 respects

Arduino Simple "Camera Slider" Electronics

Project tutorial by Ian Cumming

  • 8,231 views
  • 3 comments
  • 19 respects

Arduino Bluetooth Robot for Android Device

Project showcase by aip06

  • 3,634 views
  • 2 comments
  • 16 respects

Clap Controlled DC Motor

Project tutorial by Nakshatra401

  • 1,459 views
  • 1 comment
  • 7 respects
Add projectSign up / Login