1-wire interfacing to a IR thermometer

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear All,

I am thinking of purchasing an IR thermometer sensor to embed it in my design project built around an STK600.

The corresponding sensor module is:

http://www.parallax.com/Store/Se...

My question is, what is the best (meaning easiest & quickest...;-)) way to be able to "talk" to the sensor through the required 1-wire interface?

- Would coupling of the Rx and Tx PINs of one of the UARTs of the ATmega2560 on a single connector cable be able to do the job? Would there be a pull-up resistor required or can I use the internal pull-ups?
- Would implementing a software UART like it is descibed in AVR274 make more sense? In this case the "single_wire_UART.h" would have to be modified for an 8-bit Atmega, has anyone done anything similar? In the documentation it says also that further modification of the example code would be required to compile the code on any other compiler than IAR Embedded Workbench...

Any ideas/suggestions? :roll:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Communication: Asynchronous serial @ 2400, 4800, 9600, 19.2K, 38.4K baud on single I/O pin

Look at some of the application notes for the USI if you want to go the 'Software UART' route. The module has more in common with SPI than UARTs.

C. H.
-------------------------------------------------------------------
It's only waste if you don't use it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR307: Half Duplex UART Using the USI Module :: AVR Freaks
https://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=525

C. H.
-------------------------------------------------------------------
It's only waste if you don't use it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wasn't aware of that possibility, e.g. using the USI, however it is only supported by the ATtiny series and not by Atmega or Atxmega...

Maybe this will do it:

AVR305: Half Duplex Compact Software UART
http://www.atmel.com/dyn/resourc...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

By 1-wire do you mean a single wire or the 1-wire protocol by Dallas/Maxim??

Randy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@Randy:

Justified question.

I am talking about a single-wire interface, e.g. a UART where both Tx and Rx are on the same data line. Thus there are 3 wires used: data, Vcc and GND.

My mistake of specifying the interface as a 1-wire...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alekos83 wrote:

Maybe this will do it:

AVR305: Half Duplex Compact Software UART
http://www.atmel.com/dyn/resourc...

Actually this is a half-duplex Software UART and not a single-wire SW UART... :?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am tring on this:
AVR274: Single-wire Software UART
http://www.atmel.com/dyn/resources/prod_documents/AVR274.pdf

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or this may work:
https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=69916&postdays=0&postorder=asc

Connect TX/RX line together, and use a 4.7k pull-up risister. I havn't try yet.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And here says adding a NC7WZ07 on TX line, if TXD pins are not open drain.
http://www.maxim-ic.com/appnotes.cfm/an_pk/214

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you give a link to the thermometer. The ZyTemp ones I am going to use is standard SPI though there is only one data line (MISO). There IS a clock line, plus power and common.

Ooops, see it in the original post.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its ASYNC serial, through UART. Hardware or software. To use a single pin, you have several options:

1) Software UART in which you can turn the transmit output into an input when it has to listen.

2) External transistor/FET that functions as an open collector/drain device, allowing it to coexist on the single data line. Then, you could use hardware UART. You would really want TWO inversions to get everything right on the transmit side.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, I've scanned three of the data sheets, plus the main product page, and none of them seem to specify the accuracy of the thermometer...

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
OK, I've scanned three of the data sheets, plus the main product page, and none of them seem to specify the accuracy of the thermometer...
I believe that if you check pages 28 and 29 on
http://www.parallax.com/Portals/...
you will find a very detailed answer to your question.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Its ASYNC serial, through UART. Hardware or software. To use a single pin, you have several options:

1) Software UART in which you can turn the transmit output into an input when it has to listen.


I think that's the solution I am gonna go for, e.g. the software UART, seems more straightforward to me... hoping also it will not degrade the performance of the AVR too much...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With software UART, you transmit and receive through the same pin. It is set to be an output when you transmit and an input all other times.

Beyond that little detail, no difference from all the other software UARTs.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Alekos83,

Thanks for the pointer to the specs.

I missed tha one.

JC