1.Introduction
This project is primarily focused on environmental monitoring, specifically temperature and humidity. It involves the use of Lifely Agrumino sensors to collect data from the surroundings.
The collected data is then processed and displayed on an E-Paper display.
This can be valuable for a wide range of applications where environmental data is essential, such as home-automation.
How does it work?The project involves the following key components and steps:
- Sensor Data Collection: Lifely Agrumino sensors are used to measure temperature and humidity in the environment. These sensors are connected to a microcontroller, an Arduino board, which reads the data from the sensors.
- Display Interface: An E-Paper display is employed to visualize the collected data. To interface with the display, an I2C module is used as an interface for communications. The Wire.h library facilitates communication through the I2C standard.
- Customized Library: The E-Paper display typically comes with a basic library called EPD_1in9. However, to make it compatible with the Lifely Agrumino sensors, some modifications are required. This includes changes to functions like GPIOInit, EPD_1in9_ReadBusy, and EPD_1in9_Reset.
- Application Code: The application code is responsible for orchestrating the entire process. During the setup phase, it establishes serial communication with the Agrumino board, initializes the I2C communication with the E-Paper display, and reads temperature and humidity values.
- Data Manipulation: The temperature and humidity readings are both displayed on the serial monitor and manipulated. These values are often stored in arrays for further processing.
- Display Output: The manipulated data is then formatted for display on the E-Paper screen. Typically, E-Paper displays are divided into segments, and the data is mapped to these segments.
- Power Management: To conserve power and extend battery life, the project incorporates a deep sleep mode. The duration of deep sleep is configurable through the SLEEP_TIME_SEC constant.
2.Hardware
The E-Paper display is connected to a module that serves as an interface for I2C communication.
Agrumino I2C port GND, VOUT, SDA, SCL pins are connected to the relative pins on the display module.
Agrumino GPIO ports 1 and 2 are used to control BUSY and RESET signals.
3.Software setup
3.1Displaylibrary
The E-Paper display is connected to a module that serves as an interface for I2C communication. The Wire.h library facilitates communication via the I2C standard. Additionally, the display comes with a simple public library called EPD_1in9 for communication management. However, this library was not originally designed for use with Agrumino, so we had to make some modifications to the original library. These modifications included changes to control functions such as GPIOInit, EPD_1in9_ReadBusy, and EPD_1in9_Reset.
3.2Application Code
The code for this project is straightforward and follows the basic example provided by the manufacturer, with some modifications. In the setup section, we establish serial communication with the Agrumino board, power it on, and initialize communication with the E-Paper display.
Next, we read temperature and humidity values, which are both transmitted to the serial monitor and processed before being placed into arrays named temperature_digits and humidity_digits. These arrays are then inserted into another array that corresponds to the 13 segments of the E-Paper display.
Finally, the array containing the values of the various display segments is transmitted to the E-Paper display. After this, the board enters a deep sleep mode to reduce power consumption and extend the battery life. The duration of the deep sleep can be set in seconds using the SLEEP_TIME_SEC constant, which is then multiplied by 1000000 because the function requires a value in microseconds.
Comments
Please log in or sign up to comment.