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

multiple spi devices (thermocouple)?


  • Please log in to reply
9 replies to this topic

#1 turkey

turkey

    New Member

  • Members
  • Pip
  • 3 posts

Posted 09 October 2011 - 08:17 PM

Hello all, I am a total newb to such things however I have used C# a couple of times so feel that I should at least try.... anyhow as a back story I am building a pizza oven and want a thermocouple logger to record its temp profile and they seem waaaay to expensive for what could be a pretty simple device (Excel can do the heavy lifting) Ideally I would like to monitor 4 thermocouples, from what I can see these are either analog or spi interfaced, spi seems simpler to me but it seems that the netduino only has 1 spi interface, could this be easily multiplexed as I would be logging multipl hours it would not be an issue to not get simultaneous readings, although when talking in the ms realm compared to the duration and pause between measurements they would effectively be simultaneous. I see pics and audrinos being used but feel learning that might be just too much of a challenge. Many thanks for reading, any guidance gratefully received.

#2 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 10 October 2011 - 03:53 AM

Hello Turkey and welcome to the forum! Since you are talking about pizza, I assume that the oven is *NOT* a microwave-oven. Otherwise the problem will become much complex. Well, about the SPI, I don't understand why you are considering the SPI. Maybe do you have any thermocouple circuit ready-to-go using SPI? If so, gimme some link. Anyway, the SPI uses at least 4 wires: one of them is called "Slave-Select" and it needs to notify a certain device to listen the incoming message. So, when you deal with many devices, you may share the same SPI and providing many Slave-Select signal as much the target devices are. The Netduino is a perfect choice for what you looking for. The board offers up to 6 analog inputs to measure the voltages directly, so you might connect the thermocouples without SPI. However you would need some extra hardware. Please, describe a bit better what's your goal. Cheers
Biggest fault of Netduino? It runs by electricity.

#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 10 October 2011 - 05:55 AM

Ideally I would like to monitor 4 thermocouples, from what I can see these are either analog or spi interfaced, spi seems simpler to me but it seems that the netduino only has 1 spi interface, could this be easily multiplexed as I would be logging multipl hours it would not be an issue to not get simultaneous readings, although when talking in the ms realm compared to the duration and pause between measurements they would effectively be simultaneous.

Welcome to the community.

I think can have multiple SPI devices connected to the Netduino even with only one SPI interface. The algorithm would look something like this:

Create and SPI config for Device 1 - config1
Create and SPI config for Device 2 - config2
Create and instance of the SPI interface using config1

Main program loop:
Set the config for the SPI interface to the desired device (config1 or config2)
Do stuff with the device
Loop

As Mario pointed out, you will need a different ChipSelct pin for each device you wish to connect.

You would also need to make sure that the configs and SPI instance are available where needed.

Hope this helps,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 Stefan

Stefan

    Moderator

  • Members
  • PipPipPip
  • 1965 posts
  • LocationBreda, the Netherlands

Posted 10 October 2011 - 07:42 AM

You would also need to make sure that the configs and SPI instance are available where needed.

I also had troubles with that, so I wrote a helper class for that:
http://netmftoolbox....rdware.MultiSPI

You can create multiple instances of the MultiSPI class with different configurations.
"Fact that I'm a moderator doesn't make me an expert in things." Stefan, the eternal newb!
My .NETMF projects: .NETMF Toolbox / Gadgeteer Light / Some PCB designs

#5 turkey

turkey

    New Member

  • Members
  • Pip
  • 3 posts

Posted 10 October 2011 - 11:07 AM

thanks for the guidance so far. I suppose I should re cover this oven bit, its a brick built dome which will have wood burnt in it to heat the bricks and then cook in it, it will take a while to heat and then hopefully with all the planned insulation a while to cool, measuring this is my plan. Pretty basic and definitely no nasty microwaves flying around :) so i would like to take and store (possibly display at a later stage) temp readings from upto 4 sensors, these would first be read over usb I suppose if easier, or stored somewhere for retrieval via usb or on SD card for reading in via the pc. SD would probably be perfect as its safe if power is lost and I assume i will want this to run on batteries eventually. I can then take the values and plot vs time to see the temp curve of the oven. Not mission critical but I think fairly interesting to know if you plan to bake bread in the oven also (I do). given this is a single project and my first and not really a productive one blahh blahh i would ideally like it to be as cheap as possible :) re the SPI, well any advice here is also well received, from my brief googling it seems that for thermocouples you need and amplifier chip as the voltages returned are so small and they need some reference temp to give accurate readings, thus you can by single chip solutions. I have seen analog and digital versions, checking Sparkfun (I have no idea if they are good or not but stocked both so seemed a good price comparison site) shows the digital version nearly half the price of the analog one, plus the digital Max6675 is rated to 1024 degrees which is as per my application high temp ratings are a bonus. Analog: http://www.sparkfun.com/products/306 Digital: http://www.sparkfun.com/products/307 Like I said I am a total newb with the electronics side so sorry for the totally non technical appraisal of these two options. I am in the UK if that makes any difference to supplier choice / availability etc..

#6 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 10 October 2011 - 12:16 PM

Analog: http://www.sparkfun.com/products/306
Digital: http://www.sparkfun.com/products/307

For suppliers in the UK, have a look at the following:

Proto-Pic
SK Pang
Cool Components

If you want basic components then I'd look at BitsBox - postage is only £1.50 and all of the orders I've placed before 1pm have been delivered by first class post the next day. I always check this site out first as they often supply parts at the best price for the small volumes I use.

There are some thermocouple devices on Proto-Pic - this site looks like a UK version of SparkFun although not the full range.

Hope this helps,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#7 Dan Morphis

Dan Morphis

    Advanced Member

  • Members
  • PipPipPip
  • 188 posts

Posted 10 October 2011 - 08:40 PM


so i would like to take and store (possibly display at a later stage) temp readings from upto 4 sensors, these would first be read over usb I suppose if easier, or stored somewhere for retrieval via usb or on SD card for reading in via the pc. SD would probably be perfect as its safe if power is lost and I assume i will want this to run on batteries eventually. I can then take the values and plot vs time to see the temp curve of the oven. Not mission critical but I think fairly interesting to know if you plan to bake bread in the oven also (I do).


If you have any plans to display the temp in real time, you have a couple of easy options. You can get a serial LCD "backpack" from SparkFun for around $25. Another much cheaper option (while more complicated) is to use 74HC595 shift registers and 7 segment LEDs. Each '595 will do 8 bit serial-in, parallel-out and they can be chained together. You could also use a STP16C596 which does 16 bits. This will allow you to display the temp using only 3 lines on the Netduino.

-dan

#8 Mike P

Mike P

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAuckland, New Zealand

Posted 11 October 2011 - 06:20 AM

I certainly don't want to steer you away from a netduino solution if that is what you want but have you considerred an off the shelf product like this:
http://www.dealexcel...eter_p4083.html
This doesn't log on it's own but if you connect it to a laptop or a pc it will log.

Edit:
Just in case the link above goes dead, it is a CENTER-304 4-channel RS232 Thermometer that costs US$119.64 with free shipping.

Edited by Mike P, 11 October 2011 - 06:22 AM.


#9 turkey

turkey

    New Member

  • Members
  • Pip
  • 3 posts

Posted 13 October 2011 - 01:35 PM

looks good that Mike, but from what I can tell the 304 does not log, you need the 309 for that although even the makers site is somewhat light on information unfortunately. I agree it looks a nice bit of kit tho and basically does everything I would want assuming it logs without the pc being present.

#10 Mike P

Mike P

    Advanced Member

  • Members
  • PipPipPip
  • 41 posts
  • LocationAuckland, New Zealand

Posted 13 October 2011 - 08:33 PM

That's right. The 304 can only log data if connected to a PC or laptop. It comes with the serial cable and windows software for logging and displaying the temperatures. The 309 has internal memory for storing temperature and time. I've used a 309 and a 302(2ch).




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.