Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

DS18*20 Temperature Sensor Auto Identity Circuit


  • Please log in to reply
11 replies to this topic

#1 Stuart Crawshaw

Stuart Crawshaw

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • LocationLeeds, United Kingdom

Posted 08 July 2011 - 11:32 AM

Hi all,

I have though up a circuit which will help me on a project i am working on. The basic outline is as follows:

I have 5 ports into which i can plug in up to 5 DS18*20 temperature sensors. The ports are numbered 1 - 5.
The problem i came accross in the early stages was, how do i know in my code which sensor ROM code is for which sensor (without having to force a higher temp and read all of them to see which code is higher.)

Say i had sensor in port 1 monitoring a power supply internal temp, Sensor in port 2 monitoring water temperature somewhere. And a sensor in port 3 monitoring another temperature somewhere else.

How could i pair the locations of the sensors (port or physical) to the rom codes?

This is where i thought of the attached circuit(It may be overkill, and may be missing some componenets such as resistors etc. But that is what this thread is for).

The idea is, each sensor port has an address of its own. On initialization, the shift register is fed the relevant bits to turn on one DS1820 at a time and read the ROM code then assign that rom code to that port name.

After all 5 ports have been individually turned on, and ROM codes discovered/not found, the shift register is fed all 1's to turn all DS1820's on.

So the question:

1. What transistor should i use to switch the DS1820's on/off (or maybe even a trasistor array? i was looking at this)

2. Am i missing any resistors (maybe on the transistors or something) if so what values would you suggest.

3. Can you think of a better way to do this, other that plugging each individual sensor in to its own digital IO port on the Netduino?

4. Can you offer any modifications to make this more effecient etc...


Thanks for your help on this, Constructive critisism is appreciated and any suggestions welcome.

Regards,
Stuart.

Attached Files


Intelligent People Aren't Afraid To Ask For Help.

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 08 July 2011 - 12:25 PM

Hello Stuart.
I am NOT sure to understand well what you are looking for, NOR I know the 1-wire protocol (I had a peek right now at the specs).
Basically you would have a "kind of switch" to use on the beginning of your program, so that the codes of the probes could be read. Then, you will have a code-port pair well-known.
Instead of using your circuit (missing the resistors from the HC595 to the transistor base), I'd suggest an alternative, that will flip upside-down the whole approach. However that's working only if I understand correctly.

Consider this chip: 74HC4051. It's basically a bidi-switch. Just think the old-fashion electric appliances, having a rotary switch with position 1,2,3 etc. Its particularity is that is "transparent", as it was a wire connecting an input to the output...by the way it's almost improper to call them "input" and "output".

Well, now refer to the HC4051 sheet. Consider to connect each data lead of your probes to the Yx pins of the 4051. The Z pin will be connected to the Netduino 1-wire pin.
Your program must choose, once a time, which "Y" to connect with "Z". To do that, you must set the S0,S1,S2 inputs properly, using three Netduino outputs.
Using this approach, you MUST always switch the right probe. You cannot select more than a probe a time, but the circuit looks much more compact and clean.

Feel free to tell me if this idea fits your goal or not.
Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Stuart Crawshaw

Stuart Crawshaw

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • LocationLeeds, United Kingdom

Posted 08 July 2011 - 01:12 PM

Hello Stuart.
I am NOT sure to understand well what you are looking for, NOR I know the 1-wire protocol (I had a peek right now at the specs).
Basically you would have a "kind of switch" to use on the beginning of your program, so that the codes of the probes could be read. Then, you will have a code-port pair well-known.
Instead of using your circuit (missing the resistors from the HC595 to the transistor base), I'd suggest an alternative, that will flip upside-down the whole approach. However that's working only if I understand correctly.

Consider this chip: 74HC4051. It's basically a bidi-switch. Just think the old-fashion electric appliances, having a rotary switch with position 1,2,3 etc. Its particularity is that is "transparent", as it was a wire connecting an input to the output...by the way it's almost improper to call them "input" and "output".

Well, now refer to the HC4051 sheet. Consider to connect each data lead of your probes to the Yx pins of the 4051. The Z pin will be connected to the Netduino 1-wire pin.
Your program must choose, once a time, which "Y" to connect with "Z". To do that, you must set the S0,S1,S2 inputs properly, using three Netduino outputs.
Using this approach, you MUST always switch the right probe. You cannot select more than a probe a time, but the circuit looks much more compact and clean.

Feel free to tell me if this idea fits your goal or not.
Cheers


Hi thanks for the suggestion,

Unfortunatly i want to be able to addrss all of the probes at the same time as well as individually on initialization.

I should have mentioned that I am using spi with the shift register and there are othrr tegisters on the spi which controll lcd's etc. So using the chip mentioned above would use more pins

Thanks again for the input
Intelligent People Aren't Afraid To Ask For Help.

#4 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 09 July 2011 - 06:47 PM

I am looking at a similar project I am total new to this so code wise I am useless, but my idea was that you attach the probes in an order. So you have 5 sockets 1 - 5, you plug your first sensor into socket 1, your code then detects this probe and records its address to a variable sensor1. You then attach your next probe to socket 2, the code checks this again, if it doesn't have the same address as sensor1 then it assigns its address to sensor2 and so on. The one limitation is that you would have to go through this process every time you attached a new probe but it could be a programmatic way of attaching probes. I would be interested to see you schematic and your code example as I am a total noob and could do with some ideas. I am currently using c2w's one wire example and have managed to get some good readings off a single probe, but I am not sure how to attach multiple probes. I am also having issues with any readings under 4 degrees are printing out as 85 degrees? no idea why buy I already have a thread open detail this. Let me know if this idea is feasible and or any help and I would be interest to learn how you deal with it. To add to it I guess you would need some data storage device to hold the addresses once your code sets them to a variable. Andy

#5 Stuart Crawshaw

Stuart Crawshaw

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • LocationLeeds, United Kingdom

Posted 09 July 2011 - 11:41 PM

Hi mcinnes01, The idea is feasable. Only I have decided that the tansistors should be on the groung pins of the sensor as they won't allow the data pins to work otherwise. Once I have some code I will post it on here with my final circuit design too. You idea would also work but would be a alittle bit of an annoyance if you have to do it a lot. I was either going to store these values on an eeprom or similar. Also this way I can drive an lcd and this temp sensor circuit off of 5 pins total.
Intelligent People Aren't Afraid To Ask For Help.

#6 CW2

CW2

    Advanced Member

  • Members
  • PipPipPip
  • 1592 posts
  • LocationCzech Republic

Posted 10 July 2011 - 07:21 AM

3. Can you think of a better way to do this, other that plugging each individual sensor in to its own digital IO port on the Netduino?

You might also check out DS1825 thermometer, which has 4-bit location address.

#7 Stuart Crawshaw

Stuart Crawshaw

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • LocationLeeds, United Kingdom

Posted 10 July 2011 - 10:06 AM

You might also check out DS1825 thermometer, which has 4-bit location address.


Hi CW,

Thanks for the reply. I was really interested in the sensor provided but noticed it is only available in one package type.

I want to eventually have these on the end of wires etc for long lead probes.

I am greatful you took your time to suggest these though. I will be sure to bookmark them incase of another project.

thanks again,
Stuart
Intelligent People Aren't Afraid To Ask For Help.

#8 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 14 July 2011 - 12:25 PM

Another elaboration on my idea could be to sense if there is a current on a particular port. That way when you plug in a probe your code knows which socket it realtes to and can then go about checking the addresses as described above. That way it wouldn't matter which order you plugged them in you would just need a current sensing circuit across the the 5 sockets. This would work as you wouldn't simultaneously plug all 5 sensors in, so the code could easily assign the address to a variable relating to the corresponding socket that it sensed a change in current from logic level to 0.

#9 Stuart Crawshaw

Stuart Crawshaw

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • LocationLeeds, United Kingdom

Posted 14 July 2011 - 01:01 PM

Another elaboration on my idea could be to sense if there is a current on a particular port. That way when you plug in a probe your code knows which socket it realtes to and can then go about checking the addresses as described above. That way it wouldn't matter which order you plugged them in you would just need a current sensing circuit across the the 5 sockets. This would work as you wouldn't simultaneously plug all 5 sensors in, so the code could easily assign the address to a variable relating to the corresponding socket that it sensed a change in current from logic level to 0.


Yes, that thought had crossed my mind, but i would like to connected/disconnect devices while the board is un-powered (to limit that chances of shorting or anything else that could happen as I am plugging the devices in.

Mainly the idea was to combat the senario what all sensors are plugged in, placed in the location to be monitored and the netduino powered on. Then i could use a menu system to say Port one is monitoring a power supply, port 2 a water filter temperature and so on, without having to connect them individually and assign their names.
Intelligent People Aren't Afraid To Ask For Help.

#10 Stuart Crawshaw

Stuart Crawshaw

    Advanced Member

  • Members
  • PipPipPip
  • 60 posts
  • LocationLeeds, United Kingdom

Posted 19 July 2011 - 02:36 PM

Ive just been looking through some components and decided to go with a ULN2803A Transistor Array. This array has built in 2K7 resistors on the base of each transistor, which if my calculations are correct is just about the right region (I calculated 2.5k would be needed to use the transistors as a switch). So if any of you guys would be so kind and let me know if this seems to be correct from an electronics point of view (i.e. it wont blow up or not work at all)

Attached Files


Intelligent People Aren't Afraid To Ask For Help.

#11 pugtech

pugtech

    Member

  • Members
  • PipPip
  • 18 posts
  • LocationScotts Valley, CA

Posted 29 August 2011 - 06:46 AM

If you're interested in daisy chaining your sensors, perhaps you could use DS28EA00 sensors. If you used I2C and a DS2482-800 8 channel master, each of your ports could be accessed directly.

#12 mcinnes01

mcinnes01

    Advanced Member

  • Members
  • PipPipPip
  • 325 posts
  • LocationManchester UK

Posted 17 October 2011 - 05:58 PM

Hi Stuart, Have you got any further with this? Just thought I would check in, pugtech's idea sounds interesting? Cheers, Andy




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.