Control Panel System — Arduino Uno simulation

Control panel with LCD display, potentiometers, pushbuttons, relays, and status LEDs for system monitoring and interaction.

An interactive Arduino Uno circuit simulation you can run free in your browser on Velxio, by albertoarangurenp.

Components

Sketch code

/*
   Simulador CKP/CMP Profesional (Multimarca Corregido y Completo)
   Placa: Arduino Uno (ATmega328P)
   
   Mapeo de Entradas:
     - Pin 4: Botón ANTERIOR (<)
     - Pin 3: Botón SELECCIONAR / ACTIVAR (OK)
     - Pin 2: Botón SIGUIENTE (>)
     - Pin A0: Potenciómetro de RPM (Límite: 300 - 4500 RPM)
     
   Mapeo de Salidas:
     - Pin 10 (PB2): CKP  (Cigüeñal)
     - Pin 9  (PB1): CMP1 (Árbol de levas 1)
     - Pin 8  (PB0): CMP2 (Árbol de levas 2)
*/

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <avr/pgmspace.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

const byte PIN_BTN_PREV = 4;
const byte PIN_BTN_OK   = 3;
const byte PIN_BTN_NEXT = 2;
const byte PIN_POT_RPM  = A0;

struct PerfilVehiculo {
  const char* nombre;
  const uint8_t* patron;
  uint16_t tamanoPatron;        
  uint16_t vueltasCiguenalCiclo;
};

// ==========================================
// TABLAS DE PATRONES EN MEMORIA FLASH (PROGMEM)
// Bit 0 (0x01) -> Pin 10 (CKP)
// Bit 1 (0x02) -> Pin 9  (CMP1)
// Bit 2 (0x04) -> Pin 8  (CMP2)
// ==========================================

// 1. GM / Chery / Fiat / VW / Hyundai / Kia (60-2 CORREGIDO)
const uint8_t patron_60_2[] PROGMEM = {
  // --- VUELTA 1 CIGÜEÑAL ---
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x03,0x02, 0x03,0x02, 0x03,0x02, 0x03,0x02, 0x03,0x02, 0x03,0x02, 0x03,0x02, 0x03,0x02,
  0x03,0x02, 0x03,0x02, 0x03,0x02,
  0x00,0x00, 0x00,0x00,

  // --- VUELTA 2 CIGÜEÑAL ---
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00,
  0x00,0x00, 0x00,0x00
};

// 2. Ford Fiesta / EcoSport Zetec RoCam & Sigma (36-1 CORREGIDO)
const uint8_t patron_36_1[] PROGMEM = {
  // --- VUELTA 1 CIGÜEÑAL ---
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00,
  0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01,0x00, 0x01

More projects by albertoarangurenp