EverGreen

Inspiration

The idea behind EverGreen came from Nick and Will’s mutual interest in smart agriculture. Will designed a smart greenhouse prototype for his ESE350 Final Project, and Nick has created many hydroponic and aquaponic agriculture systems. We believe the food scarcity is a rising problem, and solutions to make growing food easier are necessary.

Build

We created the board schematic and layout design in Altium Designer. The PCBA was manufactured at pcb.ng, based in Brooklyn, NY. They were a very cost effective and fast option and easy to use! The board is controlled using the SAMW25 chip that combines the ATSAMD21 Microcontroller and the ATWINC1500B Wi-Fi chip. The firmware was developed in C using Atmel Studio 7.

Components

Sensors

Soil Moisture Sensor (Analog) - Sparkfun Humidity and Temperature Sensor (I2C) - Texas Instruments Lux Sensor (I2C) - Silicon Labs

Actuators

12V Boost Converter - MicroChip DE1A Relays - Panasonic Memory 8MB Flash Memory - Adesto Technologies (SPI)

MCU + Wi-Fi

Atmel SAMW25

Power Management

The board can be powered by either micro USB or a LiPo battery. A battery charger charges the battery from the 5V USB source. The 5V source is brought down to 3.3V to power the board via a buck converter.

Memory Partition

Memory is divided up between the on chip sram memory and the off chip flash memory component. The off chip memory has 8MB of space, while the SOC SRAM has 256KB. The on chip has a dedicated bootloader in memory from 0x000 - 0x3FC0 (16KB). Application memory is 0x3C000 bytes (~240KB). Additionally, firmware information is stored in a small struct at memory location 0x3FC0 containing flags for new firmware installs and version information. The off chip memory has dedicated space for two firmware images, one for the current or the image to be installed and one for a golden safe image, the CLI. Additionally, firmware headers are stored to keep track of checksums to verify integrity, size of the image, and firmware version.

Bootloader Implementation

The bootloader is triggered on the following conditions: No application detected in memory Hardware button held down on boot A new image is detected to be installed The bootloader will allow the user to switch between the current firmware image (in the off chip flash memory) or the safe mode CLI image. On flashing image applications, the bootloader will flash the new image and verify its memory contents using a crc32 checksum. On success, it will then boot into the new application.

OTAFU

The over the air firmware update is used to download new images for the device. OTAFU can be invoked using either the cloud node-red interface or by calling a function in the cli mode. The device will first check to see if a new version is indeed available, and if available will attempt to download the new image. It will verify the contents three times - first when downloading the actual image, second when verifying the content in flash, and third when it checks against a precomputed checksum that is given with the metadata file for the image. This metadata file is generated by a python script. After download, the device will flash the new image on the next power-cycle.

Cloud

Our cloud system uses MQTT to communicate to a Node-Red dashboard hosted by IBM-BlueMix. The dashboard displays firmware version, a button to grab firmware updates. It also shows board status, to demonstrate what boards are online. There are gauges to show the current sensor readings, and switches to activate the relays and LED. There is also a button to run the watering device.

Hardware Challenges:

Our boost converter was misconfigured and upon activating we accidentally output 52V! This fried our shottky diode, and most likely other parts of that board. Learning to do surgery on a small PCB board was challenging but a lot of fun. Soldering, cutting traces and moving/removing very small components was an adventure in itself.

Software Challenges:

Silly bugs with CRC32.

Demo Video

The demo video showcases our Node-Red dashboard, showing our sensor gauges and actuator switches/buttons. The first portion of the video shows a reading using the soil moisture sensor, the second portion shows actuators being activated from the dashboard. The final piece of the video shows a full OTAFU.

Built With

Share this project:
×

Updates