Chat


How can I help you?

Explain project
Write a project description
Find schematic issues

U6
U1
U5 LCD
Manufacturer Part Number
NHD-C0216CIZ-FSW-FBW-3V3
Firmware Getting Started — SELV Spa-Light Switch Controller
MCU
Microchip PIC16F18855, 3.3 V logic, internal oscillator recommended. Enable WDT, BOR, CRC/checksum on configuration data, and fail-safe relay OFF defaults.
Pin Map

Table


NetMCU PinDirectionFirmware Function
BTN_ONOFFRB0InputDebounced manual ON/OFF button
BTN_MODERB1InputDebounced local program/mode fallback
OPTICAL_PROG_INRB2InputActive-low 40 kHz demodulated IR command input
MAINS_PRESENTRB3InputIsolated mains-present status
RELAY_FBRB4InputOptional auxiliary relay contact feedback
RELAY_SETRC0OutputPulse latching relay SET coil driver
RELAY_RESETRC1OutputPulse latching relay RESET coil driver
LED_POWERRC2Output/PWMPWM dimmed power/status LED sink
I2C_SCLRC3I2CAmbient light sensor clock
I2C_SDARC4I2CAmbient light sensor data
LED_STATUSRA1Output/PWMFault/status LED sink
TEMP_SENSERA0ADC10k NTC temperature divider
ICSPCLKRB6ProgrammingPICkit ICSP clock
ICSPDATRB7ProgrammingPICkit ICSP data
MCLR_VPPRE3/MCLR/VPPReset/programmingReset and programming voltage
Required Firmware Behaviors
  • Default state after reset, brownout, watchdog, overtemperature, invalid config, or invalid optical command: relay OFF.
  • Enter programming mode only after valid optical wake/preamble plus 2-second valid optical pulse or structured command frame.
  • Ignore incomplete/invalid optical commands and apply timeout.
  • Relay remains OFF during programming and for 60 seconds after programming ends.
  • Store configuration in EEPROM/internal flash with CRC/checksum.
  • On mains loss, disable LEDs/relay drive, timestamp outage if possible, and enter low-power hold-up mode.
  • MCU

  • Pin Map

  • Required Firmware Behaviors