Retourneur de montre en cube.
https://youtu.be/dRBOXgJVOcg
matériel nécessaire:
8X entretoise m3 comme celle ci: https://www.amazon.ca/-/fr/dp/B0BWV2NWTB?psc=1&ref=ppx_yo2ov_dt_b_product_details
2x bearing:
https://www.amazon.ca/-/fr/dp/B085D91TW1?psc=1&ref=ppx_yo2ov_dt_b_product_details
4x bearing:
https://www.amazon.ca/-/fr/dp/B09NZLWN18?psc=1&ref=ppx_yo2ov_dt_b_product_details
1x carte arduino nano:
https://www.amazon.ca/-/fr/Arduino-Every-carte-unique-ABX00028/dp/B07VX7MX27/ref=sr_1_11?__mk_fr_CA=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=3PMXE08J55PMB&keywords=arduino%2Bnano%2Bsans&qid=1699835113&s=electronics&sprefix=arduino%2Bnanao%2Bsans%2B%2Celectronics%2C190&sr=1-11&th=1
1x bouton:
https://www.amazon.ca/dp/B095KDCHQZ?ref=ppx_yo2ov_dt_b_product_details&th=1
1x boite connecteur dupont:
https://www.amazon.ca/dp/B014YTPFT8?psc=1&ref=ppx_yo2ov_dt_b_product_details
1x cable programmation:
https://www.amazon.ca/dp/B00EBGGXS2?ref=ppx_yo2ov_dt_b_product_details&th=1
1x boite m3:
https://www.amazon.ca/dp/B01J7NM9JA?ref=ppx_yo2ov_dt_b_product_details&th=1
8x vis sans tete allen:
https://www.amazon.ca/dp/B01MSNGPL8?psc=1&ref=ppx_yo2ov_dt_b_product_details
1x 28BYJ-48 Uln2003 DC 5 V :
https://www.amazon.ca/dp/B00LPK0E5A?psc=1&ref=ppx_yo2ov_dt_b_product_details
1x connecteur usb c:
https://www.amazon.ca/dp/B0C9HJKR8R?psc=1&ref=ppx_yo2ov_dt_b_product_details
1x boulon button head m5 x 18mm
4x boulon button gead m5 x 12mm
4x vis 1.7x5mm pour controlleur moteur
4x vis 1.4x3.3mm pour carte arduino
2x vis 1.7x5mm pour usb c
https://www.amazon.ca/-/fr/gp/product/B0894C5Y5Z/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
connecteur jst pour refaire le cable du moteur:
https://www.amazon.ca/-/fr/Bestgle-connecteurs-JST-XHP-broches-connecteur/dp/B07MBCLPBK/ref=sr_1_8?crid=1CXSQFDMJOX8A&keywords=jst+connector&qid=1699828488&sprefix=jst%2Caps%2C99&sr=8-8
insert m5 et m3
washer m5 et m3 pour faire office de shims.
1X spring cantrust:
https://www.homedepot.com/p/Superstrut-3-8-in-Strut-Channel-Spring-Nut-5-Pack-ZA1003-8EG-10/100179881
Brancher arduino et controlleur:
https://www.hadex.cz/spec/m513.pdf
code arduino:
//**************************************************
#include
#define
STEPS 100
// The motor (wires 1 2 3 4) is connected to the outputs 8 9 10 11 of the Arduino (and to GND, + V)
Stepper small_stepper (STEPS, 8, 10, 9, 11); // Clockwise
// Stepper small_stepper (STEPS, 11, 10, 9, 8); // Counterclockwise
int Steps2Take = 0; // Number of rotation steps requested from the motor
long time = 0; // Duration of rotation for one revolution
int motorPin1=8; //digital pin 8
int motorPin2=9;
int motorPin3=10;
int motorPin4=11;
// For a motor of this type: https://amzn.to/3d9IVh9
// 64 steps per revolution, 4 phases, 5.625 ° angle according to the motor specifications
// 1:64 reduction
// 360 ° / 5.625 ° * 64 = 4096 angles with the gear reduction
// 360 ° / 5.625 ° * 64 * 4 coils / 2 bipolar = 2048 step / turn
int Counter;
void setup ()
{
pinMode(motorPin1, OUTPUT); // Set pins to output mode
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
Serial.begin (9600);
Serial.println ("Stepper motor test");
pinMode (5, OUTPUT); // Declare Pin 5 as output for the LED
}
void loop ()
{
digitalWrite (5, HIGH);
delay (100);
Serial.println ("Motor running");
// Run the motor
small_stepper.setSpeed(300); // Speed of 300 (max) reduce this figure for a slower movement
// 100 allows to have a high torque> 300 the motor vibrates without turning
if (Counter <= 30) // turn by hours (30 = 700 turn per day)
{
Steps2Take = -8602; // One complete rotation with 17204 steps (8602 1/2 rotation)
time = millis ();
small_stepper.step (Steps2Take); //It turns
time = millis () - time;
Serial.println (time); // Displays the time (in ms) for a complete revolution
delay (1000); //pause
Steps2Take = 8602; // One complete rotation with 17204 steps
time = millis ();
small_stepper.step (Steps2Take); //It turns
time = millis () - time;
Serial.println (time); // Displays the time (in ms) for a complete revolution
delay (0); //pause
Steps2Take = 8602; // One complete rotation with 17204 steps
time = millis ();
small_stepper.step (Steps2Take); //It turns
time = millis () - time;
Serial.println (time); // Displays the time (in ms) for a complete revolution
delay (1000); //pause
Steps2Take = -8602; // One complete rotation with 17204 steps (1 turn around 4.5sec) (8602 1/2 rotation)
time = millis ();
small_stepper.step (Steps2Take); //It turns
time = millis () - time;
Serial.println (time); // Displays the time (in ms) for a complete revolution
delay (0); //pause
// LED flashing
// digitalWrite (5, LOW);
//delay (100);
// digitalWrite (5, HIGH);
// delay (100);
Counter ++; // Add 1 to the Counter
}
else{
//digitalWrite(5, LOW);
//delay(1000);
//digitalWrite(5, HIGH);
//delay(1000);
//digitalWrite(5, LOW);
//delay(1000);
//digitalWrite(5, HIGH);
// 1 Minute Elapsed
digitalWrite(motorPin1, LOW); //turn off power to motor
digitalWrite(motorPin2, LOW); //turn off power to motor
digitalWrite(motorPin3, LOW); //turn off power to motor
digitalWrite(motorPin4, LOW); //turn off power to motor
// Wait 1 hour before rotation again
delay(1800000); //(1800000) = 30 minutes
Counter = 0; // Reset the Counter
}
}