Skip to content

Getting Started

Eli Carlin-Coleman edited this page Feb 4, 2021 · 12 revisions

Welcome to the Firmware Team!

  1. What we do

  2. Project

2.1. Overview

2.2. Hardware we use

2.3. Software we use

  1. Step-by-step guide to running the codebase for the first time

  2. Workflow

  3. Extra readings and references

1. What we do

We are the firmware subteam, part of the UBC Sustaingineering Electrical Team. If you are new to Sustaingineering, check out the Welcome Package.

The firmware team is working on the Enicalsa Solar Pumps project, trying to collect data on the operation of solar-powered water pumps to monitor their function and allow engineers to detect and fix issues rapidly.

An example of a solar-powered water pump that Benito is responsible for

We are using microcontrollers to read data from sensors and relay the information back to a server, where the data is uploaded to the internet. This document will help you understand the software and hardware we use to do this, and put you on your way to contributing to this project.

2. Project

2.1. Overview

High-level network diagram for the Firmware team

Above is a high-level network diagram of the information flow. The solar panels are installed by Benito, and are external to our system. They are the source of our data, but their operation is outside of the scope of this project. A microcontroller will collect data from the solar panels, using the sensor suite developed by our team. Typically this will be the cheaper ESP32, which communicate with each other via LoRa, but there must be at least one Particle board per network. The particle acts as the gateway between the ESP32 network, and the outside world. It sends data between the farm network and the internet server via a telephone network. Once data is transmitted to the server, it is published to the internet and can be accessed from anywhere. This dataflow is bidirectional, and data may be sent to the ESP32s and Particles, such as for firmware updates.

2.2. Hardware we use

2.2.1 ESP32

The ESP32 is a microcontroller which is used to read sensor data, store it to an SD card, and relay the data via LoRa to the Particle. There will typically be one ESP32 per pump. The ESP32 is small, low power, inexpensive, and compatible with the Arduino environment, making it convenient to use. More information, including the datasheet, can be found on Notion in the page ESP32 Docs.

2.2.2. Particle

Particle is a company that produces microcontrollers with integrated telecommunications hardware, and a subscription to a data service. We use both the Electron and the Boron boards (the Electron is discontinued). The board may collect data from a sensor suite, similar to the ESP32s, but the primary function is to connect the network on the farm to the internet server. There will be one Particle on the farm, which will communicate over LoRa with the ESP32 network. It will also communicate with a second Particle over the telephone network (known as 'GSM', although we do not use GSM technology). The second Particle will be connected to a web server, so that the data can be published to the internet. More information on the Particle boards can be seen on Notion at Particle Evaluation

2.2.3. LoRa

LoRa (Long Range) radio is a network architecture that allows for communication over several kilometers without relying on external structures (like telephone towers or satellites). We use breakout boards such as the RFM95W for our LoRa radios. This makes it easier to connect to the microcontroller with through-hole pins for testing purposes. We use the RadioHead library to drive the LoRa on both the Particle and the ESP32

2.2.4. Sensor Suite/PCB

The microcontrollers read data from a sensor suite, which will eventually be embedded in a PCB. The data includes things such as the temperature, water flow, voltage output from the solar panel, and so on. This data is converted to digital values by the microcontroller, and passed along the network. There is another team within the Electrical Team working on the PCB. From the perspective of the Firmware Team, the PCB is a blackbox.

2.2.5. Solar Panels and Pumps

The solar panels and pumps are installed, maintained, and operated by Enicalsa. Our job is to measure information about these stations, and Sustaingineering has a replica station set up at the UBC Farm, but beyond this test station the operation of the solar panel and pumps are outside of the scope of our project.

2.2.6. Internet Server

The internet server receives data from the Particle, and uploads it to the web. The Software Team built a web app which can process and analyze this data, and display it on a website accessible from anywhere. The Firmware Team must make sure that the data is encoded correctly by the Particle so that it can be interpreted correctly by the server, but beyond this point the server is a blackbox

Clone this wiki locally