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:12] f1slsprojets:antennes:robotized_mag_loop:index [2021/05/16 18:56] (Version actuelle) – [LIBS] f1sls
Ligne 43: Ligne 43:
  
 {{: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:uln2003-datasheet.pdf |}} {{ :projets:antennes:robotized_mag_loop:uln2003-datasheet.pdf |}}
 +
 +{{:projets:antennes:robotized_mag_loop:uln2003-datasheet-pinout-circuit-diagram-proteus-simulation.png?direct&400|}}
  
 === ULN2003 DRIVER BOARD DATASHEET === === ULN2003 DRIVER BOARD DATASHEET ===
 {{ :projets:antennes:robotized_mag_loop:uln2003-stepper-motor-driver-pcb.pdf |}} {{ :projets:antennes:robotized_mag_loop:uln2003-stepper-motor-driver-pcb.pdf |}}
  
-===== SCHEMATICS =====+===== 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 ===== ===== CODE =====
-==== ARDUINO STEPPER EXEMPLES ====+==== LIBS ==== 
 +  * https://github.com/Mohamad1994HD/28BYJ48 
 +==== ARDUINO STEPPER EXAMPLES ====
 <code cpp> <code cpp>
 /* Example sketch to control a 28BYJ-48 stepper motor with ULN2003 driver board and Arduino UNO. More info: https://www.makerguides.com */ /* Example sketch to control a 28BYJ-48 stepper motor with ULN2003 driver board and Arduino UNO. More info: https://www.makerguides.com */
Ligne 93: Ligne 143:
 } }
 </code> </code>
 +----
  
 <code cpp> <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> </code>
projets/antennes/robotized_mag_loop/index.1620900758.txt.gz · Dernière modification : de f1sls