• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

i2c Temperature Sensors

Scheduled Pinned Locked Moved
General Discussion
4
10
778
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    Todd
    last edited by 4 Jun 2019, 19:03

    Is it possible to interface temperature sensors via i2c instead of the default method of SPI->MAX31856? I have an odd specific application for this, and am aware of the distance limitations of i2c.

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by 4 Jun 2019, 20:17

      To support I2C temperature sensors, you would need to add a new temperature sensor class to the existing collection. But using I2C to connect temperature sensors is IMO a very bad idea, unless it's to measure the temperature of a chip on the Duet itself. It's not just the distance limitation, it's also the very poor noise immunity, lack of error detection, and lack of any protocol for recovering from sync errors.

      If the temperature sensor you want to use is only available with an I2C interface, use an attiny or similar small microcontroller to convert it to something more robust - like we did in the version 1 laser filament monitor.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      1 Reply Last reply Reply Quote 0
      • undefined
        Todd
        last edited by 4 Jun 2019, 20:33

        Actually I am looking for a way to use a remote temperature sensor. The plan was to use Temp Sensor -> i2c sensor amplifier -> PCA9615 (i2c differential buffer)////cable//// ->PCA9615 -> i2c on Duet2.

        I am open to using a small microcontroller to read my sensor and communicate with the duet2, but I am at a loss as to what that communication should be.

        ? 1 Reply Last reply 4 Jun 2019, 21:22 Reply Quote 0
        • ?
          A Former User @Todd
          last edited by 4 Jun 2019, 21:22

          @todd said in i2c Temperature Sensors:

          but I am at a loss as to what that communication should be

          emulating the spi chips on the thermocouple or pt100 board wouldn't require any other changes to the rep rap firmware and as such be easier with respect to upgrades

          undefined 1 Reply Last reply 4 Jun 2019, 22:09 Reply Quote 0
          • undefined
            Todd @A Former User
            last edited by 4 Jun 2019, 22:09

            @bearer Interesting idea, but from what little I know about emulating SPI hardware slave it is quite an undertaking.

            Then there's still have the issue of sending the sensor data over a distance. Maybe I could just continuously transmit it over a rs485 serial link.

            ? undefined 2 Replies Last reply 5 Jun 2019, 10:27 Reply Quote 0
            • undefined
              Todd
              last edited by 4 Jun 2019, 23:11

              After some more research, and learning that most i2c errors come from things the differential buffer pair should take care of, im going to give this a try with i2c.

              Can anyone point me to what is needed to implement a new temperature sensor class?

              undefined 1 Reply Last reply 5 Jun 2019, 13:54 Reply Quote 0
              • ?
                A Former User @Todd
                last edited by 5 Jun 2019, 10:27

                @todd said in i2c Temperature Sensors:

                @bearer Interesting idea, but from what little I know about emulating SPI hardware slave it is quite an undertaking.

                Then there's still have the issue of sending the sensor data over a distance. Maybe I could just continuously transmit it over a rs485 serial link.

                I can't say I've tried it, but it doesn't look too bad. Adding the link just for refrence even if you're decided on i2c.
                https://circuitdigest.com/microcontroller-projects/arduino-spi-communication-tutorial

                undefined 1 Reply Last reply 5 Jun 2019, 20:19 Reply Quote 0
                • undefined
                  T3P3Tony administrators @Todd
                  last edited by 5 Jun 2019, 13:04

                  @todd if you are going to the effort of adding an additional firmware class to allow for I2C thermistors its probably equivalent, or less to use a attiny44 or similar to do as David suggests.

                  www.duet3d.com

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    dc42 administrators @Todd
                    last edited by 5 Jun 2019, 13:54

                    @todd said in i2c Temperature Sensors:

                    After some more research, and learning that most i2c errors come from things the differential buffer pair should take care of, im going to give this a try with i2c.

                    Can anyone point me to what is needed to implement a new temperature sensor class?

                    You will need to derive a new class from class TemperatureSensor. It may make sense to use a class I2CTemperatureSensor (similar to class SPITemperatureSensor but using I2C protocol) and then derive the class for your particular sensor from that.

                    To use the I2C interface, see the implementation of M260 and M261. I suggest you work with the RRF 2.03 source code (which is in the /dev branch on Github) because there have been significant changes to the I2C interface since version 2.02.

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      Todd @A Former User
                      last edited by 5 Jun 2019, 20:19

                      @bearer Thanks, ill check out the tutorial. I think I will still go with i2c though.

                      1 Reply Last reply Reply Quote 0
                      6 out of 10
                      • First post
                        6/10
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA