Network & SD Card in operation

To test out the networking operation on the unit, the previous sketch was modified to enable both local SD card writing and network broadcast of the data. This uses a modified version of the Ethernet web server example available with the Arduino software.

I was initially hoping to create a one “sketch fits all” solution as I believe the intention is to collect the data in the trial from several units possible running concurrently. Unfortunately it would appear that this will be a little more problematic than I had anticipated as each Arduino needs to be given its MAC address and IP manually. This could potentially be gotten around by using costly error catching or even random generation to prevent duplicate addresses.

However as each unit will be provided with an SD card, my currently preferred solution to will be to create a file for each unit storing the IP and MAC for that unit and have a standard sketch on all units that will read that info from the SD, removing the need for hard coding.

SD_WEB_OUTPUT

SD Output Sketch

When setting up the Ethernet shield initially the standard sketch provided by Arduino for testing was used. Once the read / write process to the SD card was verified a new sketch was produced to enable the storing of the data produced by DHT11 on the SD card.

The initial sketch produced was a based loosely on the test programs for both devices and worked well. However this crude amalgamation was thought to be taking up too much of the Arduino’s ram at 21k so was rewritten to remove some of the bloat of reducing the size down to 18.5k. This was achieved in the main part by removing the responsibility of doing temperature conversion calculations on the Aurduino and the deletion of all my wonderful comments.

The data is output in a CSV (Comma Separated Value) file that can be defined in the sketch. My initial version had Celsius, humidity and dew point all being written into one file, with the current version writing to three separate files, the final data structure will be decided once we have more of the sensors connected and have the web based back end finalized.

An initial burn test was completed over a period of three hours with the sensor being read in intervals 10000 m/s. The system worked as intended for this initial run but showed very little variance in data over that time, suggesting the temperature and humidity data may be logged at greater intervals.

SDoutputv1

The next stage will be to connect the device to a network and have it decide which storage method to use. It should be possible to have the data be written direct via a network and to the SD card for backup, however we will need to ensure we can uniquely identify each batch of data to prevent duplication.

External Data Storage

To store the data generated during the experiment we will be utilising an Arduino ethernet shiled.

This device piggybacks onto the Arduino and provides pass through for the majority of connections.

The device was chosen as this will enable both local storage, via a micro SD card accessed through the standard Arduino SD library for use in locations where network connectivity is limited,  and direct network storage via the RJ45 Ethernet port.

Network Shield label

The wiring of the board to the sensor remains the same using the pass through equivalent on the Ethernet shield.

DHT11 Connection to the Arduino

After a few initial problems with a test program designed for use with both the DHT11 & DHT22 timing out, I switched to using the standard program / sketch for use with just the DHT11. This includes the header file and CPP required as well as the test sketch.

This worked almost perfectly out of the box so to speak, but for some reason was displaying “” before the degree symbol “°”, possibly due to my windows configuration being set to UK (?) or having to access the symbol using an ALT code. This was resolved at some overhead cost by creating a new const char variable and storing the degree symbol in this.

The sensor seems fairly sensitive, being able to detect the change in temperature and humidity from breathing on the unit and should be sufficient for the main experiment.

 

DHT11 Connection                 DHT11_Output

 

DHT Pin 1 – Red Wire – Arduino 5v

DHT Pin 2 – Blue Wire – Arduino Pin 2

DHT Pin 3 – Not Connected

DHT Pin 4 – Black Wire – Arduino GND

Starting the IT artifact

BasicEquipment

The first stage of the development is to get familiar with the equipment involved and set up the first sensor.

Initially we will be utilizing the Arduino Uno as the basis for the platform with the DHT 11 Temperature and humidity sensor .

The remaining equipment displayed are all standard components, USB lead (connects the Arduino to a PC), breadboard (connecting the sensor) & pin connectors for connecting the breadboard to the Arduino.