Elevator "Suburb 41" L298 motor drive - mcworkshop

MC   WORKSHOP
Vai ai contenuti

Menu principale:

Elevator "Suburb 41" L298 motor drive

The idea comes from the films Banlieue 13 and Alien. With a scenario between a sub-urban and spatial area, the project of a freight elevator is born. The title of the post is explanatory; 41 is the street number of my door. Each country has its own "Alien Banlieue". Have fun!
I decided to make a copy of this project. You may find small differences in the photographs. This depends on which of the two models I have photographed.
Scrolling through the article you will see the progress of the work.
L'idea viene dai film Banlieue 13 e Alien. Con uno scenario tra un'area sub-urbana e spaziale, nasce il progetto di un montacarichi. Il titolo del post è esplicativo; 41 è il numero civico della mia porta. Ogni paese ha il suo "Alien Banlieue". Buon divertimento!
Ho deciso di fare una copia di questo progetto. Potresti trovare piccole differenze nelle fotografie. Questo dipende da quale dei due modelli ho fotografato.
Scorrendo l'articolo vedrai lo stato di avanzamento dei lavori.


Some photos of the first connections and tests of the software.


picture #1


picture #2

The basic idea of the structure


picture #3

Cabin lift


picture #4

The electronics
L298N Dual H-Bridge Motor Controller


picture # 5, 6, 7
 

OUT 1, OUT 2 = MOTOR
+12 = power supply ext
+5 = from Arduino
ENA = to Pin 3 Arduino
IN1 = to Pin 2 Arduino
IN2 = to Pin 4 Arduino

Buttons
You must use the Pull Down configuration
Utilizzare, per i pulsanti, la configuarazione Pull Down

picture #8


Button 1 = Pin 8 Arduino
Button 2 = Pin 9 Arduino
Button 3 = Pin 10 Arduino

Motor HC02-48


picture #9


Out1 , Out 2 L298N
Motor Operating Voltage : 3.3v to 6v
Model : HC02-48
2 Way Motor Shaft
Gear Reduction : 1-48
Speed(No Load ) : 3v(125RPM) 5V(208RPM)
Torque : 0.7kg.cm

LM2596 Step Down Adjustable

picture #10

LM2596 Buck (Step Down) adjustable DC/DC Converter, switching Regulator board. Ideal Point-off

Input: 4.5-40VDC
Output: 1.5-37VDC
Rated Current: 2A (Heatsink Required above 10W)
Regulation: 0.5%

Tower Pro Micro Servo SG90


picture #11

#include <Servo.h>

Yellow = pin 5 Arduino and pin 6
Red = + 5V
Brown = GND


Weight: 9g /0.39oz
Dimension: 23×12.2x29mm
Stall torque: 1.8kg/cm(4.8v)
Operating speed: 0.12 sec/60degree(4.8v)
Operating voltage: 4.8v
Temperature range: 0c_ 55c
Dead band width: 1us
Servo wire length: 25 cm

Leds

picture #12

const int light = 13; //cabin light

Resistor 470 ohm to 1K
Pin 13 Arduino

Power supply system


picture #13


picture #14

Wiring diagram


picture #15

Download sketch here: https://pastebin.com/4s194SBR


Sketch
// ELEVATOR
// by MC Workshop - Marco Cerani, novembre 2018 V1.5
// https://mpmcworkshop.blogspot.it/
// https://www.facebook.com/mpmcworkshop/
//Dual H-Bridge: in1 to pin 2 Arduino, in2 to pin 4 Arduino
//Dual H-Bridge: 6Vcc connector 1 e 2 H-Bridge
//Dual H-Bridge: motor out 1 e 2 pin H-Bridge
//Dual H-Bridge: + 5 from Arduino to connector 3 H-Bridge
//Dual H-Bridge: remove ENA. ENA to pin 3 Arduino
//Servo: wire yellow = signal red +5Vcc
//Buttons: Pull Down 10K

//This example code is in the public domain.
#include <Servo.h>
Servo myservo;
Servo myservo2;
int pos = 90; //servo bar of the cabin
int pos2 = 90; //servo2 gangway
//motor
int dir1PinA = 2; //direction clockwise
int dir2PinA = 4; //anti-clockwise direction
int speedPinA = 3; //PWM
//
int speed = 200; //speed motor
int buttonState = 0; //up
int buttonState1 = 0; // stop
int buttonState2 = 0; // down
//buttons
const int buttonPin = 8; //up
const int buttonPin1 = 9; //stop
const int buttonPin2 = 10; //down
//cabin light
int light = 13; //cabin light
void setup() {
 Serial.begin(9600);
 myservo.attach(6);
 myservo2.attach(5);
 pinMode(dir1PinA, OUTPUT); //pin 2
 pinMode(dir2PinA, OUTPUT); // pin 4
 pinMode(speedPinA, OUTPUT); // 3 PWM
 pinMode(buttonPin, INPUT); //up
 pinMode(buttonPin1, INPUT); //stop
 pinMode(buttonPin2, INPUT); //down
 pinMode(light, OUTPUT); //cabin light
 myservo.write (115);
 myservo2.write (92); }
void loop() {
 buttonState = digitalRead(buttonPin);
 buttonState1 = digitalRead(buttonPin1);
 buttonState2 = digitalRead(buttonPin2);
 //warning: do not close with a clamp (token). It could give an error in the conditions (if).
 //up -------------------------
 if (buttonState == HIGH) {
   myservo.write (115);
   myservo2.write (40);
   delay (10);
   analogWrite(speedPinA, speed);
   digitalWrite(dir1PinA, LOW);
   digitalWrite(dir2PinA, HIGH);
   digitalWrite(light, HIGH);}
 //stop -----------------------
 if (buttonState1 == HIGH) {
   myservo.write (30);
   myservo2.write (92);
   delay (10);
   analogWrite(speedPinA, 0);
   digitalWrite(dir1PinA, LOW);
   digitalWrite(dir2PinA, LOW);
   digitalWrite(light, LOW);}
 //down -----------------------
 if (buttonState2 == HIGH) {
   myservo.write (115);
   myservo2.write (40);
   delay (10);
   analogWrite(speedPinA, speed);
   digitalWrite(dir1PinA, HIGH);
   digitalWrite(dir2PinA, LOW);
   digitalWrite(light, HIGH);
 }
}

The second model
The second model uses only three step downs. 7.6Vcc for Arduino, 5Vcc for servomotor, 6Vcc for motor.
The power supply voltage of the lights is taken directly from the external power supply (9 / 12Vcc).
Il secondo modello usa solo tre step down. 7.6 Vcc per Arduino, 5 Vcc per il servomotore, 6 Vcc per il motore.
La tensione di alimentazione delle luci è presa direttamente dall'alimentazione esterna (9 / 12Vcc).


 
Copyright 2015. All rights reserved.
Torna ai contenuti | Torna al menu