Gabriel Alejandro Giraldo Santiago
Created January 28, 2020 © GPL3+

Agricultural crop monitoring system with AdaCore

Design and build a system of monitoring and automation of agricultural crops and in the same way study the agroclimatic variables.

IntermediateProtipOver 1 day27

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
DHT11 Temperature & Humidity Sensor (3 pins)
DHT11 Temperature & Humidity Sensor (3 pins)
×1
Grove - Water Sensor
Seeed Grove - Water Sensor
×1
Grove - Air quality sensor v1.3
Seeed Grove - Air quality sensor v1.3
×1
Helium Starter Kit (LEGACY)
Helium Starter Kit (LEGACY)
Second phase of the project
×1

Software apps and online services

GNAT Community
AdaCore GNAT Community

Story

Read more

Schematics

Prototype

First design of system of monitoring crops

Code

I2C Interfaces

ADA
with Interfaces;

generic
   with procedure Pull_SDA_Down;
   with procedure Release_SDA_Up;
   with procedure Pull_SCL_Down;
   with procedure Release_SCL_Up;
   with procedure Delay_T_HD_STA; -- 4.0
   with procedure Delay_T_SU_STO; -- 4.0
   with procedure Delay_T_Buf; -- 4.7..5
   with procedure Delay_T_Low_Half; -- 2.4
   with procedure Delay_T_High; -- 5
   with function SDA_State return Boolean;
package Soft_I2C is

   type Byte_Array is
     array (Interfaces.Unsigned_8 range <>) of Interfaces.Unsigned_8;

   type Error_Status is
     (SOFT_I2C_OK,
      SOFT_I2C_NACK,
      SOFT_I2C_FAILED);

   procedure Start;
   procedure Stop;
   procedure Write_Byte (Byte : Interfaces.Unsigned_8;
                         Status : out Error_Status);
   procedure Read_Byte (Byte : out Interfaces.Unsigned_8; Ack : Boolean);

   procedure Write (Address : Interfaces.Unsigned_8; Bytes : Byte_Array;
                    Status  : out Error_Status);

   procedure Read (Address : Interfaces.Unsigned_8; Bytes : in out Byte_Array);
end Soft_I2C;

Make File

ADA
test_i2c.elf: soft_i2c.adb uno_i2c.adb soft_i2c.ads
	avr-gnatmake -p -XBOARD=arduino_uno -P i2c

test_i2c.hex: test_i2c.elf
	avr-objcopy -Obinary -R .eeprom test_i2c.elf test_i2c.hex

clean:
	avr-gnatclean -XBOARD=arduino_uno -P i2c

.PHONY: clean

Credits

Gabriel Alejandro Giraldo Santiago

Gabriel Alejandro Giraldo Santiago

10 projects • 54 followers
I am a young boy with ideal to achieve everything that I propose. Lover of Science, Technology and innovation.
Thanks to Tero Koskinen.

Comments