When outside, especially in the summer, the Ultraviolet Index (UVI) and the Heat Index are important values to keep in mind. UVI is a wavelength weighted value that indicates your exposure risk to Ultraviolet Light, while “Heat Index is a measure of how hot it really feels when relative humidity is factored in with the actual air temperature” (Source: National Weather Service (NWS); Public domain information).
WarningThis demo is for educational use only. The values generated by this demo are rough estimates of the current conditions. Users should always rely on up-to-date weather information from a trusted source, who have much more sophisticated equipment setups for monitoring and reporting.
For more information about the hazards of UV light and Heat Index, please see weather.gov or other high quality source.
RequirementsThis demo uses 3 sensors: a UVI sensor, a humidity sensor, and a temperature sensor. In addition, this board is 100% solar powered. The microcontroller communicates with (or measures) the sensors while also regulating the power on the board with a very simple boost converter. In addition, the microcontroller will display the current UV Index or Heat Index on an LED bar graph display.
To implement UVI measurements, we found a cost-effective sensor, LTR-390UV, that performs the light conversion and measurement in a single chip with an I2C interface. However, the unassembled sensor is hard to find within the United States. The easiest way to use this sensor is to buy the Adafruit LTR390 UV board (Product ID: 4831), which we used for early prototyping. But to assemble our custom Printed Circuit Boards (PCBs), we ordered the bare sensors from LCSC.
The datasheet for the LTR390-UV claims the sensor is either 20% accurate or ±1 UVI (depending on the intensity). We found that claim to be mostly true by comparing it to a commercial UVI meter, but we could not get the data provided for UVI to match the values recorded by the meter. However, when we divided the results by 2, the data lined up with the expected values. We’re not sure why there is a discrepancy between the data provided and the measurements.
The Humidity SensorOne important factor we considered during sensor selection was to find a sensor that was resistant to direct water/dust exposure and could operate on the regulated 3.3V rail. We ended up using the HTU21D(F) sensor with an I2C interface and an option for a PTFE (polytetrafluoroethylene) filter for water and dust protection. This sensor is also available from Adafruit on a breakout module (Product ID: 1899) (although we never used the breakout during development).
The Temperature SensorWhile there is an internal temperature sensor in the humidity sensor, we wanted to keep a discrete temperature sensor on the board. So, we used an MCP9700A analog temperature sensor. The nice thing about this analog sensor is that it consumes so little power that we can power it ON/OFF with just the I/O pin.
The MicrocontrollerFor the microcontroller, we used an AVR32DB32 microcontroller. This is a small 32-pin microcontroller from the AVR® DB family. The reason we chose the AVR DB family was that it was the first family of microcontrollers to have a feature called Multi-Voltage I/O (MVIO) [level-shifting I/O] built in. MVIO allows one port of the microcontroller to run at a different operating voltage than the rest of the microcontroller. This port is level-shifted from the rest of the microcontroller and can operate at higher or lower voltages than the core. We used MVIO to interface with our digital sensors, which run on a regulated 3.3V supply, while the microcontroller runs on a loosely regulated 5V supply from a simple boost converter.
Solar PowerWhen we started developing this project, we quickly realized that this board should be self-powered from the sun. It’s unlikely a user would power the board up indoors, so we avoided adding a rechargeable battery due to the extra complexity and safety risks. Since our use case is outside in summer, the board can be expected to run hot and in conditions ideal for short circuits (water and sand).
To power the board, we want to generate +5V for the microcontroller and +3.3V for the sensors. Due to changing sun conditions, plus the physical characteristics of the solar panel, we can’t use the panel directly to power the entire system. Instead, a simple boost converter is implemented with the microcontroller to generate the +5V rail. One disadvantage of this approach is that to startup, we need a minimum of 1.8V for the microcontroller.
What is a Boost Converter?Boost converters are a type of DC-DC converter that converts a lower voltage into a higher voltage using the magnetic field.
In this diagram, we have an inductor L1, two capacitors (C1 and C2), a switching transistor (Q1), and a Schottky* diode (D1). When power is applied, no current flows through L1 since the transistor is turned off. Inductors store energy in the magnetic field, which is related to the change in current flowing through them:
In this scenario, there was no current flowing, and there is still no current flowing (di/dt = 0), so the voltage across the inductor is 0V.
Now, let’s switch the transistor ON.
Current begins to flow through the inductor and transistor to ground. In the process, the inductor begins to build up voltage as the magnetic field is created. If we left the transistor on forever, the voltage on the inductor would eventually fall to 0, as the current would become effectively constant. Instead, if we turn off the transistor before steady-state is reached, the inductor voltage spikes to oppose the change in current flow (di/dt < 0). When the inductor voltage rises above the voltage of the output plus the forward voltage of the diode*, the energy from the inductor discharges passes to the output. To smooth the output voltage, an output capacitor stores energy from the converter. A resistor divider network is used as feedback to determine when to run the converter.
*Schottky diodes have lower forward voltages and faster response times than normal diodes, which improves converter efficiency.
Boost Converter from a MicrocontrollerIn this implementation, the solar panel first charges the input capacitor C1 and the output capacitor C2. C1 stores energy from the solar panel and provides a low-impedance source of charge for the inductor. C2 charges through the inductor and Schottky diode as the transistor is turned off. When capacitor C2 reaches 1.8V, the microcontroller will startup.
Timer/Counter D (TCD) is used to generate the 100 kHz timing signal for the Boost converter, while the analog comparator (CMP) and internal DAC reference (DACREF) generate a signal to cutoff the TCD when the power supply is at the target voltage. The Configurable Custom Logic (CCL) does not have an output on the correct I/O pin, so the Event System (EVSYS) is used to redirect the output to the appropriate I/O.
The output from the microcontroller I/O is used to drive the switching transistor directly. In this case, direct drive of the MOSFET is acceptable, since the transistor does not have a lot of gate charge, operates on logic levels, and the efficiency loss from a slower switching time is minor. But it is important to note, bigger MOSFETs should be driven with a dedicated gate driver.
Selecting a Solar Panel and CapacitorsDue to the Boost topology, this board has no ability to regulate higher voltage to lower (also known as Buck regulation). It is critical that the Solar Panel input never exceeds the absolute maximum ratings of this device, or it may cause damage to the microcontroller or the bulk capacitors.
This board uses Tantalum capacitors for energy storage. The rational for Tantalum is simple: density and heat. Electrolytic capacitors are large and don’t handle heat well in the long-term. Tantalum capacitors are generally physically smaller capacitors that also handle heat much better. On the flip side, they can be damaged catastrophically (with spectacular results in some cases). It is critical to derate these capacitors appropriately for the environment and worst-case applied voltage.
To display the current conditions, we used 8 LEDs to create a bar graph output. The LEDs are driven from the +5V rail with 330 ohm resistors to ensure they are bright enough to be visible while outside. To improve the readability of the display, we recommend using a cable or right-angle mount on the display board to mount it perpendicular to the sun.
OperationWhen the board is powered and ON, press and release the UV or TEMP button. The microcontroller will measure the conditions and turn ON one of the LEDs per the measurement scale on the display board. To switch modes, press and hold the same button as before until the LEDs turn OFF. Then, press and release the desired mode button (TEMP or UV).
Shade and MeasurementsSince this board is purely solar powered, it is extremely important to give the board unobstructed access to sunlight. With the size of the capacitors on the back, it will survive a few seconds in shade, but long term it must be in sunlight. Using a larger solar panel will improve the ability to work in shade.
MiscellaneousThe board has the pads for an Adafruit STEMMA connector for use with other sensors. The microcontroller can be programmed via the UPDI header. Note, to program, power must be applied to the +5V rail through the DEBUG header for the microcontroller.
Comments