Monthly Archives: August 2018

Measuring 16 Temperatures Remotely

In several cases, one cannot access the area where the temperature needs to be monitored. For instance, the temperature inside a kiln may reach a few thousand degrees, which is beyond the tolerance of humans. Environment chambers may need to be completely sealed off when operating, which means monitoring the conditions within has to be remotely accomplished. Simpler cases may also be considered, where the computer logging the temperature is in a central location, whereas the monitored sites are spread out in different rooms.

The ideal instrument should allow measuring temperatures over a local or remote network, with a built-in web-server to access the instrument, requiring neither programming or app. Measurement Computing has just the instrument and it is the WebDaq-316, a stand-alone temperature logger that allows the user to measure temperatures on 16 channels using J, K, T, E, N. B, R, or S type thermocouples. The user can access the instrument through its web-server over a local or remote network.

With 3 GB of internal acquisition memory, the WebDaq-316 acquires samples at the rate of 75 samples/sec. However, if the memory is insufficient for the job on hand, the user can add more by inserting two USB flash drives or an internal SD memory card. The measurement data can be transferred from the SD card, flash drive, or the internal memory. Alternately, the user can download the acquired data from the web-server as well. It is easy to import the data to an analysis software or a spreadsheet as the WebDaq stores data in CSV format.

The user can operate the WebDaq-316 in two modes—normal or high resolution. In the normal mode, the instrument works at 75 samples/sec or 78 Hz maximum, whereas in high-resolution mode, it can scan at less than one sample/sec across all channels. In the high-resolution mode, WebDaq-316 drops its bandwidth to 14.4 Hz, which also lowers its noise and gain error. That allows the 24-bit delta-sigma ADC on the instrument to operate at its peak efficiency.

The web-server has the ability to send SMS texts or e-mail messages. Therefore, the user can receive an appropriate notification whenever a temperature moves out of limits. Additionally, there are four programmable digital IO channels on the WebDaq-316. The user can make use of these IO channels to operate some local activities such as trigger an alarm or shut down equipment. As the IO channels are programmable, they can be inputs or outputs. As inputs, they can act as trigger depending on external signal, and as outputs, they can trigger alarms. The channels are available on terminal strips on the front panel, which makes all T/C and DIO connections easier.

The user can assign measurement operations through jobs and schedules. For instance, the user may want to change jobs or sample rates whenever a temperature crosses the limits, or return to a schedule of lower rate when the temperature returns within the limits. The user may also want to schedule jobs for triggering alarms or receiving notifications of such conditions.

Based on the Raspberry Pi compute module, the WebDaq-316 operates on a DC power source of 6 to 16 V. This allows vehicular operation as well.

Measuring Air Quality with IoT Sensor

Bosch Sensortec is making an IoT environmental sensor for measuring air quality. The BME680 can measure the indoor air quality, relative humidity, barometric pressure, and ambient air temperature. It has four sensors housed within a single LGA package measuring 3x3x0.95 mm, and both mobile and stationary IoT applications can use the package for use in smart homes, offices, buildings, elder care, sports, and fitness wearables.

The BME680 measures the indoor air quality through its internal gas sensor by detecting a wide variety of gases in the range of parts per billion. The gases it can detect include hydrogen, carbon monoxide, and volatile organic compounds. While measuring altitude and pressure, the BME680 is accurate to within ±1 m and ±12 Pa respectively. Its temperature measurement capability extends from −40°C to +85°C, and it can measure relative humidity from 0% to 100%. In addition, the BME680 can measure an offset temperature coefficient of 1.5 Pa/K.

The BME680 consumes current according to its measuring parameter. While capable of operating from a supply voltage of 1.71 V to 3.6 V, it has a data refresh rate of 1 Hz. When measuring temperature and humidity, the BME680 consumes 2.1 µA, and 3.1 µA when measuring temperature and pressure. The current consumption goes up to 3.7 µA when measuring pressure, temperature, and humidity, while the maximum consumption is between 0.09 and 12 mA when the device is measuring gas, temperature, humidity, and pressure. Therefore, although the current consumption depends on its operating mode, its average current consumption in sleep mode goes down to 0.15 µA.

As an integrated environmental sensor, Bosch Sensortec has developed the BME680 specifically suited for mobile applications and wearables. As for both applications the size and low power consumption are key requirements, Bosch Sensortec has expanded its existing family of environmental sensors by adding the BME680 to its repertoire, while integrating the temperature, humidity, pressure and gas sensors, all of which are highly linear and highly accurate.

The BME680 comes in an 8-pin metal lid LGA package measuring only 3x3x0.95 mm. Bosch Sensortec has designed the sensor for optimized consumption that depends on its specific operating mode, high EMC robustness, and long-term stability. The specialty of the gas sensor within the BME680 is it can detect a wide spectrum of gases for assessing the indoor air quality for individual well-being. For instance, the BME680 can detect VOC or volatile organic compounds from alcohol, adhesives, glues, office equipment, furnishings, cleaning supplies, paint strippers, lacquers, and paints based on formaldehyde.

Applications for the BME680 are numerous. It can be used for altitude tracking as well as calorie expenditure for sports activities. It is sensitive enough for indoor navigation as it can detect change of floors and elevation. As GPS enhancement, it can improve time-to-first-fix, slope detection, and dead reckoning. As home automation control, the user can use the BME680 as an advanced HVAC control. Scientific experiments can use it for measuring volume and airflow, while agriculturists can use it as warning against dryness or high temperature. Sports enthusiasts can use it for monitoring fitness, well-being, detecting skin moisture, change in room, and for context awareness. BME680 is suitable for use as a personalized weather station and for indoor air quality measurement.

Voice HAT for Raspberry Pi for Controlling a Motor

If you were one of the unlucky ones to miss out on the issue 57 of the MagPi, then the only option is to buy the Voice HAT from the AIY projects. The issue 57 had offered a free AIY projects Voice Kit, which Google had developed to make a Voice Assistant, and you could control a speaker with the voice HAT that attached on top of a Raspberry Pi Zero (RBPiZ).

Other tutorials in the MagPi show how to connect the Voice HAT hardware to simple circuits.  So far, the tutorials have dealt with LED lights and servomotors, but this project is somewhat more complex—using the Voice HAT to control a DC motor. Therefore, you will need a DC motor, four AA size batteries, breadboard, and jumper wires.

Usually, the RBPiZ draws its power from the power supply on the Voice HAT board. For this project, this connection has to be broken, else the motor may draw too much power from the RBPiZ and short it. On the Voice HAT board, locate the external power jumper marked JP1, and use a sharp knife to cut the track. If you later wish the power to be shared again between the board and the RBPiZ, re-solder the cut joint.

Power off the RBPiZ and the Voice HAT, and connect the positive terminal of the DC motor to Driver 0, middle pin, which is marked with a “+” symbol. Same way, the negative terminal of the DC motor connects to the “–“ pin of the Driver 0. As this pin connects to the GPIO4 pin, it allows the motor to be turned on and off.

The four AA battery pack connects to the +V and GND pins on the Voice HAT. This ensures the motor is supplied adequate power from the battery pack and the Voice HAT and does not crash the RBPiZ when it draws power. Now turn on the power to the Voice HAT, and then turn on the battery pack.

At this point, you are ready to turn on power to the RBPiZ. Boot into the AIY Projects software and enter the code from motor.py for testing the circuit. The control to the motor comes from the PWMOutputDevice from GPIO Zero, and this allows managing the speed of the motor.

The motor is controlled via a Pulse Width Modulation (PWM) method. The RBPiZ controls the power to the motor by controlling the on and off periods. If the on period is more than the off period, the motor receives more power and therefore, rotates faster.

To manage the speed of the motor, you control the variables .on() and .off() in the software.  Alternately, you may set the value of the instance variable to a value between 0.0 and 1.0 for controlling the speed. Here, 0.0 means the motor is a dead stop, while 1.0 sets the motor to a maximum speed. The motor.py uses both techniques and you can also use pwm.pulse() for pulsing the motor on or off. To integrate this with the Voice Assistant, enter the code from add_to_action.py to the relevant sections. You can now control the motor using voice commands.

3D NAND Memories Cross 10TB

At the Flash Memory Summit in Toronto, Micron Technology exhibited their NVM Express or NVMe Solid State Drives that use the company’s 3D NAND technology to achieve capacities over 10 TB.

According to Dan Florence, Micron built the 9200 series of NVMe SSDs from ground up to overcome the restrictions placed by the legacy hard drives. Dan Florence is the SSD product manager for Micron’s Storage Business Unit. The design of the new storage portfolio addresses the data demands that are presently surging, while maximizing the efficiency of data centers. According to Florence, this improves the overall total cost of ownership for customers. The NVMe over Fabric architecture of Micron is way ahead of standard developments, and is the storage foundation for the Micron SolidState Platform.

According to Florence, the 9200 SSDs from Micron can be up to ten times faster than the fastest SATA SSDs. The 9200 SSDs can achieve transfer speeds of 4.6 GB/s with one million read IOPS. This makes them ideal for high-capacity use case performance as application/database acceleration, high frequency computing, and high frequency trading. Regular interfaces were more attuned to spinning media, which allows NVMe several advantages over the traditional interfaces. As the NVMe sits on the PCIe bus, it not only overcomes a huge amount of latency, but also offers higher bandwidth, allowing users to get much higher IOPS.

Traditionally, PCIe has many custom drivers working in iterations, and the NVMe offers better ease of use. This is allowing NVMe SSDs to be adopted faster, as they can be plugged into almost any system and with any operating system.

The earlier generation of NVMe SSDs from Micron was limited in capacity. The 9200 series can go up to 11 TB, almost three times the capacity of the older generation, making then the first monolithic NVMe SSDs to cross the 10 TB boundary. That also makes it easier for the operating system to manage, while allowing for lower power consumption. Additionally, Micron makes the 9200 series in the U.2 form factor, which allows the new SSDs to achieve more density per server.

Micron claims their new NVMe SSDs, in random performance, can outperform the fastest hard drives by 300-1200 times, and the fastest SSDs by three to seven times. Of course, this is dependent upon the use case and configuration. According to Florence, database applications and transaction processing are increasingly using random performance, as they use a random IO access pattern. Moreover, the workload of several data analyses also follow the same pattern, since working with large pipes of data makes sequential handling more important for data ingest. This includes massive amounts of IoT data as well as user-generated content.

Most general applications also use some level of random IO, and the new NVMe SSDs can use most of the bandwidth in the PCIe bus. According to Florence, the value driver lies in the amount of data moved and worked with, which is also applicable to a growing number of applications. The new NVMe SSDs are a clear leader this area, as the dollar per IOPS becomes increasingly more important.

Charlieplexing on the Raspberry Pi

If you suddenly find the need to control many LEDs and do not have the requisite electronics to do so, you can turn to your single board computer, the Raspberry Pi (RBPi) and use it to charlieplex the LEDs.

Charlieplexing is named after Charlie Allen, the inventor of the technique. Charlieplexing takes advantage of a feature of the GPIO pins of the RBPi, wherein they can change from outputs to inputs even when the RBPi is running a program. Simply setting a GPIO pin to be low does not allow enough current to pass through an LED or influence the other pins set as outputs and connected to the LED.

Using Charlieplexing, you can control up to six LEDs with three GPIO pins. For this, you will need three current limiting 470Ω resistors on each GPIO pin. The program charlieplexing.py defines a 3×6 array, which sets the state and direction of the three GPIO pins. The state defines whether the pin is set as digitally high or low, and the direction defines whether the pin is an output or an input.

Since LEDs are also diodes, they will light up only if their anodes are at a higher potential than their cathodes are, and not otherwise. Therefore, to light up a single LED, the program has to set the pin connected to its anode as output and drive it high. Next, the program must set the pin connected to the anode of the LED as input, while it sets the third pin as output and drive it low. Various combinations of the state and direction of the pins will drive all the LEDs on and off sequentially.

The array in the program holds the settings for each GPIO pin. A value of 0 means the pin is an output in a low state, 1 means the pin is an output in a high state, and -1 means the pin is set as an input.

In charlieplexing, it is easy to calculate how many LEDs each GPIO pin can control. The formula for this is, LEDs = n2-n, where n is the number of pins used. According to the charlieplexing formula, three GPIO pins can charlieplex 6 LEDs; four pins can control 12 LEDs, while 10 pins would allow control over a massive 90 LEDs.

Charlieplexing is good for not only lighting one LED at a time, but it is capable of lighting more at the same time also. For this, the program must run a refresh loop to keep the desired state of the LEDs in the array. While refreshing the display, the program must turn on other LEDs that need to be on, before moving on to the next. However, persistence of vision plays a large part here, and the program must be sufficiently fast to make it appear that more than one LED is on at a time.

However, there is a downside to lighting more LEDs at a time. Since more number of LEDs are now on to make it appear that more than one LED is on simultaneously, each LED is actually lit for a lower amount of time, which makes each LED glow less than at its full brightness.