Temperatures search sketch problem SOLVED

Hi all,

 

I'm trying to get my emonTX to take temperature readings from a DS18B20 (with the plan to add more sensors later). I have made a temperature sensor wired up to a jack plug. I tried to upload the temperature search sketch, but I couldn't get anything to come up on the serial monitor. I then realised that a wire had come loose on the temp sensor (due to some dodgy soldering!).

If I'm reading the code correctly, there still should have been something on the serial monitor, as the setup creates a couple of lines of text;

delay(1000);
  Serial.begin(9600);
  Serial.println("Temperature search");
  Serial.println("waiting 6 seconds before printing");
  delay(6000);

This should work regardless of whether the temp sensor was working or not, I am correct?

I'm using the USB to serial UART programmer from the Openenergy store. I assume this can be used for serial monitoring?

I'm a bit of a noob here so could be making a rookie error!

 

Thanks!

 

Robert Wall's picture

Re: Temperatures search sketch problem SOLVED

You are correct, those lines should appear.

I presume you loaded the sketch and no error messages appeared?

Have you set the baud rate of your monitor to the baud rate in the sketch - 9600 baud (the number in Serial.begin) ?

Are you using a 5 V USB supply to your emonTx?

If you are on Windows and using the Arduino IDE, you might want to increase the first delay to 6 or 7 seconds (6000 or 7000)  to give yourself time to switch the monitor on. Otherwise, if you can't realise it's finished loading and switch over in under 1 second (I can't), you've missed those messages.

charliemic's picture

Re: Temperatures search sketch problem SOLVED

Robert, thanks a lot. I increase the initial delay to 7000 and it now works.

Robert Wall's picture

Re: Temperatures search sketch problem SOLVED

It was working all the time then, the problem was it all happened before you could see it.

Comment viewing options

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