Firmware
The Picapot Controller offers some features your plants will love!
- Real-time clock with optional automatic daylight saving, geolocation-based sunrise/sunset, fractional timezone support, leap year handling, and calibration.
- Four watering modes: Fixed time, sunrise/sunset automatic, sunrise/sunset advanced, and fixed interval. Duration can range from 15 seconds to 1 hour. Optional automatic seasonal adjustment of duration and watering interval.*
- Skip watering based on soil moisture (requires an external soil moisture sensor).
- Manual watering with a timer for immediate valve control.
- Frost protection: Skip watering at low temperatures to protect the plants and the valve.
- Boost watering during heatwaves.
- Temperature display in Celsius or Fahrenheit.
- Daily minimum and maximum temperature and moisture recording.
- Logging of date, time, and duration of the last six waterings.
*Season is determined based on day length. This works well in most regions, but may be less accurate near the equator or the poles.
User's Manual
A PDF of the user’s manual is available from here.
Download Firmware
Source code: https://github.com/Picapot/picapot-controller-328
A precompiled .hex file is available in the repository for direct upload to the microcontroller, without compiling the source code. If you just want to get started quickly, use the precompiled firmware.
Compile from Source (optional)
The code has been developed using the Arduino IDE and should be compiled using the GyverCore board package. You can add this board to the Arduino IDE by adding the following line to Settings → Additional Boards Manager URLs:
https://alexgyver.github.io/package_GyverCore_index.json
GyverCore board settings
- B.O.D.: "2.7V [Default]"
- Bootloader: "Without bootloader [Warning!]"
- Clock: "External 16 MHz"
- Clock out: "Disable [Default]"
- Compiler version: "AVR-GCC v5.4 or 7.3 [Default]"
- Save EEPROM: "Enable"
- Initialization: "Enable [Default]"
- Serial: "Default Serial"
- System timer: "Enable [Default]"
Upload to the Controller
The compiled .hex file can be uploaded to the microcontroller via port P1 using an AVR programmer and the avrdude command-line tool.
The first command sets the correct fuses:
avrdude -c avrispmkii -p atmega328p -b 300 -B 100 -e -u -v -s -U lfuse:w:0xEF:m -U hfuse:w:0xC7:m -U efuse:w:0xFD:m
The second command uploads the program to flash memory:
avrdude -c avrispmkii -p atmega328p -b 57600 -B 1 -V -u -v -s -U flash:w:Sunfy328.ino.hex:i
The programmer used in the commands above is the AVR ISP MKII (avrispmkii). If you are using a different programmer, update the programmer ID in the commands accordingly. You can find your programmer ID here.
First Run
During the first execution of the firmware, the controller scans the 1-Wire network to detect the internal DS18B20 temperature sensor and stores its address in EEPROM. It is important that no external sensors are connected at this stage; otherwise, the controller will not be able to distinguish between the internal and external sensors.