Compañero LCD con IA: Tu Amigo Interactivo con Arduino
Componentes y materiales
| Arduino UNO | 1 |
| Potenciómetro rotativo | 1 |
| Cables jumper (genéricos) | 19 |
| Protoboard | 1 |
| Pulsadores | 4 |
| Resistencia 100 Ω | 3 |
| Resistencia 221 Ω | 1 |
| Pantalla LCD 16x2 (blanco sobre azul, Adafruit) | 1 |
Software
- Arduino IDE
- Arduino Web Editor
Sobre el proyecto
Un compañero interactivo para momentos de soledad. "Robi" saluda, conversa y juega mediante una pantalla LCD y cuatro botones.
Montaje
- Conecta la LCD al Arduino (pines 12, 11, 5, 4, 3, 2). Usa el potenciómetro en el pin de contraste (VO) o una resistencia 1k Ω a GND.
- Conecta 4 pulsadores a pines 9, 10, 8 y otro (según código). Usa resistencias pull-down de 10k Ω o internas.
- Alimenta el Arduino.
Código completo
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int buttonPin = 9; // Botón principal
const int buttonPin2 = 10; // Opción: Parque
const int buttonPin3 = 8; // Opción: Casa
void setup() {
pinMode(buttonPin, INPUT);
pinMode(buttonPin2, INPUT);
pinMode(buttonPin3, INPUT);
lcd.begin(16, 2);
// Secuencia de bienvenida
lcd.print(" (.) (.) Hi I");
lcd.setCursor(0, 1); lcd.print("(____) am Robi"); delay(2000);
lcd.clear();
lcd.print(" (.) (.) You ");
lcd.setCursor(0, 1); lcd.print(" ____ can talk"); delay(2000);
lcd.clear();
lcd.print(" (-) (-) to ");
lcd.setCursor(0, 1); lcd.print(" (____) me!"); delay(2000);
lcd.clear();
lcd.print(" (.) (.)Tap ");
lcd.setCursor(0, 1); lcd.print(" ____ the"); delay(2000);
lcd.clear();
lcd.print(" (.) (.) but ");
lcd.setCursor(0, 1); lcd.print(" (____) ton"); delay(2000);
}
void loop() {
// Botón principal: inicia interacción
if (digitalRead(buttonPin) == HIGH) {
lcd.clear(); lcd.print("Hello I am"); lcd.setCursor(0,1); lcd.print("Alexander"); delay(2000);
lcd.clear(); lcd.print(" (*) (*) Hi!"); lcd.setCursor(0,1); lcd.print(" (____)"); delay(2000);
lcd.clear(); lcd.print(" (.) (.)Let's"); lcd.setCursor(0,1); lcd.print(" ____ play"); delay(2000);
lcd.clear(); lcd.print("OK!"); lcd.setCursor(0,1); lcd.print(" But Where?"); delay(2000);
lcd.clear(); lcd.print(" (.) (.) Park"); lcd.setCursor(0,1); lcd.print(" (____)or home?"); delay(2000);
}
// Botón 2: ir al parque
if (digitalRead(buttonPin2) == HIGH) {
lcd.clear(); lcd.print("You go to"); lcd.setCursor(0,1); lcd.print("the Park..."); delay(2000);
lcd.clear(); lcd.print(" (.) (.) Lets"); lcd.setCursor(0,1); lcd.print(" ____ swing!"); delay(2000);
lcd.clear(); lcd.print("OK!"); lcd.setCursor(0,1); lcd.print("You swing..."); delay(2000);
lcd.clear(); lcd.print(" (*) (*) I'm"); lcd.setCursor(0,1); lcd.print(" (___) tired"); delay(2000);
lcd.clear(); lcd.print("Me too!"); lcd.setCursor(0,1); lcd.print("Lets drink."); delay(2000);
lcd.clear(); lcd.print(" (.) (.) Yeah"); lcd.setCursor(0,1); lcd.print(" (____) "); delay(2000);
lcd.clear(); lcd.print("You go buy"); lcd.setCursor(0,1); lcd.print("a drink..."); delay(2000);
lcd.clear(); lcd.print(" (*) (*) Ahh!"); lcd.setCursor(0,1); lcd.print(" ____ OW!!"); delay(2000);
lcd.clear(); lcd.print("What?"); lcd.setCursor(0,1); lcd.print("..."); delay(2000);
lcd.clear(); lcd.print(" (*) (*)Water"); lcd.setCursor(0,1); lcd.print(" []got in my eye"); delay(2000);
lcd.clear(); lcd.print("To be "); lcd.setCursor(0,1); lcd.print("continued."); delay(2000);
}
// Botón 3: ir a casa
if (digitalRead(buttonPin3) == HIGH) {
lcd.clear(); lcd.print("You go to"); lcd.setCursor(0,1); lcd.print("your home..."); delay(2000);
lcd.clear(); lcd.print(" (.) (.) WOW!"); lcd.setCursor(0,1); lcd.print(" ___ Cool!"); delay(2000);
lcd.clear(); lcd.print("You play for"); lcd.setCursor(0,1); lcd.print("the day..."); delay(2000);
lcd.clear(); lcd.print("To be"); lcd.setCursor(0,1); lcd.print("continued."); delay(2000);
lcd.clear();
}
}
Esquemático
Consulta el diagrama de conexiones en la sección "Schematics" del proyecto original.
Personalización
Puedes extender la historia añadiendo más textos después de "To be continued." Copia y pega bloques lcd.clear(); lcd.print(...); delay(...); en el código.
Proceso de manufactura
- Construye tu Juego "UFO Attack" con Arduino UNO y Pantalla MAX7219
- Construya un osciloscopio Arduino de 20 kHz en LCD Nokia 5110: Guía DIY fácil
- Persianas Inteligentes: Control Automático de Luz con Arduino y Energía Solar
- Reloj 3D RGB Arduclock – Bluetooth, LED NeoPixel y RTC
- Monitor de Salud Fluvial: Sistema de Calidad de Agua con Arduino
- Sensor de obstáculos IR casero con Arduino – Tutorial fácil con LED IR y fotodiodo
- Juego interactivo con joystick analógico y LEDs en Arduino
- Find Me: Localizador Inteligente de Objetos con Arduino y Bluetooth
- Osciloscopio DIY con Arduino Nano (10 Hz–50 kHz) y LCD 128×64
- Pequeño Rover con Arduino: Construye tu Robot Autónomo Evita Obstáculos
- Construye un volante joystick personalizado con Arduino para gaming