Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Multiple DS18B20 temperature sensors and Emon Tx v3

Hello!

I use emontx v3 with 3-phase firmware. Electricity measurement works just fine. Additionally I neen to connect eight ds18b20 temperature sensors using RJ-45 connection and two breakout boards (purchased from online shop here on this site).

Unfortunately I can see reading only from 1 sensor. Connecting two and more sensors shown error “300”.

How I can see data from 8 temperature sensors?

Dmitry

You cannot have 8 sensors with that sketch. Reading the sensors takes a lot of time away from the processor, and it will lose phase lock and fail to read the power values correctly. As the documentation states: “Integrated temperature measurement (one DS18B20 sensor).”

You will need to use a separate emonTx, or (cheaper) an Arduino, and even then, you will need to modify the standard sketch so that it will return the 8 readings.

@Dmitry I suspected that would be the answer.

The cheap solution is a WEMOS D1 Mini and Tasmota (my preferred) or ESPHome. I have exactly that setup.

Works a treat.

Would also work with a PiZero

1 Like

Thank you very much for prompt replies.

Unfortunately , I’m not an experienced programmer… and it’s difficult for me to understand how quickly show data from wemos or Arduino in my dashboard.

Let me explain you my needs:

This Friday I will travel 150 km from Dubai to Al Ain to my container with CoolTank (www.thecooltank.com) to install temperature monitoring system. I’d like to have temperature readings on local Emoncms Dashboard (it’s already working with 1 sensor). I also have other equipment: emonPi, 2x RJ-45 breakout boards, 8 sensors, Arduino Leonardo.

By the way, my temperature monitoring system with 8 sensors already implemented on Arduino Leonardo, but I enjoyed Emoncms dashboard and would like to use it together with electricity monitoring.

Do you have a simple solution of how I could have 8 temperature readings in my dashboard on Emoncms?

Thanks for advice. That could work for me. How I should modify sketch?

If you have your temperature monitoring working on an Arduino Leonardo, then the easiest solution is to use that. You will need to get the data to the server that runs your emonCMS.

If it is a local Raspberry Pi, then you can use a serial connection that is documented here:
Wiki:
https://wiki.openenergymonitor.org/index.php/EmonTx_V3.4#Direct_connection_emonTx_V3_.3E_Raspberry_Pi_GPIO
(Clearly, you use the Tx and Rx data pins that are in a different place on your Leonardo to the emonTx).
A little more information is here:

Wiring diagram: 4 CT emonBase using emonTx and Pi Zero W - #17 by pb66

If it is your emonPi, I understand you can use any GPIO pin for a second serial data input, but I am not a RPi expert so I cannot give you the details.

If the server running emonCMS is some distance away (or it is emoncms.org), then most likely the easiest solution is still to connect serially to a Raspberry Pi running emonCMS but send the data via your LAN or the Internet to the emonCMS where you have the dashboard.

If you have a WiFi LAN, then you can use the serial connection again, but this time to a Pi Zero W (which does not have an Ethernet socket, so you cannot use it with a wired LAN).

Thank you very much for your advice. There’s a good information for consideration…

It’s not clear for me how to modify firmware after connecting Arduino to RPi…

I think I have an idea how fix my problem. I will try the following options:

  1. use emonPi to read 6 sensors
  2. use emontx v3 (3-phase) to read 1 sensor

Later

  1. use 3 x emonTx V3 (standard firmware) to read 3 sensors each, total 9 sensors
  2. remove emonPi

For me it’s the easiest way… Will it work?

It will work, and the power readings are likely to be more accurate, but you will still need a server running emonCMS somewhere to accept the data from the 3 emonTx’s.

The change you must make to your Arduino sketch is only to the format in which the data is sent to emonhub. You must send the data as “name:value,” for each sensor. For example (3 sensors):

    Serial.print(F("T1:")); Serial.print(T1);
    Serial.print(F(",T2:")); Serial.print(T2);
    Serial.print(F(",T3:")); Serial.println(T3); 

Then in emonhub.conf, you must have this interfacer to receive the data:

    [[SerialTx]]
         Type = EmonHubTx3eInterfacer
          [[[init_settings]]]
               com_port= /dev/ttyAMA0
               com_baud = 115200
          [[[runtimesettings]]]
               pubchannels = ToEmonCMS,

               nodeoffset = 1

Note the comma after the pubchannels line and the blank line. As the data comes in as name:value pairs, there is no need for a node definition to decode the data, so for the nodeoffset, choose an unused number (0-4) or if you want to use a NodeID for which there already is a node definition, delete that node definition.

A very big problem that continues to confuse everyone: Tx and Rx are swapped on the emonTx pcb, so as I’ve written so many times here, the emonTx is sending data on the pin labelled “Rx”, and it’s looking for data coming in on the pin labelled “Tx”. That will not be the case with your Arduino, so be careful when looking at the instructions for connecting the emonTx

This is really helpful! Thank you. I’ll post a report.

It was simple. I just used emonPi to read 6 temperature sensors.