ROBOTIZED MAG LOOP []

Outils pour utilisateurs

Outils du site


ROBOTIZED MAG LOOP

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
projets:antennes:robotized_mag_loop:index [2021/05/13 12:00] – [DRIVER BOARD] f1slsprojets:antennes:robotized_mag_loop:index [2021/05/16 18:56] (Version actuelle) – [LIBS] f1sls
Ligne 9: Ligne 9:
  
 {{:projets:antennes:robotized_mag_loop:28byj-48.jpg?direct&200|}} {{:projets:antennes:robotized_mag_loop:28byj-48.jpg?direct&200|}}
 +
 +=== DATASHEET ===
 +{{ :projets:antennes:robotized_mag_loop:28byj48-stepper-motor-datasheet.pdf |}}
  
 === CHARACTERISTICS === === CHARACTERISTICS ===
Ligne 34: Ligne 37:
  
 The Adafruit Industries Small Reduction Stepper Motor uses the same form factor as the 28BYJ-48, but does have a different gear ratio. It has a roughly 1/16 reduction gear set, which results in 513 steps per revolution (in full-step mode). You can download the datasheet for it here. The Adafruit Industries Small Reduction Stepper Motor uses the same form factor as the 28BYJ-48, but does have a different gear ratio. It has a roughly 1/16 reduction gear set, which results in 513 steps per revolution (in full-step mode). You can download the datasheet for it here.
 +
 +
 ==== DRIVER BOARD ==== ==== DRIVER BOARD ====
 The famous ULN2003 driver board. The famous ULN2003 driver board.
  
 {{:projets:antennes:robotized_mag_loop:uln2003_driver_board.jpg?direct&200|}} {{:projets:antennes:robotized_mag_loop:uln2003_driver_board.jpg?direct&200|}}
 +
 +{{:projets:antennes:robotized_mag_loop:uln2003-stepper-motor-driver-pinout.png?direct|}}
  
 === ULN2003 DATASHEET === === ULN2003 DATASHEET ===
-{{ :projets:antennes:robotized_mag_loop:28byj48-stepper-motor-datasheet.pdf |}} +{{ :projets:antennes:robotized_mag_loop:uln2003-datasheet.pdf |}} 
-===== SCHEMATICS =====+ 
 +{{:projets:antennes:robotized_mag_loop:uln2003-datasheet-pinout-circuit-diagram-proteus-simulation.png?direct&400|}} 
 + 
 +=== ULN2003 DRIVER BOARD DATASHEET === 
 +{{ :projets:antennes:robotized_mag_loop:uln2003-stepper-motor-driver-pcb.pdf |}} 
 + 
 +===== STEPPER CONTROL SCHEMATICS =====
 {{:projets:antennes:robotized_mag_loop:28byj-48-stepper-motor-uln2003-driver-wiring-diagram-schematic-pinout-1024x482.jpg?direct&600|}} {{:projets:antennes:robotized_mag_loop:28byj-48-stepper-motor-uln2003-driver-wiring-diagram-schematic-pinout-1024x482.jpg?direct&600|}}
 +
 +==== POSITION READING ====
 +
 +<WRAP center round info 60%>
 +We are using a 250k potentiometer to read the position of the stepper-motor / variable capacitor. We must avoid to go below the 0 position of the variable capacitor (fully open, minimum capacitance) and avoid to go over the 100% position of the variable capacitor (fully closed, maximum capacitance).
 +</WRAP>
 +
 +{{:projets:antennes:robotized_mag_loop:arduino_potentiometer_reading_01.png?direct&600|}}
 +
 +{{:projets:antennes:robotized_mag_loop:arduino_potentiometer_reading_02.png?direct&600|}}
 +
 +
 +<code cpp>
 +/* Analog Read to LED
 + * ------------------ 
 + *
 + * turns on and off a light emitting diode(LED) connected to digital  
 + * pin 13. The amount of time the LED will be on and off depends on
 + * the value obtained by analogRead(). In the easiest case we connect
 + * a potentiometer to analog pin 2.
 + *
 + * Created 1 December 2005
 + * copyleft 2005 DojoDave <http://www.0j0.org>
 + * http://arduino.berlios.de
 + *
 + */
 +
 +int potPin = 2;    // select the input pin for the potentiometer
 +int ledPin = 13;   // select the pin for the LED
 +int val = 0;       // variable to store the value coming from the sensor
 +
 +void setup() {
 +  pinMode(ledPin, OUTPUT);  // declare the ledPin as an OUTPUT
 +}
 +
 +void loop() {
 +  val = analogRead(potPin);    // read the value from the sensor
 +  digitalWrite(ledPin, HIGH);  // turn the ledPin on
 +  delay(val);                  // stop the program for some time
 +  digitalWrite(ledPin, LOW);   // turn the ledPin off
 +  delay(val);                  // stop the program for some time
 +}
 +</code>
 +
 +
 +===== CODE =====
 +==== LIBS ====
 +  * https://github.com/Mohamad1994HD/28BYJ48
 +==== ARDUINO STEPPER EXAMPLES ====
 +<code cpp>
 +/* Example sketch to control a 28BYJ-48 stepper motor with ULN2003 driver board and Arduino UNO. More info: https://www.makerguides.com */
 +
 +// Include the Arduino Stepper.h library:
 +#include <Stepper.h>
 +
 +// Define number of steps per rotation:
 +const int stepsPerRevolution = 2048;
 +
 +// Wiring:
 +// Pin 8 to IN1 on the ULN2003 driver
 +// Pin 9 to IN2 on the ULN2003 driver
 +// Pin 10 to IN3 on the ULN2003 driver
 +// Pin 11 to IN4 on the ULN2003 driver
 +
 +// Create stepper object called 'myStepper', note the pin order:
 +Stepper myStepper = Stepper(stepsPerRevolution, 8, 10, 9, 11);
 +
 +void setup() {
 +  // Set the speed to 5 rpm:
 +  myStepper.setSpeed(5);
 +  
 +  // Begin Serial communication at a baud rate of 9600:
 +  Serial.begin(9600);
 +}
 +
 +void loop() {
 +  // Step one revolution in one direction:
 +  Serial.println("clockwise");
 +  myStepper.step(stepsPerRevolution);
 +  delay(500);
 +  
 +  // Step one revolution in the other direction:
 +  Serial.println("counterclockwise");
 +  myStepper.step(-stepsPerRevolution);
 +  delay(500);
 +}
 +</code>
 +----
 +
 +<code cpp>
 +//Includes the Arduino Stepper Library
 +#include <Stepper.h>
 +
 +// Defines the number of steps per rotation
 +const int stepsPerRevolution = 2038;
 +
 +// Creates an instance of stepper class
 +// Pins entered in sequence IN1-IN3-IN2-IN4 for proper step sequence
 +Stepper myStepper = Stepper(stepsPerRevolution, 8, 10, 9, 11);
 +
 +void setup() {
 + // Nothing to do (Stepper Library sets pins as outputs)
 +}
 +
 +void loop() {
 + // Rotate CW slowly
 + myStepper.setSpeed(100);
 + myStepper.step(stepsPerRevolution);
 + delay(1000);
 +
 + // Rotate CCW quickly
 + myStepper.setSpeed(700);
 + myStepper.step(-stepsPerRevolution);
 + delay(1000);
 +}
 +</code>
projets/antennes/robotized_mag_loop/index.1620900043.txt.gz · Dernière modification : de f1sls