Connecting DS18B20 temperature sensor to emonTx shield

I’m using an emonTx shield with an Arduino Uno v3. I can’t find any documentation about which of the three wires (red, black, white) on the sensor go into which holes. I also don’t see any examples about reading the temp while I read the power values. Any advice?

There is an article in Resources > Building Blocks that details the connections.

I had not noticed, but there is indeed no sketch for the emonTx Shield that measures temperature. You’ll need to look at one of the emonTx (non-shield) sketches and graft into your sketch the temperature parts from that. I don’t have a Shield nor an Arduino, so although it wouldn’t be too hard to graft the appropriate parts into a Shield sketch, I wouldn’t be able to test it.

(You’ll probably need the circuit diagrams from the Wikis to check the I/O pins etc.)

I’ve found the connection information. Does the emonTx shield already have the 4.7K resistor installed?

Yes, it does. It’s R24. See schematic.

I have just connected up a temp probe to my TX Shield but i think i need to change to a new Sketch with the temp sensor code in it. Which sketch should i use as the current volts one i am using does not at the moment include the temp code?
Will any of the EmonTX V2 or V3 sketches work with the TX shield?

Unfortunately, there isn’t a sketch for the Shield that incorporates temperature sensing. So a little work is needed.

I suggest you start with the sketch that you have, and incorporate the temperature sensing code from one of the emonTx V3 sketches. That will probably be easier, quicker and safer than stripping the unnecessary parts (DIP switches etc) out of the emonTx sketch to convert it.
I think everything you need either has “temp”, “sensors” or “DS18B20” in the name or in a nearby comment - but you don’t need (unless you implement it yourself via an output) the power switching for the sensors.

Ask again if you run into problems.

ThanksRobert for the information, i will investigate further over the weekend to see if i can build a new sketch by adding in the extra sections of code.

I’m afraid that if I do it, I can’t test because I have neither Arduino nor Shield.