Skip navigation
1 2 Previous Next

Safe and Sound

23 Posts authored by: dougw Top Member

IHEF

Observations & Surprises

This project has been a very interesting journey researching a wide variety of invisible potential hazards, designing systems to measure invisible hazards, building wearable instrumentation and testing my environment to see what invisible hazards might be present.

It is probably obvious from the content of my blogs that I learned a lot, actually way too much to fit into a few blogs, but the big surprise for me was how much fun it was. I anticipated the usual thrill I get from designing things and making them work, but I did not foresee how much fun it would be to use the instrumentation to examine my environment. It is a bit like the first time you got to play with a magnifying glass – you just run around looking at absolutely everything in a new way. It was also surprising to me how many people around me took an interest and wanted to examine their own environments. Normally talking about my projects is a good way to elicit glazed looks of boredom, but with this project, so many people wanted to borrow instrumentation it was tough to hang onto it long enough to take my own measurements.

 

The Kit

I am very happy the EXP432P401R was the required processor module for this design challenge as I might not have discovered it otherwise. This module is a very powerful, very capable and cost-effective platform for applications like this and will definitely be a favourite choice for future projects. The development environment was very easy to learn and use, especially since there were good examples available for most of the functionality I wanted to implement.

The comprehensive kit of modules supplied with the challenge (thanks Texas Instruments and element14) really allowed a complete wireless instrument with LCD to be implemented without even having to use wires and cables. Normally building such a platform would be an ambitious undertaking on its own, but with these plug-and-play booster packs and existing software examples, it enables projects to start with a complete, highly functional system and go beyond just getting some computer hardware to work.

 

Highlights

I got to design a custom sensor booster pack and the clear documentation available from Texas Instruments allowed it to work flawlessly without rework, respin or modification. It is really worth taking the time to do the job well – the gratification (and relief ) is immense.

I also got to design many 3D printed parts, continuing my mechanical design learning journey.

It has been a long project with many little problems to overcome, but all the things I've learned and all the things I've accomplished in this project have made it a truly fabulous experience.

IHEF_MQTT
 

This is probably my last blog during this challenge as I have other projects that need attention, but you never know – I certainly will continue to work on the system and use it – the novelty has not worn off yet.

I did want to publish the software I used in the project - for completeness. However, I don't claim any kind of quality for the software, it lacks error checking and handling among other issues. One feature I didn't mention in my other blogs is if the right switch is held down during boot, the sensor system will run stand-alone, without WiFi.

 

IHEF Sensor MQTT Publishing Firmware

// Invisible Hazardous Environmental Factors (IHEF) Monitoring System

// Gas sensor, UV measurement and MQTT publishing software

// by Doug Wong

// 2017 - 06

// rev 01

 

#include <SPI.h>

#include <WiFi.h>

#include <WifiIPStack.h>

#include <Countdown.h>

#include <MQTTClient.h>

#include <OneMsTaskTimer.h>

#include <LCD_SharpBoosterPack_SPI.h>

#include <Wire.h>

 

// network name also called SSID

char ssid[] = "AndroidAP"; //network name - this should be altered for your system ***

// network password

char password[] = "aaaaaa";               //network password - this should be altered for your system ***

 

// Cloud Settings

#define MQTT_MAX_PACKET_SIZE 100

#define SERVERURLLEN 14

#define IOTFSERVER "xxx.xxx.x.xx"     //server URL - this should be altered for your system ***

char organization[] = "";

char typeId[] = "iotsample-ti-energia";

char pubtopic[] = "IHEF";

char deviceId[] = "000000000000";

char clientId[64];

uint8_t macOctets[6];

 

// DAS Variables

LCD_SharpBoosterPack_SPI myScreen;

int AlcPin = A11; //MQ3 - Alcohol

int COPin = A14; //MQ7 - Carbo Monoxide

int AQPin = A13; //MQ135 - Air Quality

int CO2Pin = A8; //CO2

int UVPin = A9; //Ultraviolet Light

int AlcValue = 0; //MQ3 - Alcohol

int COValue = 0; //MQ7 - Carbo Monoxide

int AQValue = 0; //MQ135 - Air Quality

int CO2Value = 0; //CO2

int UVValue = 0; //Ultraviolet Light

int AlcHpin = 31; //MQ3 Heater

int COHpin = 38; //MQ7 Heater

int AQHpin = 32; //MQ135 Heater

String AlcStr; //string to display alcohol value

String COStr; //string to display CO value

String AQStr; //string to display air quality value

String CO2Str; //string to display CO2 value

String UVStr; //string to display UV value

float AlcR; //floating point value for alcohol

float COR; //floating point value for CO

float AQR; //floating point value for air quality

float CO2R; //floating point value for CO2

float UVR; //floating point value for UV

float AlcS; //floating point value for saved alcohol

float COS; //floating point value for saved CO

float AQS; //floating point value for saved air quality

float CO2S; //floating point value for saved CO2

float UVS; //floating point value for saved UV

int SCTR = 0; //seconds counter

int PCTR = 0; //publish counter

int PubFlag = 0;

const int buttonPin = PUSH2; // the number of the pushbutton pin

int buttonState = 0; // variable for reading the pushbutton status

int WiFiFlag = 1; //flag to enable WiFi

 

char mqttAddr[SERVERURLLEN];

int mqttPort = 1883;

 

MACAddress mac;

 

WifiIPStack ipstack; 

MQTT::Client<WifiIPStack, Countdown, MQTT_MAX_PACKET_SIZE> client(ipstack);

 

void setup() {

  uint8_t macOctets[6];

  // setup LCD to display sensor data

  pinMode(AlcHpin, OUTPUT); //heater control pin

  pinMode(COHpin, OUTPUT); //heater control pin

  pinMode(AQHpin, OUTPUT); //heater control pin

 

  // initialize the pushbutton pin as an input:

  pinMode(buttonPin, INPUT_PULLUP); 

 

  // setup LCD to display sensor data

myScreen.begin();

myScreen.clearBuffer();

myScreen.setFont(0); 

Serial.begin(115200);

 

  // read the state of the pushbutton value:

  buttonState = digitalRead(buttonPin);

 

  //if the pushbutton is pressed on startup disable WiFi

  if (buttonState == LOW) { 

   WiFiFlag = 0; 

  }

 

  if (WiFiFlag){

  // attempt to connect to Wifi network:

   myScreen.text(5, 1, "Connecting...");

myScreen.flush();

  // Connect to WPA/WPA2 network. Change this line if using open or WEP network:

  WiFi.begin(ssid, password);

  while ( WiFi.status() != WL_CONNECTED) {

   // flash + while we wait to connect

myScreen.text(86, 1, "+");

myScreen.flush();

   delay(200);

myScreen.text(86, 1, " ");

myScreen.flush();

   delay(100);

  }

   myScreen.text(5, 1, "WiFi Connected ");

   myScreen.text(5, 16, "Waiting for ip");

myScreen.flush();

 

  while (WiFi.localIP() == INADDR_NONE) {

   // wait for an ip addresss

   delay(300);

  }

 

  // We are connected and have an IP address.

   myScreen.text(5, 1, "IP obtained");

   myScreen.text(5, 16, WiFi.localIP());

  mac = WiFi.macAddress(macOctets);

 

  // Use MAC Address as deviceId

  sprintf(deviceId, "%02x%02x%02x%02x%02x%02x", macOctets[0], macOctets[1], macOctets[2], macOctets[3], macOctets[4], macOctets[5]);

  sprintf(clientId, "d:%s:%s:%s", organization, typeId, deviceId);

  sprintf(mqttAddr, IOTFSERVER);

  }

  delay(400); //to allow the text to be read before erasing

myScreen.clear();

   myScreen.text(5, 1, "STARTING DAS");

myScreen.flush();

   delay(300); //to allow the text to be read before erasing

myScreen.clear();

myScreen.clearBuffer();

//display sensor labels

myScreen.setFont(1);

   myScreen.text(5, 1, "SENSORS");

myScreen.setFont(0);

   myScreen.text(5, 22, "Alc");

   myScreen.text(5, 37, "CO");

   myScreen.text(5, 52, "AQ");

   myScreen.text(5, 67, "CO2");

   myScreen.text(5, 82, "UV");

myScreen.flush();

 

}

 

void loop() {

 

  int rc = -1;

 

  if (SCTR >= 0 && SCTR < 60) //turn on alcohol heater for 60 seconds

digitalWrite(AlcHpin, 1); //turn on heater

digitalWrite(COHpin, 0); //turn off heater

digitalWrite(AQHpin, 0); //turn off heater

  if (SCTR > 58 && SCTR < 120) //turn on CO heater for 60 seconds

  {

digitalWrite(AlcHpin, 0); //turn off heater

digitalWrite(COHpin, 1); //turn on heater

digitalWrite(AQHpin, 0); //turn off heater

  }

  if (SCTR > 118 && SCTR < 180) //turn on AQ heater for 60 seconds

  {

digitalWrite(AlcHpin, 0); //turn off heater

digitalWrite(COHpin, 0); //turn off heater

digitalWrite(AQHpin, 1); //turn on heater

  }

  SCTR++; //increment seconds counter

  PCTR++; //increment publish counter

  if (SCTR > 179) //reset seconds counter

  {

   SCTR = 0;

  }

  if (PCTR > 6) //reset publish counter

  {

   PCTR = 0;

  }

 

  //Read Sensors

  AlcValue = analogRead(AlcPin); //read Alcohol sensor

  COValue = analogRead(COPin); //read CO sensor

  AQValue = analogRead(AQPin); //read Air Quality sensor

  CO2Value = analogRead(CO2Pin); //read CO2 sensor

  UVValue = analogRead(UVPin); //read UV sensor

 

  AlcR = (float)AlcValue;

  COR = (float)COValue;

  AQR = (float)AQValue;

  CO2R = (float)CO2Value;

  UVR = (float)UVValue;

  if (SCTR == 178) //save good alcohol reading

  {

   AlcS = AlcR;

  }

  if (SCTR == 118) //save good CO reading

  {

   COS = COR;

  }

  if (SCTR == 58) //save good AQ reading

  {

   AQS = AQR;

  }

 

  AlcStr = String(AlcValue); //convert reading to ASCII for display

  COStr = String(COValue); //convert reading to ASCII

  AQStr = String(AQValue); //convert reading to ASCII

  CO2Str = String(CO2Value); //convert reading to ASCII

  UVStr = String(UVValue); //convert reading to ASCII

 

myScreen.setFont(0);

myScreen.text(40, 22, AlcStr + " "); //display alcohol

myScreen.text(40, 37, COStr + " "); //display CO

myScreen.text(40, 52, AQStr + " "); //display Air Quality

myScreen.text(40, 67, CO2Str + " "); //display CO2

myScreen.text(40, 82, UVStr + " "); //display UV

 

myScreen.text(70, 22, "ppm"); //display units

myScreen.text(70, 37, "ppm"); //display units

myScreen.text(70, 52, "ppm"); //display units

myScreen.text(70, 67, "ppm"); //display units

myScreen.text(70, 82, "idx"); //display units

 

myScreen.flush();

   delay (1000);

 

if (WiFiFlag) {

  if (PCTR == 5) //publish on the 5th second of every 6 seconds

  {

  if (!client.isConnected()) {

// if (WiFi.status() == WL_CONNECTED) {

   while (rc != 0) {

   rc = ipstack.connect(mqttAddr, mqttPort);

   }

 

MQTTPacket_connectData connectData = MQTTPacket_connectData_initializer;

connectData.MQTTVersion = 3;

connectData.clientID.cstring = clientId;

 

   rc = -1;

   while ((rc = client.connect(connectData)) != 0)

   ;

  }

//make up messages to publish data and send 

  char ALCjson[12] = "Alc: ";

  dtostrf(AlcS,1,2, &ALCjson[5]);

// ALCjson[1] = '{';

  ALCjson[10] = '}';

  ALCjson[11] = '\0';

  MQTT::Message message;

  message.qos = MQTT::QOS0;

  message.retained = false;

  message.payload = ALCjson;

  message.payloadlen = strlen(ALCjson);

  rc = client.publish(pubtopic, message);

  if (rc != 0) {

   // error code processing

  }

  char COjson[12] = "CO : ";

  dtostrf(COS,1,2, &COjson[5]);

// COjson[1] = '{';

  COjson[10] = '}';

  COjson[11] = '\0';

  message.payload = COjson;

  message.payloadlen = strlen(COjson);

  rc = client.publish(pubtopic, message);

  if (rc != 0) {

   // error code processing

  }

  char AQjson[12] = "AQ: ";

  dtostrf(AQS,1,2, &AQjson[5]);

// AQjson[1] = '{';

  AQjson[10] = '}';

  AQjson[11] = '\0';

  message.payload = AQjson;

  message.payloadlen = strlen(AQjson);

  rc = client.publish(pubtopic, message);

  if (rc != 0) {

   // error code processing

  }

  char CO2json[12] = "CO2: ";

  dtostrf(CO2R,1,2, &CO2json[5]);

// CO2json[1] = '{';

  CO2json[10] = '}';

  CO2json[11] = '\0';

  message.payload = CO2json;

  message.payloadlen = strlen(CO2json);

  rc = client.publish(pubtopic, message);

  if (rc != 0) {

   // error code processing

  }

  char UVjson[12] = "UV: ";

  dtostrf(UVR,1,2, &UVjson[5]);

// UVjson[1] = '{';

  UVjson[10] = '}';

  UVjson[11] = '\0';

  message.payload = UVjson;

  message.payloadlen = strlen(UVjson);

  rc = client.publish(pubtopic, message);

  if (rc != 0) {

   // error code processing

  }

  }

}

}

 

IHEF MQTT Subscriber Firmware

  /*

Invisible Hazardous Environmental Factors

by Doug Wong 2017-04-08

Remote Display via MQTT

   - connects to an MQTT server

  - subscribes to the topic "IHEF"

  - displays Alcohol, CO, Air Quality, CO2, UV

*/

 

#include <SPI.h>

#include <WiFi.h>

#include <PubSubClient.h>

#include <LCD_SharpBoosterPack_SPI.h>

 

// your network name also called SSID

char ssid[] = "aaaaaa"; //network name – change to your system ***

// your network password

char password[] = "aaaaaa"; //network password – change to your system***

// MQTTServer to use

char server[] = "xxx.xxx.x.xx"; //server URL – change to your system***

// String dstring;

String astring;

 

char dchar[22];

 

LCD_SharpBoosterPack_SPI myScreen;

 

//callback section retrieves subscribed data and displays it

void callback(char* topic, byte* payload, unsigned int length) {

   char *cstring = (char *) payload;

   char *dstring = (char *) payload;

   for (int i=0; i<=10; i++) {

   dstring[i] = cstring[i];

   }

   if (cstring[1] == 108) // ALC

   {

myScreen.text(5, 17, dstring);

myScreen.text(65, 17, " ppm ");

   }

   if (cstring[2] == 32) // CO

   {

myScreen.text(5, 32, dstring);

myScreen.text(65, 32, " ppm ");

   }

   if (cstring[1] == 81) // AQ

   {

myScreen.text(5, 47, dstring);

myScreen.text(65, 47, " ppm ");

   }

   if (cstring[2] == 50) // CO2

   {

myScreen.text(5, 62, dstring);

myScreen.text(65, 62, " ppm ");

   }

   if (cstring[0] == 85) // UV

   {

myScreen.text(5, 77, dstring);

myScreen.text(65, 77, " idx ");

   }

   myScreen.flush();

}

 

WiFiClient wifiClient;

PubSubClient client(server, 1883, callback, wifiClient);

 

void setup()

{ //initiallization section connects to MQTT broker

Serial.begin(115200);

  // attempt to connect to Wifi network:

myScreen.begin();

myScreen.clearBuffer();

myScreen.setFont(0); 

   myScreen.text(5, 1, "Connecting...");

myScreen.flush();

  // Start Ethernet with the build in MAC Address

  // attempt to connect to Wifi network:

  // Connect to WPA/WPA2 network

  WiFi.begin(ssid, password);

  while ( WiFi.status() != WL_CONNECTED) {

   // print dots while we wait to connect

   delay(300);

  }

   myScreen.text(5, 9, "WiFi Connected ");

   myScreen.text(5, 18, "Waiting for ip");

myScreen.flush();

  while (WiFi.localIP() == INADDR_NONE) {

   delay(300);

  }

   myScreen.text(5, 27, "IP obtained");

   myScreen.text(5, 36, WiFi.localIP());

myScreen.flush();

   delay(300);

}

 

void loop()

{

  // Reconnect if the connection was lost

  if (!client.connected()) {

if(!client.connect("IHEF")) {

   } else {

if(client.subscribe("IHEF")) {

myScreen.text(5, 45, "Subcribed");

myScreen.text(5, 54, "IHEF");

myScreen.flush();

   delay(1200);

myScreen.clear();

myScreen.text(20, 3, "MQTT IHEF");

myScreen.flush();

   }

   }

  }

 

  // Check if any message were received

  // on the topic we subscribed to

  client.poll();

  delay(1000);

}

 

It has been fun and informative reading other entries in this challenge, and interacting with participants, I hope everyone enjoyed it as much as I did.

 

Links to all blogs and videos that document this project are listed here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1 of 22 - blog 1

Safe and Sound - Hazardous Factors System - Development Plan - blog 2

Safe and Sound - Hazardous Factor - UV Light - blog 3

Safe and Sound - Hazardous Factor - Air Quality - blog 4

Safe and Sound - Hazardous Gasses PCB - blog 5

Safe and Sound - Hazardous Factor - Radon - blog 6

Safe and Sound - Invisible Hazards System - Kit Unboxing - blog 7

Safe and Sound - MSP-EXP432P401 & Sharp LCD - blog 8

Safe and Sound - Hazardous Factors MQTT Broker - blog 9

Safe and Sound - Hazardous Factors Sensor PCB - blog 10

Safe and Sound - Hazardous Environmental Factors - ELF - blog 11

Safe and Sound - Hazardous Factors MQTT Subscriber & Publisher - blog 12

Safe and Sound - Hazardous Factors System - ARM Car - blog 13

Safe and Sound - Environmental Factors - Wearables - blog 14

Safe and Sound - Environmental Factors - Microwaves - blog 15

Safe and Sound - Environmental Factors - GAS Sensors - blog 16

Safe and Sound - Hazardous Factors Monitoring System - Gas Sensors Module - blog 17

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 18

Safe and Sound - Cell Phone Shield Test - blog 19

Safe and Sound - Invisible Hazards Project Spin-offs - blog 20

Safe and Sound - Gas Sensor Demo - blog 21

Safe and Sound - Ultraviolet Light Tests - blog 22

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System Conclusions - blog 23

 

Safe and Sound Kit Unboxing

Hazardous Gas Display

MSP-EXP432P401R Publishing Sensor Data to an MQTT Broker

Safe and Sound Hazardous Factors Sensor PCB

MQTT Publisher and Subscriber

Wearable Environmental Factors Instruments

Gas Sensors Module Power Up

Invisible Hazardous Environmental Factors System

CellPhoneShieldTest

GasSensorDemo

UV Tests

I have been waiting for a week to do some ultraviolet light tests - the sun just never seems to shine when I need it.

I calibrated the UV sensor output to match the UV Index and wanted to test it in real sunlight.

The UV Index was developed in Canada in 1992 and subsequently adopted by the World Health Organization and the World Meterological Organization in 1994.

This table shows the UV Index scale and what it means:

UV Index

................

Media graphic colorRisk of harm from unprotected sun exposure, for the average adultRecommended protection
0.0–2.9Green"Low"A UV Index reading of 0 to 2 means low danger from the sun's UV rays for the average person.

Wear sunglasses on bright days. If you burn easily, cover up and use broad spectrum SPF 30+ sunscreen. Bright surfaces, such as sand, water and snow, will increase UV exposure.

3.0–5.9Yellow"Moderate"A UV Index reading of 3 to 5 means moderate risk of harm from unprotected sun exposure.

Stay in shade near midday when the sun is strongest. If outdoors, wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.

6.0–7.9Orange"High"A UV Index reading of 6 to 7 means high risk of harm from unprotected sun exposure. Protection against skin and eye damage is needed.

Reduce time in the sun between 10 a.m. and 4 p.m. If outdoors, seek shade and wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such sand, water and snow, will increase UV exposure.

8.0–10.9Red"Very high"A UV Index reading of 8 to 10 means very high risk of harm from unprotected sun exposure. Take extra precautions because unprotected skin and eyes will be damaged and can burn quickly.

Minimize sun exposure between 10 a.m. and 4 p.m. If outdoors, seek shade and wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.

11.0+Violet"Extreme"A UV Index reading of 11 or more means extreme risk of harm from unprotected sun exposure. Take all precautions because unprotected skin and eyes can burn in minutes.

Try to avoid sun exposure between 10 a.m. and 4 p.m. If outdoors, seek shade and wear sun protective clothing, a wide-brimmed hat, and UV-blocking sunglasses. Generously apply broad spectrum SPF 30+ sunscreen every 2 hours, even on cloudy days, and after swimming or sweating. Bright surfaces, such as sand, water and snow, will increase UV exposure.

The weather forecasts here show the UV Index for every hour.

In the video below, I strapped the wearable sensors to a beer stein so they could be consistently aimed at the sun and stationary for the video.

Note that the MQTT subscriber shows the UV Index with more resolution in case it is of interest. (delayed of course by about 11 seconds due to publishing schedules)

The video demonstrates sunglasses and clothing work well to reduce UV exposure.

By the way it is pretty cool that the system can access my Wi-Fi quite far from the house.

 

UPDATE

I did a quick experiment on dwinhold suggestion to see if I could measure sunscreen lotion performance.

In the following 3 images the actual UV Index is always 5.48 as shown in the first image with no sunscreen.

The second image shows the reading with a clear plastic sheet over the sensor. (It attenuates the UV Index to 4.52)

The third image shows the reading with a clear plastic sheet plus SPF30 sunscreen lotion. (It attenuates the UV Index to 3.11)

The sunscreen lotion was applied in a thin coating - hard to measure or describe the thickness of the coating, but is visible in the images on the right side of the plastic sheet.

NoSunscreen

PlasticScreen

SunscreenSPF30

If the readings are accurate the clear plastic reduced the UV Index by 0.91 and the sunscreen lotion with plastic sheet reduced it by 2.37.

Therefore the sunscreen lotion is contributing a reduction of 1.41 in the UV Index. I suspect the influence of visible light is making these differences smaller than true values, but even in this test sunscreen lotion significantly outperformed the plastic sheet.

LotionSPF30

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

It has been a very hectic week including a softball tournament on the weekend, but I did manage to squeeze in some work on calibrating my gas sensor module which is based on the TI MSP EXP432P401R launchpad.

The 18 turn offset and gain pots on my custom sensor card make it easy to adjust the sensor outputs to fit any two point calibration. If linearization is needed, it would be done in software, however I don't have a way to map such curves yet.

All sensors have been zeroed and the CO2 sensor is calibrated. The following video demonstrates the alcohol sensor, the CO2 sensor and the UV sensor in action. The other 2 sensors are also working in the video, I just wasn't blowing any gasses specifically at them.

All gas sensors are setup to be quite sensitive, making it easy to detect when the gasses present stray away from normal concentrations. This does result in it being quite easy to make them reach the maximum ADC reading. The ADC inputs are protected from over-voltage by buffer amplifiers that have the same supply voltage as the EXP432P401R.

These tests were fun to do, partly because everything was working well and partly because I got to try a new liqueur - it is a new experience for me to have to drink to get data. Actually that isn't quite true - back in university I participated in blind testing to determine if people could determine domestic beer brands by taste alone. I couldn't, but it was fun trying.

This was just given to me for Father's Day, and it is the only alcohol in the house, so of course I "had" to use it for the alcohol tests.

DrMcGillicuddy

The 3 MQx gas sensors work in sequence, one after the other to avoid having all heaters on at the same time. There is a yellow LED next to the sensor to indicate which heater is on. The heaters are on for 60 seconds, to evaporate and old gasses on the sensor element, and off for 120 seconds to allow the sensor element to cool off and start responding to new ambient gas concentrations.

The CO2 sensor is working great and it is the key gas sensor to audit air quality in my workplace. I'm not expecting any real nasty gasses at work.

 

Addendum - Office Air Quality Audit:

I took my gas sensor in to work today and wore it all day to audit air quality wherever I was.

I got lots of questions about the project and a few comments about Predator and other sci-fi shows.

In my office CO2 was about 420 ppm - the unoccupied areas were just under 400 ppm.

I was in a heavy duty meeting for 3.5 hours in the morning with 20 upper management staff. The CO2 levels rose to 780 ppm.

I had one other meeting in the afternoon for an hour with 5 staff. The CO2 levels rose from 400 to 550 ppm in one hour.

These levels aren't dangerous but I was surprised at how much people influenced the readings.

(How significant are people as greenhouse gas machines? )

This project really has been a learning experience - with several interesting surprises.

This instrumentation and the accompanying research have already turned out to be very useful in so many ways - all the more reasons why I am glad I participated in this challenge.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

This week I've been sidetracked on a bit of a tangent to my build project.

I was asked to make a presentation on invisible hazardous environmental factors.

All I can say is the grapevine works in mysterious ways.

Anyway I put together a 1 hour multi media presentation along with a show-and-tell demonstration of my instrumentation.

The demo activity was beamed up onto the big screen using live video, so everyone could see the meters in giant scale going crazy when my cell phone was taken out of airplane mode.

I wasn't trying to scare anybody, but there was quite a gasp from the audience when the RF strength went full scale red, similar to this video. (so I threw in some damage control)

It was a little surprising to me to see so much interest in the topic - the room was full and there were lots of questions and lots of comments about how much they were learning.

I will try an attach the Powerpoint presentation to this blog in case anyone wants to have a look at it or use it, although I didn't stick to the script and I mixed in lots of hardware demonstrations.

 

On another front, I had mentioned one of my neighbors was doing a lot of "green" things to his house including connecting the aluminum siding as a shield. I was going to get over there, do an "audit" and take some photos, but our schedules weren't matching up. So I loaned him some instruments and he performed his own audit. Unfortunately he has not yet sent me his readings or pictures, but he did provide a report highlighting things that concerned him. The 2 largest readings he found in his house came from his microwave oven and his cordless phone. (I also found my cordless phone was high 24-7, so I dumped it and went back to wired) He also found some hot spots in his house that he couldn't explain. One surprise was his new vehicle which has some kind of On-Star wireless system. The readings were extremely high in the passenger seat for some reason. This is not a scientific study - just anecdotal data, but it was enough to get him to want to immediately buy his own set of instruments.

 

Unfortunately not a lot of new images this week, so here is an unpublished image. It shows the power consumption of the two custom modules.

 

ModuleVoltage (Volts)Current (A)
MQTT Subscriber (remote Wi-Fi display)5.080.1
MQTT Publisher (gas sensor module)4.970.26

IHEF2

 

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

The deadline for this challenge has been extended again, so I can squeeze in a few more blogs. Perhaps some real applications of all this instrumentation I have put together.

This blog shows some quick tests I did to see if shielding makes a difference to cell phone radiation. These tests are a follow up to an earlier blog on microwave radiation.

To set up for the test, I made a shield from two 3D printed shells sandwiching a layer of aluminum foil between them.

The shell and foil covered 5 of the 6 sides of the phone - about 1mm from the back of the phone and about 2mm from the sides.

Cell Shield

I ran some tests with and without the shield to see if it made a difference - and it definitely did. I was a bit surprised by the results.

The main scenario that I am interested in is the case where the phone is in a pants pocket as studies show this results in lower testosterone and lower sperm count. So I placed the phone and meter in appropriate locations on a Hybrid III crash test dummy and took some readings. These particular dummies have seen some major trauma (explosions) and you can see they look a bit charred, but the geometry is still good - this is a 50th percentile male.

UnshieldedCellShieldedCell

These readings are the maximums I saw in this geometry. The shielded maximum was a rare spike, it spent most of its communication time at about 1 mW/m2.

The unshielded maximum is closer to its normal value ~ 150 mW/m2.

In this experiment the shielded case yielded 10 to 100 times less radiation density at the location of interest.

This is not a particularly scientific experiment, but the results do suggest it might be worth investigating shielding in a more scientific way.

I did not check to see how cell phone performance was impacted by the shield - I imagine the shield didn't help communications ...

To get a bit more of a feel for what the readings look like in real time, I made a video of typical readings. Viewers can decide if the readings are meaningful for themselves.

The other geometry of interest is holding the phone at your ear.

Here are some images showing a reading with the meter where an ear might be and what happens if a metal plate is inserted between the phone and the meter.

CellAtEarCellShieldPlate

Note the units change in these images - one is mW the other is uW, so the last image is 4.6 mW/m2

One observation is that the field strength seems to be lower at the face of the phone compared to the sides - by about 50%.

The other observation is that the metal plate cuts the field strength by more than a factor of 100. Again, I did not determine how this plate impacts cell phone communications performance.

 

These experiments are not trying to determine what level of radiation is safe, just trying to get a feel for whether partial shielding can reduce radiation exposure.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

This design challenge is nearing its final deadline so the pressure as been building to complete the project.

I finally finished building all the hardware and all the hardware is working well.

The past week has seen a lot of 3D design work and 3D printing and mechanical building, but also powered up the full system for the first time.

 

The subscriber power monitor is showing 5.08 volts at 10 mA.

The publisher power monitor is showing 4.97 volts at 190 mA.

IHEF_instruments

Here are the four instruments that make up the Invisible Hazardous Environmental Factors system.

WearableSensors

Note the 2 USB power monitor modules are not part of the system - I was just checking how much current the systems consume.

(10 mA and 240 mA respectively)

If you look closely - you can see the CO2 is reading 463 ppm, which is bang on - a really nice quick sensor.

Arm_Sensors

Here are the 4 IHEF instruments on one forearm. They barely fit.

IHEF_System

Here is the IHEF system running. After wearing the system around for a while I am re-thinking my desire to build a Pip Boy - the weight of the full system is non-trivial.

There are a lot of LEDs on the embedded modules - I like the way they shine through the plastic housings. You can just see the green coming out the side - the yellow are mostly visible in the video.

 

As with any project of this complexity, there was a lot to learn and a lot of issues to work through, but on all the major tasks careful planning and design paid off.

The plusses

  • I was able to successfully design a custom sensor Booster Pack and it worked flawlessly, which was a huge benefit as there is not really time and money to spin multiple custom PCBs in a project like this.
  • The EXP432P401R MCU card was powerful and easy to program with lots of onboard resources - sometimes new products have only rudimentary documentation, but this card was well done.
  • I had purchased a second MCU card as a spare, which didn't turn out to be needed so I was able to convert it into a remote MQTT subscriber/display.
  • The CC3100MODBOOST Wi-Fi modules (I had to buy a second one for the MQTT subscriber) worked great - there were challenges for me to get familiar with it but it was well supported.
  • I learned a bit about MQTT - I'm still a neophyte, but I fully expect to use this technology in future projects.
  • I learned a lot about radiation and Radon
  • I learned a lot about the hazards of ultra violet light and electric fields, and what is important about various invisible gasses such as carbon monoxide and carbon dioxide.
  • I was able to design and print twenty-seven 3D objects to package four instruments into robust wearable systems.
  • The CO2 sensor works very well - much better than expected

The not so plus issues

  • I ordered the wrong RF sensor module (it couldn't measure Wi-Fi or Bluetooth) so I had to buy a meter instead. (the meter works great)
  • The VOC (volatile organic compounds) sensor I ordered, never arrived, but I added alcohol instead. (VOC can be substituted when it arrives - alcohol is more fun to test anyway)
  • The large complement of Booster Packs supplied with the kit had some conflicts with pin assignments, making it problematic to use all in the same system. (I'm happy with the set I was able to stack up - it made the system easy to connect electrically)
  • I did not implement my MQTT broker on a Raspberry Pi, because by the time my RPi3 finally arrived, I was well into testing with mosquitto on a PC.

Summary

The project and plan morphed a bit based on what I learned along the way, but all in the interests of achieving the primary objectives.

The project did cover the hazards of invisible environmental factors, how to measure them and what can be done to minimize them.

The project did manage to use 6 TI modules, including 2 of the EXP432P401R MCUs.

The project did end up to be fully functional, robust, wearable and useful. I already have multiple requests to borrow it - and it has only been working for a matter of hours.

Overall the project was both fun and educational, even though I don't generally enjoy dwelling on dangers and hazards.

I've enjoyed experimenting with lots of TI modules in the past but EXP432P401R MCU is going to be my new favourite for complex microcontroller projects - this project didn't even cause it to break a sweat, either in speed or resources. It is easy to use and the price is attractive for an ARM Cortex M4 module.

If you are thinking about entering a design challenge like this, I heartily recommend it - there is tremendous satisfaction in completing such a project.

 

Next Steps

Although the system is complete, I still have some time and some tasks I would like accomplish:

  • clean up my sensor program well enough to publish it
  • try to calibrate the gas sensors better
  • take some readings in different environments
  • add a Wi-Fi switch so the system can operate without WiFi when desired

I have to be on the road over the next little while, so my project time will be severely limited, but we will see what can be managed...

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

This update documents progress on power up of the custom gas and UV sensor module. I did run into a few snags getting the card to work, or rather getting the software to work. The hardware on the card is designed properly, but it has just been too long since I designed the card and my software assumptions were somewhat inexplicable. After backtracking my way through everything, I finally got it sorted out. I will post an update to my pinout table at the end of this blog in case anyone else has similar problems.

I did go one step at a time to minimize the risk of frying sensors or cards, so the following video uses resistors in place of sensors to make sure the software and hardware are working properly:

I still have to perform some calibration once the sensors are burned in.

Packaging this module involves a lot of tricky features, and multiple parts which will take a couple of days to model. Hopefully I can get the 3D print to work without iterating.

 

Here is an updated BoosterPack pinout table for the various modules associated with this design challenge:

EnergiaBooster432P401RMCUSHARP LCDCC3100ModBoost BoostXLBoostSense1CC2650BLEDLP7970ABPMQ_boosternotes
J1-11+3.3V+3.3V+3.3V+3.3V+3.3V+3.3V+3.3V+3.3V+3.3V+3.3V
J1-22Analog InA15P6.0LCD ControlLED9MRDY
J1-33UART RXUART RXP3.2UART RXTXD
J1-44UART TXUART TXP3.3UART TXRXD
J1-55GPIOGPIO 1P4.1LCD EnablenHibINT1LEDxmove R16 to R17
J1-66Analog InA10P4.3SPI CSLED1
J1-77SPI CLKSPI CLKP1.5SPI CLKSPI CLKLED2SPI CLKSPI CLK
J1-88GPIOGPIO 2P4.6Left Slide 2MAG INTSens0DIOIRQ
J1-99I2C SCLI2C SCLP4.5Left Slide 1I2C SCLSens1SPI CS
J1-1019I2C SDAI2C SDAP4.4Left Slide 0I2C SDASens2EN
J2-120GNDGNDGNDGNDGNDGNDGNDGNDGNDGND
J2-219GPIOGPIOP2.5Ext COM InvertIRQSRDY
J2-318SPI CS WSPI CS WP3.0SPI CSSPI CSXout
J2-417GPIOGPIOP5.7
J2-516RSTRSTRSTnResetReset
J2-615SPI MOSISPI MOSIP1.6SPI SIMOSPI MOSILED4MOSIMOSI
J2-714SPI MISOSPI MISOP1.7SPI MISOLED3MISOMISO
J2-813SPI CS DSPI CS DP5.0Right Slide 2INT2Sens5DIO13LED
J2-912SPI CS OSPI CS OP5.2Right Slide 1TMP INTSens4LED
J2-1011GPIOGPIOP3.6Right Slide 0OPT INTSens3LED
J3-121'+5V'+5V'+5V'+5V'+5V'+5V
J3-222GNDGNDGNDGNDGNDGNDGND
J3-323Analog In 3A14P6.1MQ-7CO
J3-424Analog In 4A13P4.0MQ-135AQ
J3-525Analog In 5A11P4.2MQ-3Alc
J3-626Analog In 6A9P4.4UV
J3-727Analog In 7A8P4.5CO2
J3-828Analog In 8A6P4.7
J3-929A10P5.4
J3-1030A0P5.5
J4-140GPIOGPIOP2.7
J4-239GPIOGPIOP2.6
J4-338GPIOGPIOP2.4MQ7D
J4-437GPIOVREFP5.6UART CTS
J4-536GPIOGPIOP6.6UART RTS
J4-636GPIOGPIOP6.7nReset
J4-734GPIOGPIOP2.3NWP Log TX
J4-833GPIOGPIOP5.1WLAN Log TX
J4-932GPIOGPIOP3.5MQ135D
J4-1031GPIOGPIOP3.7MQ3D

The yellow cells are just the pins I am using in my project.

 

The deadline for this project is starting to put stress on progress, but with this latest milestone, the remaining work is more about finding enough time than overcoming major problems.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

I have been under the weather this week, which is unusual for me.

It is just so much fun trying to build electronics when you are feverish, nauseous, dizzy and coughing up a lung. None-the-less, the show must go on. The first thing I need to mention is the last item in the sponsored kit has arrived. (although I won't need it for this project)

BOOSTXL-Sensors

No video this week - my throat is too sore and I'm too hoarse and I'm coughing too much.

I finally received enough parts to build my sensor booster pack - here is what it looks like assembled:

MQxBooster

The black module on the left is the CO2 sensor, at the bottom is the UV sensor, the orange sensor is an MQ3 (alcohol), the red sensor is an MQ7 (carbon monoxide), and the stainless sensor is an MQ135 (air quality). The 3 sensors at the right are in sockets, allowing any MQ sensor to be substituted. The pots allow me to adjust offset and gain of each signal to get the best range out of the A/D. Not visible in this picture are 3 LEDs, one opposite each sensor - between the sensor and the pots. These allow me to see when each heater is on.

You can see I got to use nice big traces and spread out the signal conditioning circuitry because the card had to be large enough to get all the sensors exposed to the air and it left lots of room in the middle under the display.

Here is what it looks like when all booster packs are stacked up into the full module:

GasSensorModule

The packaging will allow all sensors to access ambient air.

I would normally like to show the card working, but I think I will wait until my head clears before trying the smoke test (power-up).

 

While I'm feeling miserable, I might as well point out some background and mistakes with the project.

I have built RF power monitoring circuits in the past to work in the Bluetooth/WiFi/Zigbee frequency band (2.5GHz). The actual modules I built are being used at another location but I still have a couple of bare cards. They have an RF power monitoring and signal conditioning section, an SPI A/D, and an FTDI SPI-USB interface. There is no MCU - the A/D is controlled by a program on a PC via USB. One card has a directional quad antenna on it.

RFmeter

Comparing these old prototypes to the new booster pack you can see how much my prototype cards have improved since I started getting them made off-shore.

I came close to designing a version of this power level meter that would work in a booster pack, but I decided to order a ready-built module on-line.

Unfortunately the module I ended up ordering only goes up to 500 MHz - as I discovered when I powered it up ......

RFpowerModule

The versions that go up to 3 or 8 GHz look the same - I just messed up the order. The delivery schedule on these precludes ordering another one. As you can imagine - I was pretty fed up with myself. I was going to make a wrist mount for the module, and possibly interface it to the TI MCU but alas it won't end up in this project.

I ended up buying another great little meter to take readings but totally blew my budget in the process.

Anyway - enough griping - there has been progress despite the woes.

I'm still waiting for a few parts, but none are show-stoppers, I can complete the hardware with what I have.

So now I just need to get well, get my act together, make it work and spend the time to finish.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

This is the last of the hazardous environmental factors research blogs for this project, subsequent blogs in this challenge will deal with hardware builds, software programs, functional tests and test results.

Microwaves are used for cell phones, Wi-Fi, Bluetooth, Zigbee, GPS, some cordless phones, and microwave ovens. The microwave oven is proof that a high enough exposure can be harmful. But what is the mechanism that makes microwaves cook food?

dipole_water

It is pretty common knowledge that it is heating up the water molecules in food, but it turns out it is not exciting the resonant frequency of water molecules, (the resonant frequency of water molecules is over 21 GHz) the oscillating electromagnetic field is acting on the water molecule dipoles. Water molecules conceptually have a plus side and a negative side so they try to align with the prevailing electric field – as the field oscillates (reverses), the molecules flip to stay aligned. This rapid rotation of molecules causes friction between molecules and thus heat. If 2 tires on a vehicle were touching as they rolled along a road, they would generate extreme friction and heat because although they are turning in the same direction, at the point of contact the tires are traveling in opposite directions. It isn't just water that responds to oscillating fields, other dipole molecules and salt ions also are also affected.

There is also nothing magic about the frequency used in microwave ovens, a fairly wide range of frequencies would have similar results. It is mainly regulations that dictate the frequency used. (2.45 GHz)

Humans can dissipate well over 100 Watts, so it takes significant rf radiation (over 4 W/kg) to cause excess heating. Regulations (0.4 W/kg) were developed long ago to keep human exposure well below levels where excess heating would become a problem. And if heat from microwaves is occurring, you would feel it as heat – it would heat the outer 1 cm of your skin – not much would penetrate further. Although your eyes are more susceptible especially to ionizing radiation.

Okay, so the risk of getting cooked by microwaves is very low and you would feel it if it was occurring, but lower levels of microwave are still causing dipole molecules in our bodies to vibrate or rotate rapidly – what effect does this have on our physiology?

There are lots of studies on this, often finding some correlation with adverse effects at exposure levels orders of magnitude below regulatory limits, but generally not dramatic influences. It may speed up activity in some cells, but I don't have much info on this.

We know that DNA is affected by electric fields and in fact electrophoresis is a technique that uses this property to selectively move DNA around. So DNA can probably be jostled around by electromagnetic oscillations. There doesn't seem to be much literature around on whether DNA is too constrained to be spinning and flipping, but it is conceivable that every once in a while the jostling is severe enough to overstress some DNA and cause breaks or mutation and some studies show this. I could go on with further speculation, but I don't have enough data to support it so I will get back to real studies and measurements.

There is concern that cell phones cause brain cancer and there are some serious studies investigating this possibility. Some significant studies indicate that heavy cell phone use could double the risk of brain cancer, but symptoms might not show up for one or more decades. Keep in mind that deaths from brain cancer are about 1/375th of the chance of death from other types of cancer, so doubling the risk still makes it a relatively small risk.

CellPhoneField

I have collected a lot of data and reports correlating cell phone emissions with a myriad of symptoms from obesity and headaches to autism and insomnia. Some study the effects all the way down at the cellular level while some are just statistical correlations. One thing that seems to be common is when people are discussing the subject, they tend to dramatize the results, playing down statistics that would provide a better contextual perspective. I don't want to regurgitate all that, but there is one case where the evidence seems to be more widely accepted: When men carry cell phones in their pockets, they tend to have lower testosterone levels and lower sperm counts. In many species, reduced fertility is an early warning of environmental stress so these results are troubling. The process involved when DNA and RNA precisely replicate themselves is complex and fantastic and it is not hard to believe that it doesn't take much interference to mess it up.

I have been trying to determine if it is possible to shield a person with a cell phone in their pocket, but it is difficult to do with the setup I have. The cell phone is only periodically transmitting and the power levels seem to be very dynamic. I think I would need at least 2 fast power level sensors and a data acquisition system that could simultaneously sample both sensors. Right now, if I insert a shield, and the readings change, I don't know if they have changed because they were about to change anyway or if the shield caused the change.

That being said, I did find some trends that seem to be occurring. The radiation seemed a bit stronger coming from the edges of the phone I was testing and putting a metal shield between an edge and my meter, caused the reading to drop more significantly than doing the same test on the face of the phone. I'm not sure if there any huge conclusions, but wearing metal underwear would likely reduce exposure. These phone shield pockets that are being sold work, but they stop the phone from receiving and you get pretty much the same performance by simply putting the phone in airplane mode. My tests suggest it might be possible to design a directional shield that reduces exposure of the owner while allowing communication with a cell tower, but I need to think a bit more on how to prove performance of such designs.

sperm

As mentioned, I have collected a pile of information and studies on the hazards of low level EM radiation and much of it is worrisome if not downright scary, but although many symptoms have been linked to EM radiation, the risks do not appear to be high enough and the symptoms do not appear to be severe enough (with proven causality) to warrant immediate regulatory intervention. However, just because the light is green doesn't mean there is no risk to crossing the street. Sometimes it is worth looking both ways before crossing anyway.

I won't re-print all the data but here is an example table of some potential symptoms and effects from low-level EM radiation:

rfsymptoms

Notes:

  • RFR is Radio Frequency Radiation
  • To convert mW/cm2 to mW/m2 multiply by 10


In the next section, which shows some actual readings I have been taking around the house, I will list a few practical tips to reduce exposure. One of the main reasons for doing this project is to use the instrumentation to explore my environment and find ways to make it as safe as possible.

microwaveoven

This image show readings from a decent microwave oven (I've seen worse). The readings drop from 232 mW/m2 at 1 foot to 1 mW/m2 at 6 feet.

Safety Tips: It is easy to stay at least 6 feet from running microwave ovens.

CellPhone

This image shows readings from a cell phone coming out of airplane mode and reconnecting to a cell tower to get email.

Safety Tips:

  • keep the phone in airplane mode whenever it is not in use or expecting an urgent call
  • when exiting airplane mode, keep the phone a few feet away
  • when making a call, use a headset rather than putting the phone to your ear
  • if you don't have a headset, use speaker phone mode
  • try to make calls where reception is good – the phone will throttle back on transmit power
  • use text instead of voice – it keeps the phone further from your body and can reduce transmit time
  • use a land line when possible
  • when driving, use a hands free system and put the phone away from your body
  • put the phone in airplane mode at night while it is charging or keep it a reasonable distance from your body

WiFiHotspot1

This image shows readings from a Wi-Fi hotspot measured from 6 inches away.

WiFi4ft

This image shows readings from a Wi-Fi hotspot measured from 54 inches away.

Safety Tips:

  • Turn the Wi-Fi router off when it is not needed (when you are sleeping for example)
  • locate the Wi-Fi router away from commonly occupied spaces, but close enough that client devices do not need to crank up to full power to access the router

WiFiTablet

This image shows a tablet using Wi-Fi to update its game.

Safety Tips:

  • use a big tablet at full arms length from your body – on a table not your lap
  • operate it close enough to your router to get all signal strength bars lit
  • use a wired Ethernet connection if possible

bluetooth

This image shows a couple of Buetooth devices communicating.

Safety Tips:

  • move to Bluetooth low energy (BLE)
  • keep devices at arms length when possible
  • Bluetooth headsets are better than putting a phone to your ear, but not as good as a wired headset

 

This table summarizes some of the readings I took around my house:

    

Device

Distance

Magnetic Field (mG)

Electric Field (V/m)

RF Strength (mW/m2)

House Baseline

0

0.05

2

0.0414

Microwave oven

12”

13.75

2

233.2

Microwave oven

60”

0.3

2

1

Cell Phone

4”

0.23

88

158.1

Wi-Fi HotSpot

6”

0.05

5

96.5

Wi-Fi HotSpot

54”

0.07

2

0.0211

Wi-Fi Tablet

3”

2.62

106

300.8

Wi-Fi Tablet

33”

0.36

10

0.09

Bluetooth

6”

0.12

206

3.371

Smoke Alarm

5”

0.3

10

9.4

HV Power Lines

100'

6.67

1997

0.272

Res Power Lines

40'

1

154

0.0114

Inductive Range

10”

50

276

0.0094

LED lamp

6”

0.43

25

0.0135

Phone

6”

2.14

25

0.00761

Electric razor

4”

7.33

126

0.00601

Electric Stove

10”

7

131

0.00601

Vacuum Cleaner

8”

35

50

0.0094

Note that distance is a big factor in power levels and exposure, a few extra feet from the source can cut exposure levels by orders of magnitude.

 

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

I have been in Washington making a technical presentation in an unbelievably secure building, but now I'm back and it is time to catch up.

I am still waiting for some parts for my sensor card – it is starting to look like I will have to kludge some connectors and use lower performance amplifiers to get it working within the schedule. In the mean time I am using the working parts of the system to take some readings in my environment and I'm also doing a lot of 3D design and printing to make all the modules wearable.

Rather than try to build suspense, here is a short video showing three wearable instruments on one arm:

The concept is to mount all these devices on my forearm where the displays can easily be viewed and the controls can be easily accessed. This arrangement keeps both hands free for other tasks and eliminates the need to carry a tool box and set it down when taking readings. I am experimenting with different friction in the hinges - it is nice to be able to flip the displays up or down just by twitching my arm, but inadvertent flipping may be too big of a drawback.

The two flip-up modules have five 3D printed pieces each, plus a stretchy strap and some fasteners. The meters have some foam rubber in the caps so that when they are cinched down, everything remains snug with no rattling. The meter caps are held down with wire-ties, which minimizes the complexity and size of the 3D cases, while providing a very secure, snug fit. (obviously designed by an electronics guy) The Wi-Fi enabled gas sensor display uses seven 3D printed parts – covered in an earlier blog. Considering these modules are first prototypes, I am very happy they work so well.

There is still one module not shown – the multi-gas sensor - although most of the electronics are shown working in an earlier blog. Some of the 3D printed parts are finished, but at least one section is not designed and the cards cannot be stacked yet to finalize measurements for it.

In a previous blog a discussion came up about the use of (radioactive) Americium in smoke detectors so here is a follow up with some tests.

Here is a picture of what my radiation meter reads when next to a smoke detector in my house:

SmokeAlarmRadiation

Here is a picture of the background radiation in my house:

BackgroundRadiation

The meter is pretty nice in that it provides an accuracy estimate as well as a reading. The accuracy in these readings is no better than 40% because the meter was not running very long and the amount of radiation is very low. Which means these readings could be the same real value although the smoke alarm area was consistently very slightly higher than other areas. Whatever radiation is reaching the meter is probably gamma radiation as I don't see how alpha particles could reach the meter with any velocity. My conclusion is that any radiation from the smoke detector is pretty similar to background radiation and generally the background radiation will be larger than any contribution from a smoke detector.

My next blog will be a discussion of microwave hazards including cell phones and some readings from my environment. After that I will be working on gas sensor software while waiting for parts to arrive.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

 

This last week has seen a lot of time on mechanical CAD and 3D printing to try and squeeze the MQTT subscriber system into a wearable package.

I called it the ARM Car because it looks like a car and it is a TI ARM chip to be worm on an arm.

Here is a picture of the ARM Car driving down the information highway:

ARMcar

Starting with the high stack of circuit boards - it is non-trivial to figure out how to make it wearable:

CardStack

The package is assembled from 4 main plastic sections, a wrist bracket, a base, a cover and a bezel:

WristMountBracketMQTTskirtMQTTcoverMQTTbezel

Here is a picture of the parts (the bracket is already screwed to the base):

MQTTparts

Note the battery also has a 3D printed bracket and the rods for the strap are also 3D printed.

Here is a picture of the system in operation:

wearableMQTT

Here is another angle showing the height and the fit on my arm:

WearableStackup

The system was always going to be fairly big, but it turned out to be a nice robust package that can be securely and comfortably strapped to an arm and is  super easy to use. The only control needed is the power button on the battery, although the 3 switches on the Launchpad are all still accessible.

It isn't too visible in these photos, but the various LEDs inside really illuminate the plastic, creating a nice effect without being annoyingly bright.

I have printed some parts for the other 3 armbands (radiation sensor, electromagnetic sensor and chemical sensor), but am still waiting for some parts to show up before they can be finalized. I have a couple of other RF sensors that I may blog about too, but I don't think I will be able to fit them on my arm. When the 4 armbands are all complete I will take some video.

Hopefully I will get to a discussion of RF hazards in my next blog.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

I managed to purchase a second WiFi booster pack although the TI discount voucher I won here was not accepted This booster pack has allowed me to assemble a second system consisting of a  MSP-EXP432P401RMSP-EXP432P401R a CC3100ModBoost and a  430BOOST-SHARP96430BOOST-SHARP96 I have programmed the second system as an MQTT client subscribing to the IHEF data being published by my sensor platform which has the same cards plus my custom sensor booster pack Both systems use Wi-Fi to access my MQTT broker

MQTT_IHEF

The following video shows both systems booting up with MQTTLENS running in the background all interacting with my Mosquitto broker.

Here is the subscriber program such as it is at this moment:

/*

Invisible Hazardous Environmental Factors

by Doug Wong 2017-04-08

Remote Display via MQTT

   - connects to an MQTT server

  - subscribes to the topic "IHEF"

  - displays Alcohol, CO, Air Quality, CO2, UV

*/

 

 

#include <SPI.h>

#include <WiFi.h>

#include <PubSubClient.h>

#include <LCD_SharpBoosterPack_SPI.h>

 

 

// your network name also called SSID

char ssid[] = "AccessPoint";

// your network password

char password[] = "NetworkPassword";

// MQTTServer to use

char server[] = "brokerURL";

 

 

LCD_SharpBoosterPack_SPI myScreen;

 

 

//callback section retrieves subscribed data and displays it

void callback(char* topic, byte* payload, unsigned int length) {

    char *cstring = (char *) payload;

   if (cstring[0] == 49)    // ALC

   {

      myScreen.text(5, 17, cstring);

      myScreen.text(65, 17, " ppm  ");

   }

   if (cstring[0] == 50)    // CO

   {

      myScreen.text(5, 32, cstring);

      myScreen.text(65, 32, " ppm  ");

   }

   if (cstring[0] == 51)    // AQ

   {

      myScreen.text(5, 47, cstring);

      myScreen.text(65, 47, " ppm  ");

   }

   if (cstring[0] == 52)    // CO2

   {

      myScreen.text(5, 62, cstring);

      myScreen.text(65, 62, " ppm  ");

   }

   if (cstring[0] == 53)    // UV

   {

      myScreen.text(5, 77, cstring);

      myScreen.text(65, 77, " idx  ");

   }

   myScreen.flush();

}

 

 

WiFiClient wifiClient;

PubSubClient client(server, 1883, callback, wifiClient);

 

 

void setup()

{                         //initiallization section connects to MQTT broker

  Serial.begin(115200);

  // attempt to connect to Wifi network:

    myScreen.begin();

    myScreen.clearBuffer();

    myScreen.setFont(0); 

    myScreen.text(5, 1, "Connecting...");

    myScreen.flush();

  // Start Ethernet with the build in MAC Address

  // attempt to connect to Wifi network:

  // Connect to WPA/WPA2 network

  WiFi.begin(ssid, password);

  while ( WiFi.status() != WL_CONNECTED) {

    // print dots while we wait to connect

    delay(300);

  }

    myScreen.text(5, 9, "WiFi Connected ");

    myScreen.text(5, 18, "Waiting for ip");

    myScreen.flush();

  while (WiFi.localIP() == INADDR_NONE) {

    delay(300);

  }

    myScreen.text(5, 27, "IP obtained");

    myScreen.text(5, 36, WiFi.localIP());

    myScreen.flush();

    delay(300);

}

 

 

void loop()

{

  // Reconnect if the connection was lost

  if (!client.connected()) {

 

 

    if(!client.connect("IHEF")) {

 

 

    } else {

      if(client.subscribe("IHEF")) {

      myScreen.text(5, 45, "Subcribed");

      myScreen.text(5, 54, "IHEF");

      myScreen.flush();

      delay(1200);

      myScreen.clear();

      myScreen.text(20, 3, "MQTT IHEF");

      myScreen.flush();

      }

    }

  }

 

  // Check if any message were received

  // on the topic we subsrcived to

  client.poll();

  delay(1000);

}

 

My next blog will likely be about the invisible hazards of microwaves, but I am also close to starting on packaging all my instrumentation in a wearable format. The main things still missing from my project are some minor components for my custom sensor circuit card, and there is still some software work to produce calibrated sensor readings.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

Extremely Low Frequency Electromagnetic Radiation - (ELF)

I am going to arbitrarily split this large topic into just the 2 ranges of electromagnetic fields which are of most interest to me: 0 to 300 Hz and microwaves from 2 to 3 GHz.

 

Is electromagnetic radiation dangerous to humans? There is no question that high electromagnetic fields are dangerous to humans. People can die from high voltage shocks such as lightning and high current such as an electric chair and is pretty obvious the interior of a microwave oven would be an unhealthy environment, so the question becomes at what level are voltages, currents and electromagnetic fields safe for people?

This topic is far too complex to cover in a short article, but I want to take a quick look at it from the unusual perspective of electrical engineering.

Human bodies involve incredibly complex electro-chemical processes which are beyond the scope of my discussion, but these processes generate voltages in the range of 2 mV to 40 mV and sometimes as high as 100 mV. This implies that fairly small external voltages might interfere with our physiology. But do they?

The human body model for capacitance is a 100 pf capacitor in series with a 1.5K resistor. Internal body impedance may be 300 – 1000 ohms while dry skin resistance may be well over 100K ohms. A person can fairly easily be charged up with “static electricity” to over 20,000 volts, which can result in a painful spark if discharged suddenly, but we seem to survive just fine.

static

So if our normal human body control voltages are less than 0.1 volts, how come 20,000 volts doesn't completely disrupt our system? I'm not sure why we evolved with this protection because I grew up in the jungle, running around barefoot and only wearing a pair of cotton shorts, and I don't believe I ever experienced a “static electricity” jolt in that environment.

Lets try to put the effect of static electricity in perspective with some extremely hypothetical numbers and an extremely simplified model to look at how it might be superficially analyzed:

  • Suppose we have a human body 50 cm across charged up to 5,000 volts.
  • Assume the skin impedance is 100 times greater than the internal impedance so 99% of the voltage is across the skin barrier and only 1% or 50 volts is across the internal body, which might be an internal voltage gradient during discharge of 50 volts across 50 cm or 1 volt per cm.
  • Say we have a muscle 1 cm across so there is 1 volt across the muscle during the discharge.
  • Suppose it takes 10 mV across a synapse to fire this muscle.
  • A synapse gap is only 30 nm but there could be thousands of synaptic junctions in a motor neuron. So assume the synapse cluster feeding the axon is 0.2 mm wide, this implies there might only be 0.2 mV across the synapse, which is less than the trigger voltage.

Some of these assumptions could easily be out by an order of magnitude, but you can see how a high voltage discharge from static electricity might not necessarily cause convulsions.

It could just as easily be that the discharge happens much faster than a muscle can react. I haven't seen any studies of adverse health effects or mechanics of static electricity, perhaps because the total discharge time in a year is probably only a few milliseconds. The main concern seems to be that body charge could attract particles like allergens, dust or pollutants to the facial area.

If static discharge is a concern, there are many measures that can be taken to minimize charge buildup in your body such as:

  • Wear cotton – other fabrics, especially synthetics can contribute to charge buildup
  • Keep yourself discharged by touching grounded surfaces whenever possible.
  • Increase the humidity in your area
  • The electronics industry has also developed many methods of controlling human ESD if you want to take it a step further – such as conductive shoe straps, wrist straps and ESD garments.

Clearly we can stimulate heart muscles with pacemakers that only output up to 5 volts and we can externally stimulate muscles with physiotherapy devices generating anywhere from 60 to 500V.

EMS

Defibrillators generate between 300 and 1000V. All of these devices are designed to provide more benefits than drawbacks, so there don't seem to be a lot of studies on their health risks. However these devices illustrate it doesn't require extremely high voltage to cause reactions in our bodies if the voltage is in the right location.

Moving up to mains frequencies, 50-60 Hz. At these frequencies the electric and magnetic fields will penetrate buildings and people unless they are shielded. Typical urban transmission lines can be up to 69 KV. Power lines in a house may only be 220 V but this can still result in higher fields than those from high voltage lines that are far away. Usually people know better than to touch either type of power line.

This picture defies sanity - fill in your own caption….

HighWire

Typical fields in households can range from 5 to 100 V/m. In my house it is between 2 and 5 V/m. The field close to household appliances can be from 200 to 10,000 V/m. Exposure to these fields do not cause our muscles to twitch, although some people can feel a tingle from high fields. A cursory calculation of a 50 cm body in a 200 V/m field might conclude that because these fields penetrate bodies there would be 100 volts across the body or 10 volts/cm. (Which would be more than a pacemaker directly on all muscles). However this is not what happens, the body is a dramatically better conductor than air, so you could think of it as internally shorting out the 100 volts, because not enough current can flow through air to sustain more than a few microvolts across a 1000 ohm body. Of course if you touch 2 electrodes that can supply enough current to sustain 100 volts across your body, you can receive a very dangerous shock.

Clearly, fields of hundreds of volts/m that we are all exposed to do not cause our muscles to twitch, but they do cause small voltages and currents in our bodies. The question is, are these small voltages harmful to people?

There have been many studies to try and answer this question. Some statistical studies find adverse effects such as these:

PowerLineSymptoms

While other studies find no conclusive causal evidence. For example the most definitive statistical studies indicate the incidence of leukemia in children living within 600 m of high voltage lines is double that of children living further away. But there is no known causal mechanism that explains how these fields might cause leukemia. Maybe the high fields alter something else in the environment that promotes leukemia. It would seem that real adverse effects from power lines are at most a low probability – even in the leukemia studies, of the 1 in 5,000 children that contract leukemia, less than 1% of these would be living near power lines. This is over 500 times rarer than the incidence of prostate cancer in men.

However, if you want to minimize exposure it will probably cost you money or comfort.

Perhaps you could rig a copper mesh anechoic chamber “mosquito net” over and under your bed.

One of my neighbors is going to the trouble of grounding all the aluminum siding on his house to see if it makes a difference. I will go over and take some measurements at some point during this project to see how it compares to my house.

The power lines on my street are buried underground.

OutsideELF

Here are the fields outside near my house.

ResidentialPower

Here are the fields a couple of streets away where the power is on telephone poles.

PowerLines

Here are the fields a few blocks away under power lines.

2000 volts per meter and I couldn't feel a thing.

The meter was in its red zone and beeping away to indicate high fields.

HousesNearPower

These power lines run pretty close to houses.

I don't know how safe or dangerous it is under these power lines, but the fields are up to1000 times greater than at my house - so lets go inside.

HouseBaseline

This is a normal baseline reading in my house, although the RF strength can be less if WiFi is not active.

Lets compare these readings to some household appliances:

razor

Electric Razor

computer

computer and LCD

FireAlarm

Fire Alarm

HairDryer

Hair Dryer

LEDLamp

LED Lamp

POTS Phone

POTS Phone

VacuumCleaner

Vacuum Cleaner

InductionRange

Induction Range

Conclusions

My meter has green, yellow and red bar graphs to indicate when the manufacturer thinks the fields are safe, not safe for long exposure and unsafe for even short exposure. Most household appliances are green in the ELF bands and many of them are only on for short periods. This does not mean they are all safe – for example electric razors and vacuum cleaners can and will damage your hearing if you don't take precautions, but this blog is about things you cannot sense yourself.

There are lots of studies that show correlation between high electric fields and adverse health effects, but the symptoms are generally minor and it is difficult to causally link electric fields as the true cause.

As with most things, the higher the dose the more likely it is to have an adverse effect. The standards that are in place are sufficient to protect people from immediate damage, but are generally not based on long term risks, so it is up to the individual to decide if they want to draw the line at some more conservative level.

If you are concerned, it is useful to have a good meter to know what you are being exposed to, because you probably cannot feel exposure to even very high fields.

 

Even though we are just skimming the surface of the subject, this blog is getting too long, so I will deal with microwaves in a different blog.

Still waiting for some parts and working on other blogs.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

This blog shows the Booster Pack PCB I designed to accommodate 5 sensors. After viewing the video - I think it might have been cool to order a red card instead of green.

The card was ordered from SeeedStudio and took exactly 7 days from time of order to arrive on my doorstep half way around the planet.

I don't yet have all the components to assemble the card, but the card itself and the sensors have come in so I can show roughly how the sensors will be mounted....

This is the tenth blog in this project and it is not even half complete yet, but at least there is steady progress and the biggest uncertainties have been eliminated. (getting MQTT communications running and getting the PCB and sensors delivered)

My next blog will likely start to delve into the hazards of ELF, radio waves and microwaves and how I intend to measure them.

It is possible I will have an MQTT client system working soon as well.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1

I have been in the throws of struggling with software and numerous other priority interrupts. Still ordering more parts and some have come in, but they will have to wait for another blog. I just have to get something posted even though it is not as complete as I had hoped. This installment describes a bit about trying to get an MQTT broker set up to handle sensor data from my wearable sensor suite.

First, I wanted to install my own MQTT data broker so I can keep the data local for now. After choosing Mosquitto as the broker, it took numerous attempts to install properly since not all the necessary files are included in the install file. The ancillary files have to be the correct version and there are many versions to choose from. My computer already had up to 7 versions of some of these files, so finding a working combination was a huge trial and error exercise. The error messages were generally meaningless (to me) and it was not even obvious which of the files were incompatible.

So, after scouring the net for every tutorial on the subject and digging through all the forums discussing similar issues, I finally gleaned enough information to get a workable install. None of the files I'm using are the latest version. If I knew what I as doing at the beginning, it probably would have taken 5 minutes instead of 10 hours. My biggest problem with most of these projects is understanding other people's software. Sometimes it is only tenacious persistence that gets you through.

To the best of my recollection this is where to get the files I used for installation on Windows 10 (64 bit):

  1. download and install mosquitto-1.4.9-install-win32.exe from this site https://www.eclipse.org/mosquitto/download/
  2. download and install Win32 OpenSSL v1.0.2k Light from this site Shining Light Productions - Win32 OpenSSL
  3. copy pthreadVC2.dll from this site ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/ to your mosquitto directory
  4. copy libeay32.dll from your OpenSSL-Win32 directory to your mosquitto directory
  5. copy libssl32.dll from your OpenSSL-Win32 directory to your mosquitto directory
  6. copy ssleay32.dll from your OpenSSL-Win32 directory to your mosquitto directory

I still don't know enough about MQTT (Message Queue Telemetry Transport) to teach anybody about it, but the broker program will accept data on a specified topic from a remote publishing device and allow remote subscriber devices to access the data from any specified topic.

Here is a little demo of the system working with simulated sensors...

I will publish the Launchpad code if and when it is a little more stable.

My next blog will likely be about the custom sensor PCB I designed.

 

All links to blogs related to this project can be found in the first blog here:

Safe and Sound - Invisible Hazardous Environmental Factors Monitoring System - blog 1