Give away medical masks when you place an order. learn more
The embedded world in which we live is collectively developed from thousands of varying MCUs and CPUs. In support of the free flow of data and information, many are interconnected and often wireless. This data exchange offers a more convenient and potentially safer lifestyle. The Hotenda Weather Center illustrates how various MCUs can be connected for wireless communication to a handheld Smartphone. The Weather Center is a solar powered, multi-node project with a variety of MCUs and sensors wirelessly networked together. These networked nodes provide a snapshot of both the weather conditions and the solar panel array’s power output, which supplies the main weather center’s power bus.
The PIC24FJ192GA110 MCU implementation
The PIC24FJ192GA110 MCU was used as a weather node to return wireless readings of temperature, humidity, and Lux (luminous flux density) from each of the respective sensors. The node also monitors its own voltage through the use of a high resistance potential divider and voltage follower. These analog signals are read on a sixteen point average via the on-chip ADC. The human-machine interface uses change notification (CN) interrupts via hermetically sealed tactile pushbutton switches and an LCD screen to update the local user with current sensor data.
Operating on an average current draw of as little as 9.25 mA, the node was designed with low power and wireless connectivity in mind. Running at 57,600 Baud, the system uses the PIC’s UART2 port as a means of serial communication with an XBee Pro unit (XBP24-BWIT-004-ND) in pass-through mode. This allows plug-and-play connectivity as if the PIC’s UART port were physically connected on a hard line.
The majority of the time, the PIC MCU is actually sleeping in a low-power state. The system wakes and updates with one of two events; either user interaction through a button press or a system request from the gateway will force a system wake and update. If a button press event occurs, a change notification interrupt is triggered and the corresponding handler sets a flag used to change program flow and update weather data on the LCD screen. The LCD screen driver receives data via the parallel master port. This allows the user to select which reading is displayed. If the gateway asserts a request through a pin on the XBee Pro unit, the system wakes, reads in the input and transmits the appropriate data before returning to sleep. The program flow can be found below in Figure 1.
A V-Infinity 500 mA DC-DC converter (102-1709-ND) was used to efficiently match the supply voltage from the solar charged lead-acid battery to that of the PIC and the other node’s peripherals. This regulator allows for a 32 volt input and provides a low ripple output with up to 96 percent efficiency.
Peripherals, sensors, and hardware
The parallel master port was used to update a Newhaven Display (NHD-0208AZ-RN-YBW-3V-ND). This display was chosen due to its small footprint, compatible supply voltage, and availability.
For Lux sensing, a Microsemi Lux sensor (LX1971IDU-ND) was used due to its temperature stability and approximate human eye spectral response. This means the relationship between the sensor’s input (Lux) and output (voltage) results in a square root transfer function. This allows for a piece-wise conversion by use of a branch statement to determine if the output lies on the curved portion or the linear portion of the transfer function. Once the correct portion of the curve is found, the output is calculated. For daylight conditions, the majority of the output is linear. Therefore, a quick linear scaling is computed for most ambient light measurements.
For the humidity measurements, a Honeywell HIH-5031 humidity sensor (480-3284-1-ND) was employed. This sensor was chosen since it has a relative humidity operational range of 0 to 100 percent with a low hysteresis of +/- 3 percent. For better accuracy, variations in temperature and voltage can be compensated by taking temperature and supply voltage measurements into account. Both of these measurements are available and used for computing a more accurate humidity reading.
The temperature was measured using a Microchip (TC1047AVNBCT-ND) temperature sensor. This sensor operates off of a low, 35-µA supply current and exhibits a linear response, resulting in low processor computational load. As stated above, the temperature sensor is also used to compensate for changes in temperature when calculating the relative humidity.
The circuit for the PIC24FJ192GA110 weather node can be seen in Figures 2 and 3 below.
Figure 3: Power input and peripherals circuit.