builder555 / balena-plant-ii

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Balena Plant II

disclaimer: this is not an upgraded version of the Balena Plant. This project is an example of an application that can be built using just a few blocks in an industrial setting. The plant-watering solution is just one of the possible applications.

Hardware required:

Deploying

Deploy with balena

If you don't already have have an account, follow the Getting Started Guide.

Intro

The purpose of this project is to build a prototype of a basic industrial control system. A good example application that demonstrates most of the components is a plant-watering device. The application consists of Blocks that use MQTT for communication. The system includes a sensor, a motor, an API, and a user input connected through logic blocks.

The moisture sensor takes soil readings and provides a "dry/wet" signal to the Pi. The application checks the forecast for the next 24 hours and based on the two inputs either sends the signal to start or stop the pump. The user also has the ability to override the signals from the sensor and the API and manually turn on the pump.

Software

The application logic:

Logic

Each component in the diagram is its own block. The AND and OR gates are simple python containers that take binary inputs and produce binary output. These blocks can be combined into digital circuits of arbitrary complexity. Other blocks can be added to increase inputs or outputs. The commands from the user/ui are sent using web sockets.

Assembly

Schematic:

Wiring

The optional potentiometer can be used to adjust the sensitivity of the moisture sensor. The capacitive sensor is rated to provide a 0-3V, with 3V being "dry" and 0V - "wet". In reality the output ranges from 0.25V to about 2.7V. The threshold voltage on the Pi GPIO is around 1.3V. The GPIO pins have internal pull-up resistors (around 50k) that can be enabled; if you use them, then you'll need to adjust the potentiometer to a lower value to trigger the "dry" status. If you use a pump that draws a lot of power, use a relay instead of a BJT.

The pump runs for 30s at a time, then cools down for 30s. More details about the cooldown values can be found in the basic-motor block.

The assembly looks something like this:

Photo1

Photo2

Photo3

Development

To deploy manually or debug the application, you'll need to have balena cli installed.

git clone https://github.com/builder555/balena-plant-2
cd balena-plant-2
balena push <your_device_id>.local

There is a more extensive write-up with some background on balena forum, if you're curious.


logo image by iconfield

About