Manufaturação industrial
Internet das coisas industrial | Materiais industriais | Manutenção e reparo de equipamentos | Programação industrial |
home  MfgRobots >> Manufaturação industrial >  >> Manufacturing Technology >> Processo de manufatura

Modelo Arquitetônico de Ponto de Ônibus Inteligente com Toldo Automático

Componentes e Materiais

ComponenteDescriçãoQtd
Arduino Nano R3 Pequeno, fácil de esconder no modelo. 1
Servo MG995 Servo robusto (high torque) para toldo pesado. 1
Fotoresistor (LDR) Um voltado para Leste, outro para Oeste. 2
Sensor de Chuva – 1
LED Branco Alto Brilho Iluminação interna e externa. 6
Resistor 220 Ω Para LEDs. 3
Protoboard (genérica) – 1
Jumpers Macho-Macho – 27
Bloco de Terminais Parafuso – 2
Conector Bateria 9V – 2
Bateria 9V – 1
Suporte 4xAA Fonte externa para o MG995. 1

Sobre o Projeto

Esta é uma atualização do projeto anterior (V1.0).

Principais mudanças da V1.0:

Versão 1.0: Model Version 1.0

Código

O Código (C/C++)

#include <VarSpeedServo.h>
VarSpeedServo servo;

int easternLight = 0;
int westernLight = 0;
int rainSensed = 0;
int sunshadePosition = 0;
int rainThreshold = 512;
int sunshadeExpanded = 120;
int sunshadeContracted = 60;
int ambientLighting = 0;
int turnOnLightsOn = 150;
int ledIntensity = 0;
int ledPower = 0;
int servoSpeed = 20;
bool debugging = false; // TRUE para debug no Serial

void setup() {
  pinMode(A4, OUTPUT); // Iluminação interna
  pinMode(A5, OUTPUT); // Luz externa (poste)
  pinMode(A1, INPUT);  // Luz oeste
  pinMode(A2, INPUT);  // Luz leste
  pinMode(A3, INPUT);  // Sensor chuva analógico
  pinMode(2, INPUT);   // Sensor chuva digital
  servo.attach(A0);
  servo.write(sunshadeContracted, servoSpeed, true);
  if (debugging) {
    Serial.begin(9600);
    Serial.println("*** DEBUGGING STARTED ***");
    Serial.println("-------------------------");
  }
}

void oya_mydebug(String text, int value = NULL) {
  if (debugging) {
    Serial.print(text);
    if (value) { Serial.print(" = "); Serial.println(value); }
    else { Serial.println(" "); }
  }
}

void expand_collapse(int easternLight, int westernLight) {
  if (easternLight <= westernLight) { // Nascer do sol
    oya_mydebug("It's sunrise");
    if (sunshadePosition != sunshadeExpanded) {
      servo.write(sunshadeExpanded, servoSpeed, true);
      oya_mydebug("Sunshade expanded");
    }
  }
  if (easternLight > westernLight) { // Pôr do sol
    oya_mydebug("Sun is going down");
    if (sunshadePosition != sunshadeContracted) {
      servo.write(sunshadeContracted, servoSpeed, true);
      oya_mydebug("Sunshade contracted");
    }
  }
}

void loop() {
  easternLight = analogRead(A2);
  westernLight = analogRead(A1);
  rainSensed = analogRead(A3);
  sunshadePosition = servo.read();
  ambientLighting = (easternLight + westernLight) / 2; // média

  oya_mydebug("easternLight", easternLight);
  oya_mydebug("westernLight", westernLight);
  oya_mydebug("rainSensed", rainSensed);
  oya_mydebug("sunshadePosition", sunshadePosition);
  oya_mydebug("ambientLighting", ambientLighting);

  // Chovendo?
  if (rainSensed < rainThreshold) {
    oya_mydebug("It's raining...");
    if (sunshadePosition != sunshadeExpanded) {
      servo.write(sunshadeExpanded, servoSpeed, true);
      oya_mydebug("Sunshade expanded");
    }
  } else {
    oya_mydebug("It is not raining...");
    if (ambientLighting <= turnOnLightsOn) { // Escurecendo
      oya_mydebug("It's getting dark, turning on lights");
      ledPower = (turnOnLightsOn - ambientLighting) * 4;
      oya_mydebug("ledPower", ledPower);
      analogWrite(A5, ledPower);
      analogWrite(A4, ledPower);
      expand_collapse(easternLight, westernLight);
    } else { // Muito sol
      oya_mydebug("A lot of sunshine, turn off lights");
      analogWrite(A5, 0);
      analogWrite(A4, 0);
      expand_collapse(easternLight, westernLight);
    }
  }

  if (debugging) {
    Serial.println("********************");
    Serial.println(" ");
    delay(5000);
  } else {
    delay(100);
  }
}

Esquemático

Modelo Arquitetônico de Ponto de Ônibus Inteligente com Toldo Automático

Processo de manufatura

  1. Trens Lionel: História, Fabricação e Futuro
  2. Robô de Triagem de Reciclagem Alimentado por Google Coral Edge TPU
  3. Maximize Receita Recorrente com Consumíveis Inteligentes: Um Divisor de Águas para Fabricantes de Máquinas
  4. Controle Automático de Trem DIY com Arduino – Simples, Confiável e Personalizável
  5. Robô Desviador de Obstáculos com Servo: Construa com Arduino e HC-SR04
  6. Torno Linear SPRINT 20: Torneamento Automatizado Rápido para Peças de Alta Precisão
  7. Fundamentos da Prensa Servo: Potência, Precisão e Eficiência Explicadas
  8. Motores Servo Explicados: Como Funcionam e Por Que Importam
  9. Maximizando Precisão: Combinando Redutores com Servomotores
  10. Ciclo de Furação ECS G86 com Recurso de Parada do Fuso