Hard Wired Sensors?

Hi,

I'm new to the OpenEnergyMonitor site, so firstly I'd like to say it looks pretty cool. 

I would like to start off collecting voltage, current and temperature data from my switchboard location.  However, I'd like to have my sensors hard wired to the base station. But after looking through the available modules it looks as though a hard wired option is not provided.  Is this correct?  Is someone able to point me in the direction of someone who has hard wired the sensors?

I've had a search for 'hard wired' in the forums, and there is one or two posts about hard wired, but nothing I have found has too much substance on it.

Thanks for your time.

sumnerboy's picture

Re: Hard Wired Sensors?

I am trying to do the same thing, and am a new user as well. I have bought the EmonTX Arduino shield and have attached that to an Uno + Ethernet shield. I then modified the standard sketch to post sensor readings to MQTT topics over Ethernet. I then have a mosquitto broker running on my home server and can subscribe to those energy readings by multiple systems.

Happy to share my sketch if you are interested? I am away on holiday currently but will be back home towards the end of next week.

pb66's picture

Re: Hard Wired Sensors?

Hi apjb

The "sensors" are hardwired to the emonTX and an emonBase can easily be hardwired to a network using an Ethernet lead. These two items can also be hard wired together.

There isn't currently a mainstream single device solution, that's not to say it's not possible but generally the arduino chips are more suited to processing the sensor measurements and the Pi is better suited to the networking and databasing etc

The most common base is currently a Raspberry Pi but it can be a PC or a Nanode etc. the nodes are arduino based and whilst the norm is currently to use a rf network to interconnect the nodes to a base, there is an emonpi in development and in the meantime it is possible to connect a via serial link.

So If you have ethernet or wifi at you consumer unit I would recommend using a pi and emontx

Paul

inquisitive student's picture

Re: Hard Wired Sensors?

Hello everyone,

I have no electrical knowledge and therefore am coming at this from a very weak position, but I am in my final year of an innovation course and would really like to get the sensors inside the individual plug socket and use powerline technology to transmit the data back to an internet point for transmission.  I believe that theoretically my idea is possible, but technically challenged at the miniaturisation stage.  There are sensors available, but they are considered to be vulnerable to power spikes.  What do you think?

Many thanks.

Michael.

Robert Wall's picture

Re: Hard Wired Sensors?

Anything connected to the mains is vulnerable to spikes. It's a matter of degree - how big are the spikes and how well protected is the connected equipment. Someone new reading this thread should see my replies to 'inquisitive student' at http://openenergymonitor.org/emon/node/5223

Have you checked the Atmel App. Notes on which the emonTx design is based? Have you looked at other integrated circuits that are designed for metering applications, and their applications data? Have you looked at current sensing devices (Hall effect and the like)? Have you looked at mains carrier devices? Have you looked at the power and space requirements for all of these things?

We don't mind helping you and pointing you in the right direction, but we shouldn't be doing your Honours degree final year project for you, it's for you to do the research and come up with proposals or a viable design.

inquisitive student's picture

Re: Hard Wired Sensors?

Dear Robert,

Thank you for the steer and the reprimand. I will research all that you have highlighted above and apologise for wasting people's time. 

Kind regards. 

Michael. 

Robert Wall's picture

Re: Hard Wired Sensors?

The way I look at it is this: I'm trying to protect your interests in the longer term. If we (collectively) do a major part of your project for you, then there are two possible scenarios that are best avoided. If your tutors find out and decide you've not done enough on your own, you will be downmarked heavily. If they don't and you progress to your first job and then don't live up to expectations, you'll be out on your ear. Learning how to research and know what questions to ask is an important part of the learning process. And you haven't wasted my time, you're part of the future. I have no problem with helping and steering people, but it wouldn't be fair to do your project for you. It might be acceptable in some cultures, it isn't in mine. The same friend who had his mains carrier local network blown up was the head of undergraduate studies in the department at a well-respected red-brick University near me. The procedure there was: anybody found guilty of plagiarism would at best be required to resubmit the work. At worst, they would fail the course.

inquisitive student's picture

Re: Hard Wired Sensors?

Dear Robert,

I respect and understand your views and position and can assure you that I am not wishing to take any shortcuts. I have carried out extensive research through the university library and on line and am struggling to find any research papers that connect the gaps between data collection for a property as a whole and for individual sockets. 

My course is a business one and therefore, as mentioned previously, my technical knowledge is limited. I do not want to be handed the answers, simply pointed in the right direction, which you have very kindly done.

I have a few friends and business colleagues (I have been working for 27 years) who run their own energy monitoring companies, but who struggle with the concept that I am presenting and it seems to me that they are having difficulty relating to what I see as being the fundamental issue here in the UK. Consumers don't understand the information that they are being presented with, because they cannot relate to it eg 1Kwh means nothing to the average Joe, but telling them that their TV run for 10 hours, sitting on stand by has cost the £0.13 gets the message home to them. 

The development of sensors in the sockets, feeding back to a central server, which could be used to produce localised league tables and allow local government to run reward schemes based on energy consumption reduction, is just one idea that I believe could arise from such a system. There are many more. 

My enquiries are not to seek a quick answer to my course work, but to understand the challenges that my vision faces to enable me to investigate fully the various solutions and identify the best route of research and development to follow. With regards plagiarism, surely I would only be exposing myself to such claims if I was trying to convince everyone that  the content of my reports was based solely on my own thoughts and as I will always be applying the Harvard referencing system to my work, I will avoid this. 

If it is acceptable to everyone, I will continue to review articles and comments on this site as a source of direction for my work and this may result in me asking more questions than I am providing answers, but hopefully that will stimulate debate and increase knowledge and understanding for everyone involved, in all matters that relate to this project e.g. social perceptions and needs with regards energy consumption, not just the technical aspects. 

Thank you very much for your continued support and understanding. 

Kind regards. 

apjb's picture

Re: Hard Wired Sensors?

Sumnerboy - Thanks for your offer to provide your sketch, if you have some spare time to post it, that would be great.  I have zero experience in Arduinos, but it looks like it is something I should be learning.  My final year project (some years ago now) was using the Pic microcontrollers, but I haven't had much of a mess around with mico controllers since that time.

Thanks.

apjb's picture

Re: Hard Wired Sensors?

Hi Paul (PB66),

Thanks for your reply... "These two items can be hard wired together".  This is the part that I'm interested in.  

I'm happy for the Arduino to do the sensor processing and the Pi to do the networking & databasing.  But I was just wondering if people out there had hardwired the emonTX and the base unit (Pi) together - for no other reason than a personal preference to try and limit wireless devices at home and that a hard wired connection has better reliability than a wireless.

The Wiki page seems to be down at the moment, but I'll check out your links once it's working again.

ahhk's picture

Re: Hard Wired Sensors?

Hej,

i want to do exactly the same thing: Arduino+Shild sends MQTT-Messages to Mosquitto! Great! Would you share your sketch with me, too?

Greetings

Andreas

sumnerboy's picture

Re: Hard Wired Sensors?

Here is my sketch. You just need to update the various MQTT connection properties, and probably rename the publish topics depending on what you have your CTs monitoring. This is working quite nicely for me currently so will see how it goes long term.

I am using mqttwarn (https://github.com/jpmens/mqttwarn) to monitor the MQTT topics and generate a feed for EmonCMS. Happy to share this config as well if anyone is interested? Really impressed with EmonCMS as an energy dashboard and reporting tool. Still learning about all the feed processors and config but am getting there slowly.

I am also monitoring these topics in openHAB (www.openhab.org) so I can interact with my home automation system - currently nothing setup but have some plans for both visual indications (i.e. RGB LEDs changing colour depending on import/export status) and load control (i.e. flick on heated towel rails in winter if I have excess solar). All fun stuff!

I have read that Robin has a sketch for 'continuous' monitoring of CT sensors but I can't for the life of me find an example of this. Can someone point me in the right direction? I would prefer a more accurate measurement rather than the current method of only taking a reading every 5s.

 

ahhk's picture

Re: Hard Wired Sensors?

Hi,

 

thx for the code. i will study it in the next days.

i wrote my own function to transmit float values via mqtt - it works great:

 

void MqttSendDigitalVAlue(char *topic,float input)
{
  char tempbuf[10];
  dtostrf(input,sizeof(tempbuf),2,tempbuf);
  int i=0;
  while (tempbuf[i]==32) i++; //32=ascii-code space-key
char outbuffer[sizeof(tempbuf)-i];
  for (int x=0;i<=sizeof(tempbuf);i++)
    {
     outbuffer[x++]=tempbuf[i];
    }
   Serial.print("outbuffer :");Serial.println(outbuffer);
if(!client.connect("ENV0"))  client.connect("ENV0");
client.publish(topic,outbuffer);
}

 

Unfortunaly i think my emontx-shield is damaged. Only CT1 shows correct values. CT2-CT4 show something around 250.000 Watts and my Voltage-reading is around 80Volt. Some days ago, everything was fine and i dont know how to find the problem :( Or can this be a problem with the ethernet shield between the emontxshield and the uno ??

 

Robert Wall's picture

Re: Hard Wired Sensors?

"Unfortunaly i think my emontx-shield is damaged. Only CT1 shows correct values. CT2-CT4 show something around 250.000 Watts and my Voltage-reading is around 80Volt. Some days ago, everything was fine and i dont know how to find the problem :( Or can this be a problem with the ethernet shield between the emontxshield and the uno ??"

What do you mean by "between the emontxshield and the uno"? The shield is only input circuitry. All the conversion from analogue to digital and the computation is done inside the Arduino.

Start by using a multimeter to check voltages. First check the supply voltage (5 V?). With no inputs, the voltage (dc) on the CT sockets and the AC adapter socket should be half-supply (2.5 V with a 5 V supply). You should see the same on the Arduino analogue input pins. If that's OK, download the appropriate sketch of Robin's from http://openenergymonitor.org/emon/node/1757 and check the waveforms with the CTs and voltage input connected. The ones to use are probably MinMaxAndRangeChecker and RawSamplesTool_4ss_2 (you'll need to check and possibly change the input pins). If the numbers are within range (between but not hitting 0 and 1023 and centred close to 512) and the shapes of the waves look sensible and centred, reload your sketch and use the serial monitor to check the powers before they are despatched to wherever they are going.

ahhk's picture

Re: Hard Wired Sensors?

Hi,

from bottom to top: Uno => Ethernet-Shield => EmonTX.

I will check this today evening. Thx.

Comment viewing options

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