The DHT11 temperature-humidity sensors pt 2

Here’s the graphs from my recent experiment, and here’s the data.

Temperature from 11 DHT11 sensors over 22900 data readings for each sensor

Temperature from 11 DHT11 sensors over 22900 data readings for each sensor

Humidity from 11 DHT11 sensors over 22900 data readings for each sensor

Humidity from 11 DHT11 sensors over 22900 data readings for each sensor

min, avg, max and variance of temperature from 11 DHT11 sensors over 22900 data readings for each sensor

min, avg, max and variance of temperature from 11 DHT11 sensors over 22900 data readings for each sensor

min, avg, max and variance of humidity from 11 DHT11 sensors over 22900 data readings for each sensor

min, avg, max and variance of humidity from 11 DHT11 sensors over 22900 data readings for each sensor

and a brief video…

The DHT11 temperature-humidity sensors

So I have loads of these from an old project that you guessed it – I never got round to, but how accurate are these cheapest of cheap things?

Set up an Arduino/RasPi with all the sensors and get it to read them all back – if all in one location then they should all be the same right? Lets see how accurate they are! I’ll run the test for a week (probably longer) with various conditions and then report back.

oh and some code….


// origional code from ladyada, public domain
#include "DHT.h"
#include
#include

DHT dht0(2, DHT11);
DHT dht1(3, DHT11);
DHT dht2(5, DHT11);
DHT dht3(6, DHT11);
DHT dht4(7, DHT11);
DHT dht5(8, DHT11);
DHT dht6(9, DHT11);
DHT dht7(A0, DHT11);
DHT dht8(A1, DHT11);
DHT dht9(A2, DHT11);
//older sensors
DHT dht10(A4, DHT11);
DHT dht11(A5, DHT11);

float temps[12];
float hmids[12];

void setup() {
Serial.begin(9600);
Serial.println("DHT test!");
dht0.begin();
dht1.begin();
dht2.begin();
dht3.begin();
dht4.begin();
dht5.begin();
dht6.begin();
dht7.begin();
dht8.begin();
dht9.begin();
dht10.begin();
dht11.begin();
SD.begin(4);
}

void loop() {
// Wait a few seconds between measurements.
delay(30000);

hmids[0] = dht0.readHumidity();
temps[0]= dht0.readTemperature();

hmids[1] = dht1.readHumidity();
temps[1]= dht1.readTemperature();

hmids[2] = dht2.readHumidity();
temps[2]= dht2.readTemperature();

hmids[3] = dht3.readHumidity();
temps[3]= dht3.readTemperature();

hmids[4] = dht4.readHumidity();
temps[4]= dht4.readTemperature();

hmids[5] = dht5.readHumidity();
temps[5]= dht5.readTemperature();

hmids[6] = dht6.readHumidity();
temps[6]= dht6.readTemperature();

hmids[7] = dht7.readHumidity();
temps[7]= dht7.readTemperature();

hmids[8] = dht8.readHumidity();
temps[8]= dht8.readTemperature();

hmids[9] = dht9.readHumidity();
temps[9]= dht9.readTemperature();

hmids[10] = dht10.readHumidity();
temps[10]= dht10.readTemperature();

hmids[11] = dht11.readHumidity();
temps[11]= dht11.readTemperature();

Serial.print("Temps ");
for (int i=0;i<12;i++)
{
Serial.print(temps[i]);
Serial.print(", ");
}
Serial.println();

Serial.print("humids ");
for (int i=0;i<12;i++)
{
Serial.print(hmids[i]);
Serial.print(", ");
}
Serial.println();

//write data to SD card
File dataFile = SD.open("dhtdata.txt", FILE_WRITE);
if (dataFile) {
dataFile.print("Temps, ");
for(int i=0;i<11;i++)
{
dataFile.print(temps[i]);
dataFile.print(", ");
}

dataFile.print("Humids, ");
for(int i=0;i<11;i++)
{
dataFile.print(hmids[i]);
dataFile.print(", ");
}
dataFile.println(';');

dataFile.close();
}

//Serial.println(t);
}

Hyper-V and Vlans

So I’ve now got 2 identical hosts running server 2012 datacenter, with VM’s on both. Now it’s time to get them talking to one and other. Simple right, just sit them all on ‘external’ virtual switches and they can use the physical network to talk to each other. Great except… I don’t really want my test environment hooked upto my live environment, not do I want to change my existing DHCP server settings or have two on the same broadcast domain!

So, Hyper V can use VLANs to segregate traffic. This is the way forward for me.

  1. 1 create a new VLAN for the test environment,
  2. tag the ports for the VLAN,
  3. put all VMs on the new VLAN…
  4. oh and change the management VLAN in the virtual switch manager for the hosts…

Groovey now I can talk to the host over my LAN (on VLAN 1) and the VMs can talk to each other on VLAN 200, but they as VLANs are completely segregated in terms of broadcast domains (for DHCP) and packets. Now I can set up a (virtual) router to bridge between them. PFSENCE time.

Oopsie, server failure

So just turned my server on to play with Hyper V stuffage, and hummmm…. it wont pass POST. It beeps telling me there’s a RAID failure, but then dies before showing me the diagnostics page that it would normally show… HuMmM!

SO, pop the hood, thinking maybe it’s a RAM failure and I knocked a CPU heat sink… which then fell off. Think I’ve found the problem then.

Oh, and then I’ve run into this again….

SLAT error :/

SLAT error :/

Time to break out Server 2012 DC edition again….Which also doesn’t like the server, time to break out the server 2008 disk, which supports SLAT, but didn’t require it. Might have better luck with it. Only problem there is that Server 2008 doesn’t support live migration and replication in the way that 2012 does :/.

*As a heads up for anyone wanting to play around – save some time and do some research on your processor. It needs to be 64bit, support Intel VT-x and Intel VT-x with Extended Page Tables (EPT). The best place to find this information is in the Intel ARK if you are using Intel proc’s. Have a look at my proc’s here. *

Hyper-V = Hyper Frustrating

So it’s about time that I pick up with my Microsoft certs, seeing as I’m now back in IT. I should have done them a long time ago, but nvm. Now’s a good a time as any.

The first thing when embarking on a challenge like this is to set some goals: I want to be MCSE certified within a year, and I don’t want to spend too much time (or money) doing it. I also want it to be useful to me (and look good on my CV). Choosing the right track is also important. Have a look at a recent road map here.

I’m choosing the server route. I’m yet to decide which of the MCSE’s within the route I want, but the first three exams are all the same.  So 410,411 and 412 to start with. I have a good grounding in MS server tech, having built domains from scratch in the win2k days and working for a length of time in a win 2k3/xp+win7 environment, so I don’t think it’ll be too difficult to move the core skills into the 2012  exam direction.

First things first…

… I’ll be using a set of study books 410, 411 and 412, they don’t really cost that much and should be a good resource for the exams. I’ll also be using various Microsoft Virtual Academy resources as I go. I can’t tell you which ones as I haven’t had an in depth look as of yet.

The most important thing I’ll be using in my test environment. This will be key, as there’s no better way to understand how things work that to get stuck in making them work, breaking them, and fixing them again. It’ll also allow me to experiment with redundancy in a safe way, as I really do like pulling network cables out and watching things fail over.

My test environment will be made from a few machines sitting on my home network. The first is my old workstation, 8GB RAM with Intel Core 2 Quad Q9300. I downloaded my images from MS tech-net for 2012 and 8.1 evals (and the tech previews for Win 10) and proceeded to install Hyper-V Server 2012 as a hypervisor for my VM’s which I shall use.

FAIL#1 So Hyper-V Server is a server core install with no GUI. Which is great if you know all of the powershell, but I find it easier with a GUI. So, another OS is needed. (I could have left Win7 on the machine and use virtualbox, which is my preferred desktop VM solution, but I thought Hyper-V would be a more interesting learning curve.) So onto Win8.1….

FAIL#2 win 8.1 – no slats?, i’ll be honest I don’t really know why this is in place, nore do I really care. It’s only because i’m running old hardware (I did say I was doing this on the cheap). Off to Windows Server 2012 datacenter it is then.

FAIL#3 managed to install Win Serv 2012 DC, but processor visualization was disable in the bios. Turned it on, and voila – a working Hyper-V host.

Lets go virtual

Got it up and running surprisingly quickly too.1 server os choice

So I managed to get a few VM’s up and running, and all talking to each other via a Hyper-V virtual switch (bridged to my home LAN also). WINNING!

New server time

So my other host will be a dual quad core Xeon X5355  system with 32GB of RAM. NICE. It’s an older Intel 1u rack server with 8 SAS drives in the enclosure (although I only have one actual drive).  Anyway here’s some Windows experience numbers.

results

Pretty good on the CPU and RAM, which is always good 😀 – the mobo is Intel S5000pal 

Here’s some pics.

a pic of the server with the lid off and some RAM removed for testing purposes. Check out all the fans.

a pic of the server with the lid off and some RAM removed for testing purposes. Check out all the fans.

The BIOS loading page.

The BIOS loading page.

CPU cores :)

CPU cores 🙂

SAS drive performance.

SAS drive performance.

Intel s5000pal motherboard

Intel s5000pal motherboard

additional SATA ports on the motherboard

additional SATA ports on the motherboard

a funky shot of the SAS drive bays

a funky shot of the SAS drive bays

code for parallel bit bang

I’ve just uploaded a video showing an update to driving ws2801 strings. This code is for driving them in parallel serial data strings, rather than sequential serial.

#define numleds 32
#define ledsperline 8
#define updatespeed 0
//this code is written for 4 lines of serial data!
int RED[numleds];
int GREEN[numleds];
int BLUE[numleds];
//
//line pin def's
int clockpin1 = 2;
int dataPin1 = 3;
int clockpin2 = 4;
int dataPin2 = 5;
int clockpin3 = 6;
int dataPin3 = 7;
int clockpin4 = 8;
int dataPin4 = 9;
//
//setup stuff
void setup()
{
//pinMode(13, OUTPUT);
pinMode(clockpin1, OUTPUT);
pinMode(dataPin1, OUTPUT);
pinMode(clockpin2, OUTPUT);
pinMode(dataPin2, OUTPUT);
pinMode(clockpin3, OUTPUT);
pinMode(dataPin3, OUTPUT);
pinMode(clockpin4, OUTPUT);
pinMode(dataPin4, OUTPUT);
for (int i = 0; i < numleds; i = i++)
{RED[i]=0;GREEN[i]=0;BLUE[i]=0;}
}
//
void loop() {
for(int l=0;l<32;l++){
RED[l]=l*8+1;BLUE[l]=0;
updatestring();
delay(updatespeed);
}
for(int l=0;l<32;l++){
GREEN[l]=l*8+1;RED[l]=0;
updatestring();
delay(updatespeed);
}
for(int l=0;l<32;l++){
BLUE[l]=l*8+1;GREEN[l]=0;
updatestring();
delay(updatespeed);
}
}
//
//main loop
void loop1() {
//assumption made that blue is on...
//fade to purple
for (int i=0;i<256;i++)
{for (int l=0;l<32;l++)
{RED[l]=i;}
updatestring();
}
//fade to red
for (int i=0;i<256;i++)
{for (int l=0;l<32;l++)
{BLUE[l]=255-i;}
updatestring();
}
//fade to yellow
for (int i=0;i<256;i++)
{for (int l=0;l<32;l++)
{GREEN[l]=i;}
updatestring();
}
//fade to green
for (int i=0;i<256;i++)
{for (int l=0;l<32;l++)
{RED[l]=255-i;}
updatestring();
}
//fade to cyan
for (int i=0;i<256;i++)
{for (int l=0;l<32;l++)
{BLUE[l]=i;}
updatestring();
}
//fade to blue
for (int i=0;i<256;i++)
{for (int l=0;l<32;l++) {GREEN[l]=255-i;}
updatestring();
}
}
//
//update function
void updatestring() {
for (int i =0;i<ledsperline;i++)
{
shiftOut1( BLUE[i],BLUE[i+ledsperline],BLUE[i+2*ledsperline],BLUE[i+3*ledsperline]);
shiftOut1( GREEN[i],GREEN[i+ledsperline],GREEN[i+2*ledsperline],GREEN[i+3*ledsperline]);
shiftOut1( RED[i],RED[i+ledsperline],RED[i+2*ledsperline],RED[i+3*ledsperline]);
}
for (int i =0;i<ledsperline;i++)
{
//shiftOut1(dataPin2, clockpin2, BLUE[i+ledsperline]);
//shiftOut1(dataPin2, clockpin2, GREEN[i+ledsperline]);
//shiftOut1(dataPin2, clockpin2, RED[i+ledsperline]);
}
for (int i =0;i<ledsperline;i++)
{
//shiftOut1(dataPin3, clockpin3, BLUE[i+2*ledsperline]);
//shiftOut1(dataPin3, clockpin3, GREEN[i+2*ledsperline]);
//shiftOut1(dataPin3, clockpin3, RED[i+2*ledsperline]);
}
for (int i =0;i<ledsperline;i++)
{
//shiftOut1(dataPin4, clockpin4, BLUE[i+3*ledsperline]);
//shiftOut1(dataPin4, clockpin4, GREEN[i+3*ledsperline]);
//shiftOut1(dataPin4, clockpin4, RED[i+3*ledsperline]);
}
//eerr
//delay(1);
delayMicroseconds(900);
}
//
//shift out fn
//http://forum.arduino.cc/index.php?topic=45529.0
void shiftOut1(uint8_t val1,uint8_t val2,uint8_t val3,uint8_t val4)
{
uint8_t i;
//
for (i = 0; i < 8; i++) {
digitalWrite(dataPin1, !!(val1 & (1 << (7 - i))));
digitalWrite(dataPin2, !!(val2 & (1 << (7 - i))));
digitalWrite(dataPin3, !!(val3 & (1 << (7 - i))));
digitalWrite(dataPin4, !!(val4 & (1 << (7 - i))));
digitalWrite(clockpin1, HIGH);
digitalWrite(clockpin2, HIGH);
digitalWrite(clockpin3, HIGH);
digitalWrite(clockpin4, HIGH);
digitalWrite(clockpin1, LOW);
digitalWrite(clockpin2, LOW);
digitalWrite(clockpin3, LOW);
digitalWrite(clockpin4, LOW);
}
//
}

40W CO2 Laser Engraving and Cutting Machine

So my old DIY laser cutter was a great experiment, but unfortunately the laser just wasn’t powerful enough, so I brought a new one.

It’s a “40watt” laser, and it’s pretty much the cheapest of the cheap. There are numerous problems and safety concerns with the product, but providing you’re not silly then nothing should go wrong.

After unboxing my cutter, I was disappointed in the build quality. But then, what was I expecting for a product that cost almost as much to ship as it actually cost…. and for less than £400 (all in) it’s a bargain. It took a while to get working, mainly due to the fact that it didn’t home correctly, which meant some investigation work with my multimeter. After finding the offending broken wire and bodging a repair, it was working OK.

40w laser cutter

40w laser cutter

The software was pretty easy to use, and I was up engraving and cutting within an hour or so of aligning the mirrors (yes you need to do this yourself). It’s a little bit Quirky, but for the money you can’t complain.

Some future mods will include,

  • Air assist,
  • Water temp and flow rate sensors,
  • New extraction system,
  • Increasing the cutting area.