Hydroponic Controller for flood and drain cultivation

A digital hydroponic controller based on PIC16F648A microcontroller clocked @ 4 Mhz.

Code was written exclusively in ASM and is no longer maintained.

  • Controls an LCD 16x2 - HD44780 through a PCF8574 I2C expander. LCD contrast is digitaly adjusted through PWM modulation.
  • Offers a fully functional multi line menu to navigate through the various functions.
  • Implements I2C communication protocol through bit-banging.
  • Keeps track of time and sets alarms by controlling the RTC DS1307 through I2C.
  • Offers a cycle timer and ten absolute timers for scheduling flood and drain cycles.
  • Controls two separate optocoupled inputs and outputs:
    • Inputs are connected to the water float switches.
    • Outputs utilize two 12v/220v - 10A DIN rail relays, for controlling the water pumps.

shcematic.pngYou can download code, schematic and gerber files from Githup Repo.



Machining the prototype enclosure on a cheap DIY dremel based cnc:



Bill of Materials:

  • 6x 14-16 AWG Insulated Female Spade Wire Crimp Terminal Connector
  • 2x M3 Nut
  • 6x M3 A2 Stainless Steel Hex Socket Button Head Allen Bolt Screw ISO 7380 (M3 x 8mm long)
  • 5x Black Self Adhesive Cable Tie Mount Base Holder 20 x 20 x 6mm
  • 8x M5 Screw
  • 8x M5 Nut
  • 1x Glass Fuse 5 x 20mm 10A
  • 1x Dual Row Terminal Block 12 Position Barrier Strip Cable Wire Connector
  • 1x PG7 Black Plastic Waterproof Cable Gland Connector 3-6.5mm
  • 1x 5.5mm x 2.1mm DC Power Jack Socket Female Panel Mount Connector plug Copper
  • 1x Electrical Panel Mounted 5 x 20mm Fuse Holder
  • 1x DC power supply right angle Male cable 5.5x2.1 Plug
  • 1x 1m Wire 3 x 1,5mm2
  • 1x 3 Pin XLR Female Panel Mount Connector
  • 1x 3-Prong 4FT AC Power Supply Cord Cable for Laptop EU
  • 1x Digital Printed - Laminated Graphics Overlay
  • 2x Omron G2R-1A-T 12VDC Flange Relay 10A 250V
  • 2x Mennekes Panel mounted receptacle SCHUKO
  • 1x GEROS GR17011 plastic enclosure
  • 2x Waterproof JST connector wire LED Light Strips 2Pin Connector Cable Lamp
  • 1x 3PIN 3 Pole XLR male plug Audio cable Connector
  • 2x PP Mount Horizontal Water Level Sensor Liquid Float Switch
  • 1x 10m S-Video Cable
  • 1x 2.54 mm 40 Pin Single Row Pin Header Strip
  • 2x 1/4 Watt - 3.2 K ohm Metal Film Resistor
  • 8x 1/4 Watt - 4.7 K ohm Metal Film Resistor
  • 1x Red Color Diffused LED 3mm
  • 1x Green Color Diffused LED 3mm
  • 5x 1/4 Watt - 300 ohm Metal Film Resistor
  • 7x 1/4 Watt - 10 K ohm Metal Film Resistor
  • 2x 1/4 Watt - 1.2 K ohm Metal Film Resistor
  • 2x 1/4 Watt - 3.2 K ohm Metal Film Resistor
  • 8x 1/4 Watt - 4.7 K ohm Metal Film Resistor
  • 10x M3 Screw Philips Head Screw - M3 x 5mm silver color
  • 4x Tactile Switch 12x12x8
  • 1x 32.768 KHz 32768HZ Tuning Fork Watch Crystal 12.5PF 3mm x 8mm
  • 3x 1A 1000V Diode 1N4007 IN4007
  • 2x 0.01uF 10nF 50V Ceramic Disc Capacitor
  • 2x 2N4401 - NPN Transistor 600mA
  • 1x Glass Fuse 5 x 20mm 200mA
  • 1x Single Row 5 Pins Pitch 2.54mm PCB Socket Female Header
  • 4x PC817 PC817C EL817 817 Optocoupler
  • 1x 47uF Radial Type Aluminum Electrolytic Capacitors 6.5mm x 12mm
  • 1x 100uF Electrolytic Capacitor 8x12mm
  • 1x 10uF Electrolytic Capacitor 8x12mm
  • 2x BC546B - NPN Transistor 100mA
  • 1x PCB Mount 3 Pins 2.1mmx5.5mm DC Female Socket Power Jack
  • 1x CR2032 Button Coin Cell Battery Holder Socket Box Case ROHS
  • 1x Panel Mount PCB Fuse Holder Case with Cover 5x20mm
  • 2x Right-Angle KF2510-3P Connector Kits 2.54mm Pin Header+Terminal+Housing
  • 1x CR2032 Lithium Batteries 3V Coin Cell Button
  • 1x DS1307 Serial Real Time Clock 64X8 DIP-8
  • 1x IC ST TO-220 L7805CV 7805
  • 1x Remote 8-bit I/O expander for I2C-bus
  • 1x 2.54mm Pitch 16 Pin Female Single Row Straight Header Strip
  • 1x 1 Layer inhouse PCB for Keyboard
  • 1x Microchip PIC 16F648A
  • 1x 1602 LCD Verdant Characters Yellow Backlight HD44780
  • 1x 2 Layer PCB
  • 2x 40Pin 2.54mm Single Row Straight Long Needle 20mm
  • 2x Brass Screw PCB Standoffs Hexagonal Spacers M3 Male x M3 Female 5mm
  • 4x Brass standoff spacer M3 female x M3 female 15mm
  • 2x Nylon Standoff Spacer M3 Female x M3 Female - 11mm
  • 2x Brass standoff spacer M3 female x...
Read more »