Creature Showtime

by camilyjusto551 in Design > Art

7 Views, 0 Favorites, 0 Comments

Creature Showtime

Uma vestimenta simulando a lenda da curacanga, com habilidade de transformar a cabeça que se solta do seu corpo em uma bola de fogo

Supplies

Arduino Uno

Motor Redutor

Botão

Fita LED

Tnt (tecido)

Isopor

Bateria Moeda

Cabo Macho Fêmea

Relés

Confecção Da Vestimenta

  1. Faça as medidas e corte o tecido.
  2. Junte usando costura e/ou cola quente.
  3. Molde um isopor para dar a sustentação da cabeça do personagem.

Firmware

// ==========================================

// PROJETO: MOTOR + RELES + FITA LED RGB

// ARDUINO UNO + SISTEMA DE LOG

// ==========================================


// BOTOES

const int botao1 = 2;

const int botao2 = 12;

const int botao3 = 4;


// RELES DO MOTOR

const int rele1 = 8;

const int rele2 = 9;


// FITA LED RGB

const int ledR = 5;

const int ledG = 6;

const int ledB = 10;


// ESTADO DA FITA

bool estadoLED = false;


// LEITURA ANTERIOR DOS BOTOES

bool anteriorBotao1 = HIGH;

bool anteriorBotao2 = HIGH;

bool anteriorBotao3 = HIGH;


// CONFIGURACAO DOS RELES

const int RELE_LIGADO = LOW;

const int RELE_DESLIGADO = HIGH;


// ==========================================

// FUNCAO PARA DESLIGAR O MOTOR

// ==========================================


void desligarMotor() {

digitalWrite(rele1, RELE_DESLIGADO);

digitalWrite(rele2, RELE_DESLIGADO);


Serial.println("[MOTOR] Motor desligado.");

}


// ==========================================

// FUNCAO PARA CONTROLAR A FITA RGB

// ==========================================


void atualizarLED() {


if (estadoLED == true) {


digitalWrite(ledR, HIGH);

digitalWrite(ledG, LOW);

digitalWrite(ledB, LOW);


Serial.println("[LED] Fita ligada - COR VERMELHA.");


} else {


digitalWrite(ledR, LOW);

digitalWrite(ledG, LOW);

digitalWrite(ledB, LOW);


Serial.println("[LED] Fita desligada.");


}

}


// ==========================================

// CONFIGURACAO INICIAL

// ==========================================


void setup() {


Serial.begin(9600);


Serial.println("================================");

Serial.println(" SISTEMA INICIADO");

Serial.println(" MOTOR + RELES + FITA RGB");

Serial.println("================================");


// BOTOES

pinMode(botao1, INPUT_PULLUP);

pinMode(botao2, INPUT_PULLUP);

pinMode(botao3, INPUT_PULLUP);


// RELES

pinMode(rele1, OUTPUT);

pinMode(rele2, OUTPUT);


// FITA RGB

pinMode(ledR, OUTPUT);

pinMode(ledG, OUTPUT);

pinMode(ledB, OUTPUT);


// ESTADO INICIAL

digitalWrite(rele1, RELE_DESLIGADO);

digitalWrite(rele2, RELE_DESLIGADO);


atualizarLED();


Serial.println("[SISTEMA] Inicializacao concluida.");

}


// ==========================================

// PROGRAMA PRINCIPAL

// ==========================================


void loop() {


// LEITURA DOS BOTOES

bool leitura1 = digitalRead(botao1);

bool leitura2 = digitalRead(botao2);

bool leitura3 = digitalRead(botao3);


// LOG DOS VALORES DOS BOTOES

Serial.print("[BOTOES] B1: ");

Serial.print(leitura1);


Serial.print(" | B2: ");

Serial.print(leitura2);


Serial.print(" | B3: ");

Serial.println(leitura3);


// ----------------------------------------

// BOTAO 1: MOTOR SENTIDO 1

// ----------------------------------------


if (leitura1 == LOW && anteriorBotao1 == HIGH) {


Serial.println("[BOTAO 1] Pressionado.");

Serial.println("[MOTOR] Sentido 1 selecionado.");


desligarMotor();


delay(100);


digitalWrite(rele1, RELE_LIGADO);

digitalWrite(rele2, RELE_DESLIGADO);


Serial.println("[RELE] Rele 1 acionado.");

}


// ----------------------------------------

// BOTAO 2: MOTOR SENTIDO 2

// ----------------------------------------


if (leitura2 == LOW && anteriorBotao2 == HIGH) {


Serial.println("[BOTAO 2] Pressionado.");

Serial.println("[MOTOR] Sentido 2 selecionado.");


desligarMotor();


delay(100);


digitalWrite(rele1, RELE_DESLIGADO);

digitalWrite(rele2, RELE_LIGADO);


Serial.println("[RELE] Rele 2 acionado.");

}


// ----------------------------------------

// BOTAO 3: LIGA/DESLIGA FITA RGB

// ----------------------------------------


if (leitura3 == LOW && anteriorBotao3 == HIGH) {


Serial.println("[BOTAO 3] Pressionado.");


estadoLED = !estadoLED;


atualizarLED();

}


// ----------------------------------------

// ATUALIZA LEITURAS ANTERIORES

// ----------------------------------------


anteriorBotao1 = leitura1;

anteriorBotao2 = leitura2;

anteriorBotao3 = leitura3;


delay(100);

}

Circuito

Botões:

- Botão 1 → pino 2.

- Botão 2 → pino 12.

- Botão 3 → pino 4.

- Outro terminal de cada botão → GND.


Relés e motor:

- IN1 → pino 8.

- IN2 → pino 9.

- VCC e GND → alimentação compatível.

- Conecte o motor aos contatos dos relés conforme o circuito de reversão.


Fita LED RGB:

- Vermelho → pino 5.

- Verde → pino 6.

- Azul → pino 10.

- Utilize acionadores e fonte externa adequados.


Programação:

- Conecte o Arduino ao computador.

- Abra a Arduino IDE.

- Insira o código.

- Selecione Arduino Uno e a porta correta.

- Clique em Carregar.


Testes:

- Botão 1: motor no sentido 1.

- Botão 2: motor no sentido 2.

- Botão 3: liga/desliga a fita LED.