LowPowerLab Forum

Hardware support => Moteino => Topic started by: andre_x on December 08, 2014, 09:33:52 AM

Title: Problem with temperature measurement - DS18B20
Post by: andre_x on December 08, 2014, 09:33:52 AM
Hi all,
I'm getting started with Moteino and I have problems with the DS18B20 sensor. I've used the sender and receiver sketch on github but all I get on the sender is "Free memory: 707" and on the receiver I get..nothing!
I've done the WaterMote and it sends and receives correctly, so the hardware is fine.
What could the problem be?
Thanks!
Andrea
Title: Re: Problem with temperature measurement
Post by: Felix on December 08, 2014, 09:39:01 AM
Hi Andrea,
If you search the forum for "DS18B20" you will find many threads discussing this sensor and sample code that others have posted.
See this thread for instance: https://lowpowerlab.com/forum/index.php/topic,666.0.html
Title: Re: Problem with temperature measurement - DS18B20
Post by: andre_x on December 08, 2014, 09:41:50 AM
Well...I did! But nobody had the "Free memory" message and I'm using the "original" sketch
Title: Re: Problem with temperature measurement - DS18B20
Post by: Felix on December 08, 2014, 09:43:52 AM
I think you might need to analyze your sketch a little bit and determine how it is working and why you're getting that message.
Title: Re: Problem with temperature measurement - DS18B20
Post by: andre_x on December 08, 2014, 09:55:06 AM
I'm trying and I'm hitting my head on the desk! I'm on the sketch from all afternoon and I don't get why it doesn't enter the loop where it check the data pin. I've done all by the manual...
I'm new to Moteino and I've never worked on the Arduino...but the free time between jobs isn't so much, so it's not so easy for me to understand ALL that code.
Any clue??? ...pleeeeease!!!
Title: Re: Problem with temperature measurement - DS18B20
Post by: Felix on December 08, 2014, 12:35:11 PM
There is no "by the book/manual" way. I wish there was. We've all busted our heads on the desk and walls in the years of working with Arduino so this is just a drop in the bucket to get started my friend :)
If you're looking for your 100% working complete perfect for what you need sketch, unfortunately it doesn't exist. You will have to take pieces of working code and adapt them to what you need. Moteino is very similar to Arduino except LED is on D9 and all GPIOs logic is 3.3V instead of 5V. If you have the radio installed then D10 and D11-D13 are taken but you can use other SPI devices on pins D11-D13 and choose another digital pin for SPI CS. For DS18B20 all you need is A4 and A5 which are the I2C interface. As far as code ... again, there is no easy way out, you need to learn C++ and start with the simple things and move your way up.
Title: Re: Problem with temperature measurement - DS18B20
Post by: andre_x on December 08, 2014, 12:52:56 PM
Yep, Definetly. I got it.
My head hurt too much to keep going this way!
To start from the beginning can I use the Arduino examples just taking care about the things you just told me?
Thanks!
Title: Re: Problem with temperature measurement - DS18B20
Post by: Felix on December 08, 2014, 02:01:17 PM
I guess what I really meant you need to understand what is going on otherwise it's really hard to make anything work.
Title: Re: Problem with temperature measurement - DS18B20
Post by: andre_x on December 08, 2014, 04:40:55 PM
Yes yes, I got it!
But since I don't know C/C++ and I've never used Arduino, I need to start from the beginning!
Title: Re: Problem with temperature measurement - DS18B20
Post by: Felix on December 08, 2014, 08:52:35 PM
Yep... would you want to go have brain surgery done by a doctor who never went to medical school?
The analogy is a bit extreme, sorry :)
Title: Re: Problem with temperature measurement - DS18B20
Post by: andre_x on December 09, 2014, 06:22:18 AM
Quote from: Felix on December 08, 2014, 08:52:35 PM
Yep... would you want to go have brain surgery done by a doctor who never went to medical school?
...mmm...I'll think about it! :-X

Quote from: Felix on December 08, 2014, 08:52:35 PM
The analogy is a bit extreme, sorry :)
...well...just a bit!!!  ;D ;D ;D
Title: Re: Problem with temperature measurement - DS18B20
Post by: ggallant on December 09, 2014, 06:19:22 PM
I have a both a DS18B20 and a DHT11 working with a R4 Moteino. Both temperatures are close to a home weather station but the humidity reading is poor. If it would help I could isolate the DS18B0 and post the code someplace.

George