Adding temperature and humidity sensing to an existing standard setup

Hi, I have managed to get the basic energy monitoring setup working, but I would now like to add humidity and temperature monitoring as well. I have followed this thread: http://openenergymonitor.org/emon/node/2389 and made the suggested board changes, but I am now failing miserably as to what to do next. I have uploaded the example humidity sketch but I don't know if it's working as I don't know how to setup Emoncms to read the data (if there is any) From reading through the forum I believe that I would also need to merge sketches together if I wish to gather the info from all the sensors at the same time. Is there a guide on how to do this? I fear this is a little way beyond my ability. Any help would be appreciated.

Robert Wall's picture

Re: Adding temperature and humidity sensing to an existing standard setup

Which humidity example sketch are you using? And which sketch do you want to merge it with?

PhilThy's picture

Re: Adding temperature and humidity sensing to an existing standard setup

Hi Robert, thanks for your reply.

I tried the emontx_lowpower_temperature_humidity sketch, but I'm beginning to think this might not be what I need. I would like to be able to measure power usage alongside temperature and humidity within my home, so I thought that the  EmonTx CT123 + Voltage example and a suitable temperature/humidity sketch would need to merged.

Robert Wall's picture

Re: Adding temperature and humidity sensing to an existing standard setup

OK, I'll have a look at those tomorrow later today ( ! ). It should be fairly easy to merge the sketches: what needs to be done is start with the voltage & current sketch, and add in the humidity part without duplicating anything that's already there. There are two ways to play this: either I can do it all for you - but I won't be able to test it as I haven't got a humidity sensor, or I can steer you through the process. The latter will be far better for you in learning how to do it yourself. Can you give me an honest guide to your knowledge of programming?

But first, you'll want to check that your sensor is working. In the humidity sketch, find the lines:

  emontx.humidity = dht.readHumidity();
  emontx.temp2 = dht.readTemperature();

 

and add after them:

Serial.print("Humidity =  "; Serial.print(emontx.humidity); 
Serial.print("   Temp = "); Serial.println(emontx.temp2);

That will display the two values on the serial monitor every few seconds.

 

PhilThy's picture

Re: Adding temperature and humidity sensing to an existing standard setup

Hi Robert, many thank for your offer of help.

My knowledge of programming is basically nil, however I can see the need for me to be able grasp the basics, so its probably best if do this myself with some help. I am a Linux (Slackware) user, so I can find my way around in console and I can do some basic (very) bash scripting.

 

I've had a look in the humidity sketch for those lines but I can't find an exact match. The lines I have are:

emontx.humidity = ((dht.readHumidity())*10);
emontx.temp = ((dht.readTemperature())*10);

Are we looking at different sketches?

 

I will have to get back to this later today as work is demanding my attention!

 

Phil T.

Robert Wall's picture

Re: Adding temperature and humidity sensing to an existing standard setup

Ah - found your sketch (I think). It is https://raw.github.com/openenergymonitor/emonTxFirmware/master/emonTx_te...

I was looking at https://raw.github.com/openenergymonitor/emonTxFirmware/master/emonTx_te...

We were looking at different sketches, then, but the lines are equivalent. In your sketch, you've got a Serial.print already for humidity, is that not working?

As this might be a long drawn out process, it's probably best if we do it via PM or, considering attachments are not allowed in PMs, by private email. It might be helpful to get G&T to put the end result onto Github.

(If anyone else reading this wants to join in, shout up now and I'll reconsider.)

PhilThy's picture

Re: Adding temperature and humidity sensing to an existing standard setup

Hi Robert, I've pm'd you my email address.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.