JonesThePi
Posts: 21
Joined: Tue Oct 23, 2012 1:08 pm

DS18B20 on Gertboard buffer...

Wed Jan 16, 2013 6:36 pm

I have been successfully running a DS18B20 through the ATmega but have (unrelated to this) managed to kill the ATmega (subject for another thread).

So, I wanted to connect a DS18B20 to GPIO4 from the Gertboard and read temperature using Modprobe on the Pi. So far I haven’t managed to get this to work (Modprobe refuses to find the device) and I have run out of ideas.

Usual set up for the DS18B20, 4.7k resistor between data and power. Data and ground connected to B4 and power to 3V3. I have GP4 on J2 connected to B4 on J3 and the input jumper set on B4. The led on B4 stays on when the Pi is powered up.

Am I missing something obvious or could it just be that both my DS18B20’s are also dead…

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: DS18B20 on Gertboard buffer...

Wed Jan 16, 2013 6:49 pm

You can not use a buffer on the output line.
The temperature sensor requires a bi-directional protocol and the buffer is uni-directional.
Thus when you pull the GPIO pin low the buffer will not pass that on (it is in the wrong direction)
and the temp. sensor will not see it.

JonesThePi
Posts: 21
Joined: Tue Oct 23, 2012 1:08 pm

Re: DS18B20 on Gertboard buffer...

Wed Jan 16, 2013 7:28 pm

Thank you Gert for a perfect explanation (of my schoolboy error) and for the Gertboard itself which I continue to find a wonderful learning tool.

So is there another alternative for connecting a DS18B20 to a Gertboard (other than through the ATmega)? Could I connect the data pin directly to GP4 on J2 and the ground to any GND on the board?

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Wed Jan 16, 2013 8:42 pm

JonesThePi wrote:Thank you Gert for a perfect explanation (of my schoolboy error) and for the Gertboard itself which I continue to find a wonderful learning tool.

So is there another alternative for connecting a DS18B20 to a Gertboard (other than through the ATmega)? Could I connect the data pin directly to GP4 on J2 and the ground to any GND on the board?
That should work as it's equivalent to sticking it straight on the GPIO pin. :D
Alex Eames RasPi.TV, RasP.iO

JonesThePi
Posts: 21
Joined: Tue Oct 23, 2012 1:08 pm

Re: DS18B20 on Gertboard buffer...

Thu Jan 17, 2013 8:43 am

:oops: and thank you. Sometimes it's good to talk these things through with someone...

User avatar
silverfox0786
Posts: 215
Joined: Mon Feb 04, 2013 10:32 pm
Location: Slough, UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Thu Feb 14, 2013 11:14 pm

i stumbled on this thread as i wanted to know how to add this temp sensor to a gertboard

and yes thread is a bit old but i have sucessfully got it working off the gpio in one-wire mode

images curtosey of adafruit

Image

Image

and to add how would i go about setting this up on the gert

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: DS18B20 on Gertboard buffer...

Fri Feb 15, 2013 8:34 am

As the thread already mentioned: you can only connect it direct to a GPIO pin as the Gertboard does not have
auto-direction-sensing bi-directional buffers**.
You have to use a GND and 3V3 connection just as on the diagram you provided.
The Gertboard has several place where the 3V3 comes out. Just look for that label. The Ground is available in many places.
The Software seem to use #4 on the diagram for the data which is GPIO4 on the Gertboard J2 connector.

** We tried these auto-direction-sensing buffers in a different product and they did not work very well.
I checked the data sheet and they can not always be used as they require ~5-7mA counter drive before switching direction.
This temperature sensor is a prime example where they never would have worked. The temp. sensor can never deliver that.

User avatar
silverfox0786
Posts: 215
Joined: Mon Feb 04, 2013 10:32 pm
Location: Slough, UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Fri Feb 15, 2013 5:56 pm

thanks for the reply Gert

just the info i needed, although you say gertboard cant use it i am very happy that i can still use it in GPIO direct mode with gertboard still plugged it

that i dont mind either

so i would connect the GPIO 4 connection direct to J2 ?

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: DS18B20 on Gertboard buffer...

Fri Feb 15, 2013 7:40 pm

....so i would connect the GPIO 4 connection direct to J2 ?
Uhhh not exactly!
You must connect the sensor output to the GPIO4 pin which is ready available ON J2.

User avatar
silverfox0786
Posts: 215
Joined: Mon Feb 04, 2013 10:32 pm
Location: Slough, UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Sat Feb 16, 2013 3:08 pm

sorry gert thats what i ment the sensor GPIO4 connection direct to pin J2


so in other words insead of plugging in the sensor to GPIO4 i plug it into pin J2 of gertboard

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Sat Feb 16, 2013 5:20 pm

silverfox0786 wrote:sorry gert thats what i ment the sensor GPIO4 connection direct to pin J2


so in other words insead of plugging in the sensor to GPIO4 i plug it into pin J2 of gertboard
Pin GP4 on header J2 :D
Alex Eames RasPi.TV, RasP.iO

samighi11
Posts: 46
Joined: Wed Apr 17, 2013 8:27 pm

Re: DS18B20 on Gertboard buffer...

Sun Apr 21, 2013 8:29 pm

I am a newbie to the Gertboard and have high hopes in using it. I am a bit confused on how to "activate" the Gertboard without any code to use the standard modprobe to enable w1_slave and 28_* to read the DS18B20s that I have. :?

I have prototyped this on the Arudino and Raspi itself, but can't get GP4 on the gertboard to work.

I would appreciate code (commands, shell commands) to activate the gertboard. Basically all i need is to be able to read my temprature sensors using the shell. I can do C or shell, but I rather avoid python, perl , etc. I am versed in unix and Raspi operation, but the GPIO pin use is new to me.

Any direct feedback would be appreciated.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Mon Apr 22, 2013 7:35 am

samighi11 wrote:I have prototyped this on the Arudino and Raspi itself, but can't get GP4 on the gertboard to work.
If you made it work on the Pi, all you have to do differently on the Gertboard is connect it to GP4 instead of to the Pi. Programmatically, everything else should be the same.
Alex Eames RasPi.TV, RasP.iO

samighi11
Posts: 46
Joined: Wed Apr 17, 2013 8:27 pm

Re: DS18B20 on Gertboard buffer...

Mon Apr 22, 2013 12:49 pm

I have tried 10s of times to use mod probe as I do with pi gpio4. It seems either I have wrong voltage or I need to enable gp4 on gertboard somehow. I will provide documentation in my next post. I have seen but can't find elsewhere were "spi" setup had to be started and keep setup for this this to work. Again if any of this makes sense let me know. I will post pictures tonight.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Mon Apr 22, 2013 1:06 pm

As far as I know, and Gert can correct me if I'm wrong about this, connecting something to GP4 on the Gertboard is equivalent to connecting something to the GPIO4 pin on the Pi. OK there may be a tiny little bit of resistance because of the longer path, but as long as you have the rest of the DS18B20 connected as before, everything should work the same.

You HAVE got the J7 jumper attached haven't you?
Alex Eames RasPi.TV, RasP.iO

samighi11
Posts: 46
Joined: Wed Apr 17, 2013 8:27 pm

Re: DS18B20 on Gertboard buffer...

Mon Apr 22, 2013 1:14 pm

Thank you for the quick reply. Yes ... J7 is in place. I attempted to read the whole (I believe outdated) gertboard manual. I will post pictures maybe I am missing something simple like how I have gertboard attached to raspi as I piggy back them. Or I am using 3.3v vs 5v from raspi. I will recreate my issue and post. But it is good to confirm that I thought it should work without any external code. Thank you and I will post again with pictures.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: DS18B20 on Gertboard buffer...

Mon Apr 22, 2013 2:54 pm

Up to date Gertboard manual link is at the top of this forum thread...

http://www.raspberrypi.org/phpBB3/viewt ... 23#p197523
Alex Eames RasPi.TV, RasP.iO

Return to “HATs and other add-ons”