#TCA9548A I2C multiplexer
Explore tagged Tumblr posts
Text
OHIās Ongoing Tricorder Project

Queadlunn- Itās been quite some time since I posted the Tricorder Iāve been working on for over 2 years now.
In the past year the external appearance of the unit hasnāt changed much, itās all been internal hardware and code changes. As the photos show, the mainboard is getting to be a ratās-nest of wiring with all of the changes and adaptation that Iāve done. The code, actually, is a lot cleaner than when I was at the same point last year. Itās able to do a fair bit more but isnāt using much more of the Arduinoās (Adafruit Feather M0 Adalogger) memory (still hovering around 30% at this point).



The sensors in the unit havenāt changed a huge deal, Iāve gotten them to work a bit better though and have even been able to adapt the libraries for the Gas sensor to work with the M0 controller (more brute-force really but it works). The total sensor list is posted below.
At the moment Iāve gotten 2 replacement sensor part. One to replace the Grideye sensor so itās smaller (I canāt do surface-mount soldering yet) and one to replace both the atmospheric sensor board and the 9-depth-of-field sensor board that captures movement. The second will combine both the ATM and 9-DOF into one very small package, saving on the limited internal space within the Tricorder.
There are a few things I want to add into the unit so far: GPS (for both location data and accurate clock updates), Haptics (feedback from button presses, sensor alarms), and finding a replacement and higher quality display are my biggest. The largest hurtle right now is getting the code solid, using the display to give clear and accurate readouts of the sensor data, and eventually rebuilding the mainboard and chassis. The chassisā ABS/aluminum/polycarbonate construction is rock-solid (itās been hanging out in my camera bag for the last year) but I want to clean it up since the off-square lines in the current one bother me a bit.
Itās been a hell of a journey, all started when I saw prop tricorders at Star Trek cons in the mid ā90s as a little kid. Iād never believe that Iād have one like this if I told past me of itā¦
Iāll post more as things happen



Current scan data points:
Atmospheric: Ambient temperature (averaged across 3 sensors), relative humidity, barometric pressure, Target Temp, GRIDeye temp (8x8 grid of IR thermal detectors)
Electromagnetic: UV Index, IR intensity, RGB Color, Visible light intensity in Lux, UV intensity
Radiation: Beta and Gamma detection
Gasses: Carbon monoxide, Nitrogen dioxide, Ethanol, Hydrogen, Ammonia, Methane, Propane, Isobutane
Mechanical: 3-axis Accelerometer, 3-axis Digital Gyroscope, 3-axis Hall Effect Magnetometer
Controller:
Adafruit Feather M0 Adalogger (https://www.adafruit.com/product/2796 )
Sensors:
Ā MPU9250 Add-Ons for Ladybug + BME280 (https://www.tindie.com/products/TleraCorp/mpu9250-add-ons-for-ladybug/ ) - Ambient temperature, relative humidity, barometric pressure, 3-axis Gyro, 3-axis Accelerometer, 3-axis Magnetometer
Ā Adafruit SI1145 (https://www.adafruit.com/product/1777 ) - UV Index, IR intensity
Ā Adafruit TCS34725 (https://www.adafruit.com/product/1334 ) - RGB Color sense
Ā Adafruit TSL2561 (https://www.adafruit.com/product/439 ) - Visible light intensity in Lux
Ā Adafruit VEML6070 (https://www.adafruit.com/product/2899 ) - UV intensity
Ā Generic MLX90614 (https://www.adafruit.com/product/1747 ) - Target Temp
Ā Panasonic GridEye (https://www.tindie.com/products/onehorse/grid-eye-8-x-8-ir-array/ ) - ATM: GridEye
Ā RadiationWatch Pocket Geiger (http://www.radiation-watch.org/p/english.html ) - Radiation
Ā Xadow Multichannel Gas Sensor (http://wiki.seeed.cc/Xadow_Multichannel_Gas_Sensor/ ) - GAS
Hardware:
Ā Adafruit CAP1188 (https://www.adafruit.com/product/1602) - Capacitive touch
Ā Adafruit 2.4" TFT LCD Ā (https://www.adafruit.com/product/2478) - LCD
Ā Adafruit DS3231 (https://www.adafruit.com/product/3013) - Real time clock
Ā Adafruit TCA9548A (https://www.adafruit.com/product/2717) - i2C multiplexer
Ā Adafruit Neopixel (https://www.adafruit.com/product/1558) - Cool lights
Parts to integrate:
Ublox GPS Compatible NEO-6M [clone] (https://www.amazon.com/gp/product/B075DD5746) - If I can figure out space for the board and the antenna this could be good to have, both for the location data and for the clock
Hereās a link to my (barely working [poorly formatted {inefficient}]) code.
Be aware, if you use the code, double-check the i2C addresses since Iāve changed some stuff around.


My big inspiration for the project has been the Open Source Science Tricorder by Peter Jansen. Itās an incredible project and I have major respect to the creator.
#Tricorder#Arduino#Arduino DIY#Star Trek#Science#OHI Cosplay#OHI Tricorder#Queadlunn#OH god theres no more room inside of this thing what have I done to myself whyyyyyy
11 notes
Ā·
View notes
Text
Tutorial ā Using the TCA9548A 1-to-8 I2C Multiplexer Breakout with Arduino
Now and again you may find yourself needing to use more than one device with the same I2C bus address with your Arduino.
Such asĀ four OLEDs for a large display ā or seven temperature sensors that are wired across a chicken hatchling coop.
These types of problems can be solved with theĀ TCA9548A 1-to-8 I2C Multiplexer Breakout, and in this guide weāll run through the how to make it happen with some example devices.
Getting Started
First, consider the TCA9548A itself. It is the gateway between your Arduino and eight separate I2C buses. You have a single bus on one side, connected to your Arduino.
On the other side of the TCA9548A, you have eight I2C buses, and only one of these can be connected to the Arduino at a time. For example (from theĀ data sheet):

The TCA9548 can operate on voltages between 1.8 and 5V DC⦠and operate with devices that have operating voltages between 1.8 and 5V DC. This is very convenient, as (for example) you can use devices made for 3.3V operation with 5V Arduinos, or vice versa. Awesome. So letās get started.
The breakout board includes inline header pins, which are not soldered to the board. So you need to do that. An easy way to line up the pins properly is to drop them into a soldereless breadboard, as such:

Then after a moment or two of soldering, youāre ready to use:

Next, insert your module into a solderless breadboard and wire it up as shown:

We are using the red and blue vertical strips on the breadboard as 5V and GND respectively. Finally, we connect the 5V and GND from the Arduino to the solderless breadboard, and A4/A5 to SDA/SCL respectively on the breakout board:

The electrical connections are as follows (ModuleĀ ā Arduino):
Vin to 5V
GND to GND
A0 to GND
A1 to GND
A2 to GND
SDA to A4
SCL to A5
Next, we consider the I2C bus address for the TCA9548A. Using the wiring setup shown above, the address is set to 0x70.Ā You only need to change this if one of your other devices also has an address of 0x70, as shown in the next step.
Changing the I2C address of the TCA9548A
The bus address of the TCA9548A is changed using the connections to the A0, A1 and A2 pins. By default in the tutorial we use 0x70, by wiring A0~A2 to GND (known as LOW). Using the table below, you can reconfigure to an address between 0x70 and 0x77 by matching the inputs to HIGH (5V) or LOW (GND):

TestingĀ
Before we get too excited, now is a good time to test our wiring to ensure the Arduino can communicate with the TCA9548A. Weāll do this by running an I2C scanner sketch, which returns the bus address of a connected device.
Copy and pasteĀ this sketchĀ into your Arduino IDE and upload it to your board. Then, open the serial monitor and set the data rate to 115200. You should be presented with something like the following:

As you can see, our scanner returned an address of 0x70, which matches the wiring described in the bus address table mentioned earlier. If you did not find success, unplug the Arduino from the computer and double-check your wiring ā then try again.
Controlling the bus selector
Using the TCA9548A is your sketch is not complex at all, it only requires one step before using your I2C device as normal. That extra step is to instruct the TCA9548A to use one of the eight buses that it controls.
To do this, we send a byte of data to the TCA9548Aās bus register which represents which of the eight buses we want to use. Each bit of the byte is used to turn the bus on or off, with the MSB (most significant bit) for bus 7, and the LSB (least significant bit) for bus 0.
For example, if you sent:
0b00000001 (in binary) or 0 in decimal
⦠this would activate bus zero.
Or if you sent:
0b00010000 (in binary)
⦠this would activate bus five.
Once you select a bus, the TCA9548A channels all data in and out of the bus to the Arduino on the selected bus. You only need to send the bus selection data when you want to change buses. Weāll demonstrate that later.
So to make life easier, we can use a little function to easily select the required bus:
void TCA9548A(uint8_t bus) { Ā Wire.beginTransmission(0x70); Ā // TCA9548A address is 0x70 Ā Wire.write(1 << bus); Ā Ā Ā Ā Ā Ā Ā Ā Ā // send byte to select bus Ā Wire.endTransmission(); }
This function accepts a bus number and places a ā1ā in the TCA9548Aās bus register matching our requirements. Then, you simply slip this function right before needing to access a device on a particular I2C bus. For example, a device on bus 0:
TCA9548A(0);
⦠or a device on bus 6:
TCA9548A(6);
A quick note about pull-up resistors
You still need to use pull-up resistors on the eight I2C buses eminating from the TCA9548A. If youāre using an assembled module, such as our example devices ā they will have the resistors ā so donāt panic.
If not, check the data sheets for your devices to determine the appropriate pull-up resistors value. If this information isnāt available, try 10k0 resistors.
Controlling our first device
Our first example device is theĀ tiny 0.49ā³ OLED display. It is has four connections, which are wired as follows (OLED ā TCA9548A/Arduino):
GND to GND
Vcc to Arduino 3.3V
CL to TCA9548A SC0 (bus #0, clock pin)
DA to TCA9548A SD1 (bus #0, data pin)
The OLED runs from 3.3V, so thatās why weāre powering it directly from the Arduinoās 3.3V pin.
Now, copy and uploadĀ this sketchĀ to your Arduino, and after a moment the OLED will display some numbers counting down in various amounts:
youtube
So how did that work? We inserted out bus selection function at line 9 of the sketch, then called the function in at line 26 to tell the TCA9548A that we wanted to use I2C bus zero. Then the rest of the sketch used the OLED as normal.
ControllingĀ two devices
Letās add another device, aĀ BMP180 barometric pressure sensor module. Weāll connect this to I2C bus number seven on the TCA5948A. There areĀ four connections, which are wired as follows (BMP180 ā TCA9548A/Arduino):
GND to GND
Vcc to Arduino 3.3V
CL to TCA9548A SC0 (bus #7, clock pin)
DA to TCA9548A SD1 (bus #7, data pin)
Now, copy and uploadĀ this sketchĀ to theĀ Arduino, and after a moment the OLED will display the ambient temperature from the BMP180 in whole degrees Celsius. This is demonstrated in the following video (finger is placed on the BMP180 for force a rise in temperature):
youtube
So how did that work? We set up the libraries and required code for the OLED, BMP180 and TCA5948A as usual.
We need to intialise the BMP180, so this is done at line 29 ā where we select the I2C bus 7 before initiating the BMP180.
The the sketch operates. On line 40 we again request I2C bus 7 from the TCA9548A, then get the temperature from the BMP180.
On line 44 we request I2C bus 0 from the TCA9548A, and then display the temperature on the OLED. Then repeat.
A quick note aboutĀ the reset pin
More advanced users will be happy to know they can reset the TCA9548A status, to recover from a bus-fault condition. To do this, simply drop the RESET pin LOW (that is, connect it to GND).
Where to from here?Ā
You can now understand through our worked example how easy it is to use the TCA9548A and access eight secondary I2C buses through the one bus from your Arduino. Donāt forget that the TCA9548A also does double-duty as a level converter, thereby increasing its value to you.
And thatās all for now. This post brought to you byĀ pmdway.comĀ ā everything for makers and electronics enthusiasts, with free delivery worldwide.
To keep up to date with new posts at tronixstuff.com, please subscribe to the mailing list in the box on the right, or follow us on twitterĀ @tronixstuff.
Tutorial ā Using the TCA9548A 1-to-8 I2C Multiplexer Breakout with Arduino was originally published on PlanetArduino
0 notes
Text
Friday Product Post: How Qwiic-Witted of You!
Welcome back to another exciting Friday Product Post! This week we have four new products; it all starts with the new NeuroSky MindWave Mobile 2 to help get your EEG projects going. After that we have two Qwiic-enabled boards, the SparkFun Qwiic Flex Glove Controller and the SparkFun Qwiic Mux Breakout. Rounding out the pack we have a new pair of flush cutters from Xcelite.
Just as a reminder: You have until the 22nd of July to get a free SparkFun Arduino Qwiic Kit if you already have $50 worth of product in your cart! After the 22nd, we will be moving onto the next free product, so make sure to get these deals while you can, because after that (or after the reserved units are gone) they will be gone! Find out how it works at our Four Weeks of Free page.
Now that that is all taken care of, letās jump in and take a closer look at all the new products!
youtube
All together now: E-lec-tro-en-ceph-a-lo-graph-y!

added to your cart!
NeuroSky MindWave Mobile 2
In stock SEN-14758
The MindWave Mobile 2 from NeuroSky is an EEG headset that safely measures and transfers the power spectrum data via Bluetootā¦
$99.95
Favorited Favorite 1
Wish List
This is the MindWave Mobile 2 from NeuroSky, an EEG headset that safely measures and transfers power spectrum data (alpha waves, beta waves, etc.) via Bluetooth Low Energy (BLE) or Bluetooth Classic to wirelessly communicate with your computer, iOS or Android device. Simply slip this headset on to see your brainwaves change in real time! With the MindWave Mobile 2 you can monitor your levels of attention and relaxation ā and even learn about how your brain responds to your favorite music. This headset is an excellent introduction to the world of brain-computer interface!
youtube
Make your own Power Glove!

added to your cart!
SparkFun Qwiic Flex Glove Controller
In stock SEN-14666
The SparkFun Qwiic Flex Glove Controller allows you to incorporate flex sensors into a glove to control lighting, sound, and ā¦
$39.95
Favorited Favorite 1
Wish List
Flex sensors are great for telling how bent something is in a project, but weāve been running into issues with durability when using them in wearable applications like gloves. The SparkFun Qwiic Flex Glove Controller isolates the weak point on each flex sensor to allow for more permanent applications. Essentially, this board allows you to incorporate flex sensors into a glove to control lighting, sound and other effects, making it perfect for wearable and e-textile applications! To make it even easier to use this controller, all communication is enacted exclusively via I2C, utilizing our handy Qwiic system. However, we still have broken out 0.1"-spaced pins in case you prefer to use a breadboard.
youtube
Mux or Multiplexer, you decide!

added to your cart!
SparkFun Qwiic Mux Breakout - 8 Channel (TCA9548A)
In stock BOB-14685
The SparkFun Qwiic Mux Breakout enables communication with multiple I2C devices that have the same address that makes it simpā¦
$9.95
Favorited Favorite 0
Wish List
Have a bunch of sensors with the same I2C address? Put them on the SparkFun Qwiic Mux Breakout to get them all talking on the same bus! The Qwiic Mux Breakout enables communication with multiple I2C devices that have the same address, making it simple to interface with. The Qwiic Mux also has eight configurable addresses of its own, allowing for up to 64 I2C buses on a connection.

added to your cart!
Flush Cutters - Xcelite
In stock TOL-14782
These are simple flush cutters from Excelite that give you a way to cut leads very cleanly and close to the solder joint.
$7.95
Favorited Favorite 1
Wish List
These are simple flush cutters from Excelite that give you a way to cut leads very cleanly and close to the solder joint. Diagonal cutters are good, but if you really need to get up close and personal, flush cutters are the way to go!
Thatās it for this week, everyone! There are plenty of options available for you today to start a new project with. As always, we canāt wait to see what you make! Shoot us a tweet @sparkfun, or let us know on Instagram or Facebook. Weād love to see what projects youāve made!
Weāll be back next week with even more fantastic new products!
comments | comment feed
0 notes
Video
youtube
TCA9548A I2C Multiplexer Module - With Arduino and NodeMCU
Did you ever get into a situation where you had to wire up two, three or more I2C Sensors to your Arduino just to realize that the sensors have a fixed or same I2C address. Moreover, you cannot have two devices with the same address on the same SDA/SCL pins!So, what are your options? Put them all on the TCA9548A 1-to-8 I2C multiplexer to get them all talking to each other on the same bus! The TCA9548A Breakout enables communication with multiple I2C devices that have the same address making it simple to interface with them.
Blog Post:Ā https://diyfactory007.blogspot.com/2018/11/tca9548a-i2c-multiplexer-module-with.html
0 notes
Video
youtube
OLED I2C Display Arduino/NodeMCU Tutorial
The very first program you write when you start learning a new programming language is : "Hello World!". The program itself does nothing more than printing a āHello Worldā text on the screen. So, how do we get our Arduino to display the "Hello World!"? In this video I will be showing you how to get started with the small 0.91 (128x32) and 0.96 (128x64) I2C OLED displays. There are 100s of tutorials on the web explaining the same thing in different ways, but I couldn't find one that tells me all about the OLED display and how to use it in different scenarios. It took me some time to work it all out. So, I thought I should create a tutorial on what I have learned and combine all the features and ways the OLED displays can be used in our projects.
#0.96 oled arduino#0.91 oled arduino#Inter-Integrated Circuit#TCA9548A I2C multiplexer#connecting more than two oled#adafruit ssd1306#Arduino Tutorial graphics for displays SSD1306
2 notes
Ā·
View notes