I’m trying to connect 4 type-k thermocouples powered by Arduino.
I have two choices as I understand it:
Use a multiplexer
Change the address on the thermocouple itself
I do have the ncd.io multiplexer but I’m not having much luck there, the path of least resistance would be the ability to set each thermocouple to its own address.
Any help would be appreciated.
-Rob
Hi Rob,
Which multiplexer do you have? We may have sample code for it.
https://store.ncd.io/?fwp_product_search=i2c%20multiplexer
Hi Travis,
I have this board: [
TCA9546A 4-Channel I2C Bus Multiplexer
](https://store.ncd.io/product/tca9546-4-channel-i2c-multiplexer/ )
Thank you!
Rob
robert.iadanza:
TCA9546A
Hi Rob,
It looks like we don’t have any sample code for that IC, however there appears to be a library available on GitHub here you might check:
Thank you for the help, much appreciated.
Hi Travis,
Do you have an i2c multiplexer that you have sample code for? I would be willing to buy another multiplexer as the code above I could not get working.
Thank you again,
Rob
its super easy to use TCA9546.
Step one – set the output port
Step 2-- run mcp9600 code to read temp
//////////// not tested on hardware yet!!!!!!!!!!!!!
#include <Wire.h>
byte address_mux = 0x70;
byte address_AD5693 = 0x4C;
void setup()
{
Serial.begin (9600); ////////////////serial port
Wire.begin(); /////////////// i2c enable
}
int set_port ( int port_value)
{
Wire.beginTransmission(address_mux );
byte port = port_value;
Wire.write(port);
Wire.endTransmission();
Serial.print (port, DEC);
Serial.print("\n");
}
This file has been truncated. show original
Lazy way-- my preferred method
There is pot on the board. use a screw driver to turn it ( a very small turn will go long way)
step one – run i2c scan
it will comes with an address, write down this address on the board
take board two
run the i2c scan. if the address is same as old board turn the pot slightly and scan again
once you get a new address write it down and repeat this for all MCP9600.
Thanks Bhaskar,
I too changed the POTS and took the lazy way! But your mux code was exactly what I needed and now the multiplexer is working perfectly as well.