The network topology will look something like this, where any user can read the Temperature, %RH and UV Index data anonymously. The data can also be collected and stored in the cloud using a BLE gateway and made available as an open data set.

1.1 The Energy Harvesting S6AE101A PMIC

According to the website and datasheet, the S6AE101A is a Power Management IC (PMIC) for energy harvesting that has a consumption current of only 250 nA and startup power of only 1.2 μW. The S6AE101A PMIC will store power generated by solar cells to an output capacitor using built-in switch control, and it will turn on a power switching circuit while the capacitor voltage is within a preset maximum and minimum range for supplying energy to a load.

The S6AE101A also provides other “smarts” allowing for a hybrid Energy Harvesting System that allows you to combine a solar cell Energy Harvesting Device along with a coin cell battery, and/or an optional vibration (piezoelectric) EHD with an external diode bridge. With a hybrid scenario, if the power generated from solar cells is not enough, energy can then be supplied, in the same way as solar cells, from a connected battery or batteries for auxiliary power (note that there is no battery charging capability via the PMIC from the solar cell, as you often see with other MPPT solar charge controllers).

Then there is also, an over voltage protection (OVP) function built into the input pins of the solar cells, and the open voltage of solar cells is used by this IC to prevent an over-voltage state. The OVP voltage is set using upper (VOVPH = 5.4V) and lower (VOVPL = 5.3V) bands. Then, when VDD voltage reaches the OVP detection voltage (VOVPH) or higher, the OVP current (IOVP) from the VDD pin is drawn in, limiting the increase in the VDD pin voltage, thus preventing damage to the IC. When the OVP release voltage (VOVPL) or less is reached, the drawing-in of the OVP current is stopped.

This PMIC uses a power gating function (SW1), a power storage switch (SW2) and a solar cell/battery changeover switch (SW4) for the external load. It integrates 5-kΩ switches (SW2 and SW4) to limit input currents, which then optimises the IC to acquire the microampere (µA) of current output from the solar cell. Then once the VSTORE1 pin voltage has reached the VOUT maximum voltage (VVOUTH), the VSTORE1 pin and VOUT pin are connected by an internal switch until the VOUT minimum voltage (VVOUTL) is reached. Then when the internal SW1 switch disconnects the VSTORE1 and VOUT1 path, the discharge circuit is activated between the VOUT1 pin and GND. The power of the VOUT1 pin is then discharged to the GND level. Switches SW7 and SW9 are used to charge a capacitor (CVINT) that drives the internal circuit.

An interesting aspect of the IC is the setting of output voltage (VOUT1). The output voltage is determined by the value of the resistor connecting the SET_VOUTH pin and SET_VOUTL pin.

According to the datasheet, this is because the VOUT maximum voltage (VVOUTH) and VOUT minimum voltage (VVOUTL) are set based on the connected resistance. The SET_VOUTFB pin outputs a reference voltage for setting the VOUT maximum voltage and VOUT minimum voltage. Resistor voltage division can be performed on this reference voltage outside the IC for creating a voltage applied to the SET_VOUTH pin and SET_VOUTL pin.

So, for example, if we set R1, R2 & R3 to 6.8 MΩ, 2.7 MΩ and 9.1 MΩ, respectively we get a VOUT maximum voltage (VVOUTH) ≈ 3.3V and a VOUT minimum voltage (VVOUTL) ≈ 2.6V.

If we look at the schematic for the SPID kit, we see that the resistor values used for R1, R2 and R3 are 6.8 MΩ, 4.7 MΩ and 6.8 MΩ, respectively. In this case, the calculation gives us VVOUTH ≈ 3.3V and VVOUTL ≈ 1.9V

1.2 The Sensors

For this project, I am using the on-board Si7020 sensor for temperature and humidity measurements and have added a Si1145 sensor to capture UV measurement in order to calculate the UV index. Both these sensors are I2C slave devices, allowing me to communicate with both these sensors via the I2C bus. The derived temperature, %RH and UV index values will be broadcast publicly via the CYBLE-022001 module using the Eddystone beacon messaging format.

(Si7020-A10) Temperature and Humidity sensor

According to the Silicon Labs product datasheet, the Si7020-A10 I2C Humidity and Temperature Sensor is a monolithic CMOS IC integrating humidity and temperature sensor elements, an analog-to-digital converter, signal processing, calibration data, and an I2C Interface.

{gallery:autoplay=false} Si7020-A10

source: Silicon Labs datasheet for Si7020-A10

source: EH Motherboard Schematic (Cypress)

The main features, as per the datasheet, are noted as:

Precision Relative Humidity Sensor ± 4% RH (max), 0–80% RH

High Accuracy Temperature Sensor ±0.4 °C (max), –10 to 85 °C

0 to 100% RH operating range

Up to –40 to +125 °C operating range

Wide operating voltage (1.9 to 3.6 V)

Low Power Consumption: 150 μA active current and 60 nA standby current

2.0 Converting the PsoC 4 BLE Eddystone Example

I wanted to see how well the CYBLE module would work, while using solar energy harvesting, when running the available PSoC 4 BLE Eddystone example without modifying any of the BLE advertising intervals. So, to get started, all I had to do was port this ready-made code example on PSoC Creator across to my CYBLE device by making a few changes.

Let's take a quick look at what I did.

The TopDesign page for the PsoC4 BLE on PsoC Creator looked like this:

There were a couple of resource constraints this design. Firstly, the Cypress SPID only has one LED on the board. This is fine for our purposes, as we cannot use LED's when the board is powered just through the solar panel + storage capacitor.

The other constraint, which is a bit of an oversight, in my opinion, is that there is no access to the Vref pin on the CYBLE module, so we cannot measure battery or input voltage.

The pin assignment on the PsoC 4 BLE board is as follows:

As such, the TopDesign page for my SPID CYBLE module on PsoC Creator looks like this:

For the sake of simplicity, I kept the ADC Interface the same and hence Vref is an unconnected GPIO, where I have assigned the input pin with a pulldown resistor. I found that within the code I can also disable this measurement so that it is never used.

I added in a Bootloadable component, with its dependencies linked to the existing Bootloader project for the SPID CYBLE module.

I also added in another input pin (ref USB_DETECT) which is assigned to P3_5, which is unique to the board as it is linked to USB power via pullup and pulldown resistors.

The one and only LED is used to show BLE connection status and is only available if the USB_DETECT pin is high.

The pin layout for the CYBLE module is as follows (note we have much fewer pins available to us for use):

{gallery:autoplay=false} Pin Layout

2.1 Eddystone Firmware for CYBLE module

The firmware is almost identical to the existing PSoC4 BLE Eddystone example. You will notice that with this example, we have a "main.h" file. Ok, nothing unusual about this, but the point of interest for our purposes is the following:

As you can you see we have a means of enabling or disabling the Temperature and Battery measurement functions. As we are not able to measure battery voltage, I set this to "NO" which then removes portions of the code through a precompiler directive.

Here you see that all the initialisation functionality has been bundled into a function called "Initialization()". This function is very well documented explaining how the WCO and ECO clocks are configured to set up low power operation.

As you may notice in the code, there are only a couple of BLE stack events that we worry about, namely:

CYBLE_EVT_STACK_ON: this event is triggered when the BLE component is Started

CYBLE_EVT_GAPP_ADVERTISEMENT_START_STOP: this event is triggered when BLE advertisements are stopped or started. When started we configure the advertising packet - there is a specific function that deals with this (ConfigureAdvPacket), which handles the URL/UID/TLM messaging formats. Within the code that deals with this event trigger we also check if USB_DETECT is high (i.e. USB powered). When Advertising is stopped we increment the advertising packet count.

CYBLE_EVT_GAP_DEVICE_DISCONNECTED: this event is triggered when upon BLE disconnect (only applies when USB powered)

CYBLE_EVT_GATTS_WRITE_REQ: this event is triggered if any data is written to the device from a connected mobile app, for example (when device is USB powered)

Then once that function has completed we then indefinitely loop through 4 function calls and a check to see if we need to start advertising again (this occurs when we have connected and then disconnected to the BLE module for runtime config purposes). The 4 function calls are:

CyBle_ProcessEvents() - this is a standard BLE function

IncrementAdvPacketCount() - this is a custom function This function keeps track of adv packets based on BLESS states.

UpdateTLMAdvPacket() - this is a custom function. If device is advertising TLM packets then will update the TLM packets with temperature, time since power on, number of packets that are advertised, etc.

LowPower() - this is a custom function. It puts the CPU and BLESS into low power mode

The code referred to here and used in this demo is provided as an attachment: EdwardSolarStone-000.cywrk.Archive01.zip

2.2 Demo 1: Eddystone URL/TLM beacon messaging without sensor data

This demo was done indoors under normal office lighting (lux value yet to be measured).