I have plugged my temp sensor into my emontx and run the temp_search sketch and get no output. I have modified the sketch to output the number of devices and it is zero.
int numberOfDevices = sensors.getDeviceCount();
Serial.print(numberOfDevices);
Any ideas why it would not be recognised. I have tried two different sensors and get the same result.
Thanks
Jon
Re: Temp sensor not found
Did you connect all 3 wires correct or do you only want to use a 2 wire interface? Because then you need a pull up on the data wire and to connect VCC and VDD of the sensor together.
Re: Temp sensor not found
I have connected it to a 3.5mm jack as explained here http://openenergymonitor.org/emon/buildingblocks/DS18B20-temperature-sensing under the "Temperature Sensing with the emonTx" section. It doesnt seem to say anything about connecting VCC & VDD?
Re: Temp sensor not found
Is the plug fully home and Is the socket making 3 good connections? Also check that the tip of the plug is connected to the tag that the wire is soldered to - with a meter. In the past both these problems have shown up. Is R9 (4k7 across and almost touching the back of the socket) present and correct?
Re: Temp sensor not found
If all connections are ok try to switch off the power and plug it in after a few seconds.
Install the standard "Temperature search" sketch , leave the programming cable connected and start the serial monitor in the arduino software (Menu Tools -> Serial monitor). Then power up the EmonTX. After that you should see the adress of the connected sensor(s).
Re: Temp sensor not found
The standard "Temperature Search" sketch gives no output at all. That why i modified it to also output the number of sensors found which is zero (hence no output from the standard sketch).
The 3.5 jack is full inserted and has a good connection. The resister is also present and correct.
Is it worth checking voltages? If so what should I check and what should they be?
Jon
Re: Temp sensor not found
The data line is digital, so you won't read anything sensible there unless you have a 'scope or data analyser and can see the data going past. Otherwise, you should see the supply voltage (3.3 V) as per the building blocks page you quoted above.
Re: Temp sensor not found
Without the sensor plugged in I have 3.9v at the bottom 5v in the middle and grd at the top looking at the emonTX board as shown in most pictures on the site.
Re: Temp sensor not found
Those voltages look believable. Some more points to check:
Have you correctly identified tip and ring connections in the plug?
What type and length of cable are you using? If screened, has the insulation of the data bus (DQ) melted when you soldered and shorted it to the screen? Check both ends.
Do you read the same voltages at the sensor when it is plugged in?
How many wires are you using? - the diagram shows both two-wire and 3-wire schemes. If you are using 2 wires, you link GND & Vdd and there is no connection to the ring of the plug. If you are using 3 wires, you use all 3 connections in the plug:
GND + Vdd
Did you connect any pin to less than -0.5 V or more than +6 V relative to ground at any time?
Re: Temp sensor not found
Thanks Robert. I followed your notes and got it working on the 2-wire interface.
Much appreciated