Skip to content

Hardware

ChuckNorrison edited this page Oct 9, 2024 · 1 revision

Hardware description

  • The Hydrosys4 uses the Raspberry pi board (PI 4/3 or zero W), several types of hardware can be connected to the Raspberry as listed in the next chapters below.
  • No display, PC or Smartphone can be used to access the System web interface using WiFi or Ethernet. The web server is directly hosted in the raspberry itself, so no external servers are involved.
  • The System can work with or without network connection, in the latter case the system will generate its local WiFi network. For the setup without network connection it is suggested to add a hardware Clock to keep the time in case of power outages.
  • Several sensors as Temperature, humidity, Light, hygrometers, flow etc… can be connected to the system. These sensors might not be needed for the simple irrigation purposes but can be used to enable the automation features.
  • The system supports the MQTT protocol, which can be used to connect remote sensors or actuators connected to the wifi network, using for example the ESP8266 chipset. (More info in the “getting started” page)
  • Electrical Relays can be used to connect the actuators. Several types of actuators can be used as valves, pumps, motors etc. The relays can normally support a wide range of voltages (5v to 220v)
  • The system supports output port expansions which can increase the output ports to over 100.

Minimal hardware Setting

To test the system the only require hardware is the raspberry PI.

With this minimal hardware configuration you can have a look at the interface and evaluate the Software. This step would be useful to understand the configuration methods, the interface and most importantly to decide if the system fits your project requirements before proceeding with next steps.

Irrigation/Automation Hat board

Due to the flexibility of the system to connect different hardware, I created several boards (hat boards because they stay on top of the Raspberry pi) that can be used to conveniently connects the relay boards and the sensors using dedicated connectors and labels. The boards are not strictly required to implement the system but are a great way to avoid all that number of jumper wires and all the associated potential connection mistakes (if you are a maker, I think you know what I’m talking about).

image

The SuperHat board is designed to accommodate bigger projects:

image

The expansion board is used to add more relays to the system:

image

The Soil Moisture sensor can be directly connected to the Raspberry to monitor the Soil humidity:

image

For details you can visit my shop:

https://www.tindie.com/stores/angelova/

Supported Relay types

Both Boards are compatible with 5v DC relays that have the connector pins arranged according to the below indications.

Picture below shows an example of the connectors on the back of the board. It is important that the relays board pins have the GND and VCC in the position described in pictures below. Relay should be 5v DC compatible:

image

List of the supported Sensors:

Below the list of sensors that can be directly connected to the Raspberry GPIO and are supported by the Software.

  • AM2302 (hosting the DHT22 sensor) -> Air Temperature, Air humidity
  • DS18B20 -> Temperature
  • DS3231 -> clock
  • BH1750 -> light
  • BMP180 -> Atmospheric pressure, Air temperature
  • BME/BMP280 -> Air Temperature, Air humidity, Atmospheric pressure
  • Digital Soil Moisture Sensor -> Soil moisture (I sell it in my shop on tindie)
  • HX711 -> weight sensor

Sensors with Analog output (0-5v) can be connected using the Analog to digital converter chip MCP3008 or the Automation HAT board.

  • Sensors with analog output
  • The Capacitive soil moisture sensor v1.2 (not the ver 2.0 which does not work).

Cameras:

  • Most of the USB cameras will work with the system
  • Raspberry camera

Remote Sensors:

Wifi Sensors connected using MQTT (ESP8266 + Tasmota SW), you can check the tasmota page for the supported sensors.

Humidity and temperature sensors (AM2302)

The Hydrosys4 SW is designed to be compatible with the AM2302 board which embed the DHT22 sensor, it provides Air temperature and Humidity readings. Below the connection schema:

image

I2C sensors – Temperature,Humidity,Atmospheric pressure and light

The I2C sensors use the I2C interface to connect to the Raspberry Pi.

I2C Sensors supported by the system:

BH1750 -> light
BMP180 -> Atmospheric pressure, Air temperature
BME/BMP280 -> Air Temperature, Air humidity, Atmospheric pressure

The I2C interface has a common bus made by two wires (SDA,SCL), the I2C devices can be connected in parallel with other i2C devices. Below the connection schema with the raspberry, the schema does not show the VCC and GND which should be connected to 5V power supply.

Each I2C device has an I2C address which ranges from 0x00 to 0xFF. In the same bus, all the address should be unique. In some devices the address can be changed by pin selection.

image

Below a view of the connectors on a I2C device.

image

Here a link for the SW configuration of the I2C sensors:

https://hydrosysblog.wordpress.com/2020/12/25/configuration-of-the-i2c-sensors/

DS18B20 temperature sensor

Recently the support for this type of thermometer has been added to the system (ver 1.11d).

The sensor uses the one wire protocol, it has 3 wires that can be connected as follow:

  • Red -> 5v or 3.3v
  • Black -> Ground
  • Data wire (usually white or yellow) -> one of the GPIO pins not involved in I2C or DMI

The GPIO where the data wire will be connected can be set by software. As from the specifications, the data wire should be connected to a resistor (4.7K ohm) in pull-up configuration. Anyway this is not necessary (at least for a single thermometer usage) as the Raspberry GPIO can be set to use internal pull-up configuration.

IMPORTANT: The selected GPIO pin should not be used in other rows of the hardware setting table otherwise there will be conflicts.

Multiple thermometers can be connected in parallel to the same PIN, each DS18B20 has its own address that can be used to discriminate the devices. The Hydrosys4 Software will provide the list of addresses of the attached devices. In case the address is not specified, the SW will read the first device in the list.

image

CONFIGURATION:

Go to HardwareSetting page and click “edit table”, then in the first row set the parameters as follow:

image

after fill-in the form then click “add” button and then the button “confirm and close” to apply the changes and close the editing page.

Now you should be able to search the row by typing DS18B20 in the search box:

image

Now you can go to “setting” page and test the sensor:

image

in case you want to check the address of the connected device, in “setting” page you can click the button “show addresses”, you will get this page with I2C addresses and One wire addresses:

image

In case of multiple DS18B20 connected to the same GPIO pin, you can use the address field to identify them.

External Hardware Clock

As the Raspberry PI does not have a battery protected clock, its clock is reset every time the power is OFF. In case it is connected to internet this is not a problem as it synchronizes automatically with the network (using NTP protocol). If this is not the case, an Hardware clock with battery will be very useful. It is possible to use the Real time Clock RTC based on the DS3231 chipset is inexpensive (less than 3 eur) and is sold together with battery.

image

Lately I also tested the real time clock as in the picture below, it uses a super capacitor to keep the clock during power outages.

image

image

Relays

Relays are used as switches for the actuators. The compatible relays should work at 5V and should have imputs isolated by optocouplers. In this way they can be directly connected with RPI GPIO pins. These types of relays are very common (as in picture below) the optocoupler is highlighted in the picture by a red circle. The 8 relays board can be found for less than 10 eur. If 8 relays are not necessary, then also board of 4 relays are available. Up to 2 boards with 8 relays each can be connected to the system.

image

It is recommended for the actuators to work at low voltage e.g 12V/24V DC.

image

GPIO Expansion for Output

The Hydrosys4 software now supports GPIO expansion for outputs using the MCP23017 chip. (since version 3.26b).

The chip is connected using the I2C interface. Each chip can provide up to 16 additional GPIO PINs.

Multiple Chip can be connected to the system setting different I2C addresses (A0,A1,A2).

image

WebCam

The system is able to take pictures and stream video, both with Rasicam of standard usb webcam, You can insert as much webcam as the USB available.

image

Raspberry Camera is also supported

image

Atmospheric pressure and light sensors

If you are interested in monitoring the barometric pressure and the light intensity, it is possible to include two sensors that are supported by the hydrosys4 SW: the BH1750 for light and the BMP180 for the pressure. Both of them have the I2C interface and can be connected in parallel with other i2C devices. The below schema do not show the VCC and GND which should be connected to 5V supply.

image

Analog inputs (0-5v)

The Software is compatible with the Analog digital converter MCP3008. This additional chip is required as the raspberry does not have analog inputs natively. The Chip provides up to 8 analog inputs (0-5v) which are the pins from CH0 to CH7.

Below the connection schema:

image

Hygrometer Sensor

Capacitive Digital

This is a sensor I developed myself which have a digital interface that can be directly connected to the Raspberry PI. It features voltage stabilizer and temperature compensation to provide excellent stability. Furthermore, the digital communication with the Raspberry can be made over several meters of wire (6m) which many other sensors of this type cannot achieve because they use the I2C protocol (up to 1m).

The sensor is also compatible with Tasmota software, together with the ESP board can become a WiFi sensor.

The sensor can be found here:

https://www.tindie.com/products/angelova/digital-soil-moisture-sensor-for-raspberry-pi/

image

Capacitive analog

With the analog inputs it is possible to connect several types of analog sensors, for example the system can work with the capacitive soil moisture sensor as in the below picture, which is very inexpensive (but also easy to break). The analog output of this sensor can be directly connected to the CH inputs of the MCP3008.

image

Resistive

In case of resistive soil moisture sensor this is designed to measure the moisture of soil by applying tension to two plates in the soil and measuring the resistance.

For this purpose the Analog digital converter MCP3008 is required, some resistors should be used, and to reduce the corrosion of the plates in the soil a small circuit should be made to apply the tension only when the reading is made (e.i. every 15 minutes). Then the current is ON only few seconds before and after the measurement.

For the above described purpose the component MIC2026-1 is used, which is an high side switch. It also provided quite stable performances.

In the below schema, the MIC2026-1 controls 2 probes.

image

The PIN GPIO 07 and 25 are used to enable the tension over the plates. The tension is measured over the ADC channels.

##Stainless steel probes

I made very durable probes with stainless steel rods used to weld the stainless steel and a case 3D printed.

Below a picture of the probes:

image

Servo Motor connection

the system SW is able to manage one servo motor connected to the pin GPIO21 (pin40).

This servo can be used to move the camera in different angles.

image

Hydrosystem Power supply

The Raspberry PI require power supply of 5V DC and recommended 3A current. As in most of the project the actuators run at 12V DC, it is possible to use a power adapter to 12v DC for the actuators and a step down DC converter to reduce the voltage to 5V to supply power to the Raspberry.

image

Solenoid Valve

Below the 12v DC evectrovalve I have used in my setup. Cost no more than 6 eur each.

The valve should be of the type “Normally Closed” the voltage can be 12v or 24V depends on the power supply you are using. (latching valves are not supported)

image

Below an example of how to connect the valves to the relays:

image

In case you require to connect multiple valves It might be convenient to solder a wire to the common of the relay, in this way only one cable is required to be connected to the relay terminal screw. Below an example of how I soldered the wire on the back of the relay:

image

DC Motor connection

DC motors can be connected to the system to enable mechanical actuators, as for example greenhouse windows control.

The DC (Direct Current) motor can be connected to two relays in Hbridge setup, in this way the motor spin direction can be controlled by the Software. Below the schema of the Hbridge connection:

image

The above schema includes two End Switches that should be used to stop the motor when reaching the ends.

CONFIGURATION:

Go to HardwareSetting page and click “edit table”, then set the parameters as follow:

image

pin & pin2: should be the number of the GPIO pin which controls the two relays of the Hbridge.

controllercmd: should be set to hbridge

min & max: the min and max time in seconds that the motor will be activated starting from the zero point.

Offset: this value indicates the additional seconds that the DC motor will be activated to reach the MIN position. As the DC motor is not a stepper motor, usually when the motor is activated for N seconds in one direction and for N seconds in the other direction, it is not going to stop in the same position. For this reason an additional number of seconds can be set to be sure the motor reaches the start position where there should be the end switch which will stop the motor in the MIN position.

Stepper Motor Connection

The Stepper Motor shield that supports I2C is used to connect up to 2 stepper motors (around 5 Eur). Below the connection schema

image

Stepper motors are used to open and close windows according to temperature levels.

The stepper motor used is the Nema17 (Around 8 eur).

IMPORTANT: the above Driver is fix voltage driven this means that the voltage of the motor should match the voltage of the driver, so the motor should be compatible with above driver.

on the motor side two parameters are important to check:

  • Amps per phase – This is the maximum current that the motor windings can handle without overheating.
  • Resistance per phase – This is the resistance of each phase.

Assuming the power supply to the driver is 12 volts, it is possible to calculate the current in the motor that should not exceed the AMPS/PHASE.

Example if the AMPS/PHASE = 1 amp max

then considering 12v, the Resistance of the motor coils should be R=V/I = 12 ohm.

For more info you can chack this link

image

External inputs to the GPIO Pins

The GPIO pins can be used as binary inputs, the simplest Hardware implementation is to connect them using a push button:

image

These push buttons have one common connector, one normally open connector NO and another normally closed NC. The GPIO input can accept input voltage up to 3.3v.

Normally the common connector is connected to the GPIO, the NO to the 3.3v and the NC to the 10K resistor that on the other ends go to the ground.

Automatic Fertilizer dosing

To mix the water with fertilizer the water pipe pass through a sealed tank. The water pipe has smalls holes to mix the water with fertilizer. The fertilizer is moved to the sealed tank with mini pumps when the water irrigation valve is closed. The on time of the mini pump define the quantity of the fertilizer.

image

Below the implementation:

image