HOW TO CHANGE DATA PROTOCOL OF ATLAS SENSORS

Introduction: HOW TO CHANGE DATA PROTOCOL OF ATLAS SENSORS

About: Founded in 2005, Atlas Scientific specializes in building laboratory grade sensing equipment for robots, appliances, and industrial control systems. Thousands of Atlas Scientific sensors can be found in a wi...

Atlas Scientific's line of EZO circuits has two data protocols, UART and I2C. The circuits are in UART mode by default. But what happens if your application requires I2C? Or maybe the circuits are already in I2C, and you would like to revert to UART? The following three methods demonstrate how to change between protocols.

Method 1: Using the Whitebox Labs I2C toggler

Method 2: Manual Switching

Method 3: UART/I2C command using Arduino

Methods 1-3 will work for the following EZO circuits: pH, salinity, dissolved oxygen (DO), oxidation-reduction potential (ORP), temperature, and flow.

Methods 2 and 3 are more convenient for the peristaltic pump and CO2 due to their design.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: USING THE WHITEBOX LABS I2C TOGGLER

ADVANTAGES:

  • Easiest to set up
  • The fastest method for switching lots of circuits.
  • No wiring and programming required

MATERIALS:

PROCEDURE:

    1. Insert your EZO circuit into the I2C toggler.
    2. Plug I2C toggler into USB port/cable.
    3. Press and hold the button for ~1 second.
    4. Release after the color changes. Protocol change complete! (Green = UART, Blue = I2C).

    Note: Depending on which EZO circuits you are working with, the switch on the toggler must be set to the appropriate position as indicated by the inscription on the board. The picture above provides a summary.

    Step 2: MANUAL SWITCHING

    ADVANTAGES:

    • Most “DIY”
    • No programming required

    MATERIALS:

      • Breadboard
      • Jumper wires
      • Power supply

      The pH sensor and peristaltic pump are used in the demonstrations.

      PROCEDURE:

          1. Place circuit in breadboard and power it. Note: The power can be supplied by a bench top supply or even an Arduino or Raspberry Pi. Keep in mind that the operating voltage of the EZO circuits is 3.3V − 5V.
          2. The LED color status of the EZO is an indicator of the current data protocol of the circuit. Once power has been issued, note the color. (Green = UART, Blue = I2C)
          3. Disconnect the GND (power off) as well as TX and RX if it is connected to a microcontroller.
          4. For most circuits, short TX and PGND. For salinity sensor short, TX to the right PRB. For the temperature sensor and flow short TX and PRB. For the peristaltic pump, short TX and INT. For the CO2 sensor, short TX and ALM.
          5. Confirm that RX is disconnected if was hooked to a microcontroller
          6. Connect the ground (power on)
          7. Wait for the LED to change color. Protocol change complete. (Green -> blue = UART -> I2C) (Blue -> green = I2C -> UART)
          8. Disconnect GND once more.
          9. Connect power, ground, and data for the appropriate protocol.

          Note: Using the manual method will set the I2C address of the circuit to its default. Default addresses are listed in the datasheet of the respective EZO circuits on the Atlas Scientific website. For more information on this method refer to the “Manual Switching” sections of the corresponding EZO datasheets.

          Step 3: UART/I2C COMMAND USING ARDUINO

          ADVANTAGES:

          • Lets you assign an I2C address
          • Assigning different addresses permits the use of multiples of the same circuit (example 2 PH circuits in I2C).
          • Allows you to change the baud rate

          MATERIALS:

          The pH sensor and peristaltic pump are used in the demonstrations.

          PROCEDURE:

          Going from UART to I2C

          1. Wire the pH (as shown in Fig5) or PUMP (as shown in Fig6) circuit to the Arduino. Use the breadboard as the base for the circuit or an Atlas Scientific non-USB carrier board.
          2. The LED of the sensor can be used as an indicator of the current data protocol of the circuit. Once power has been issued, note the color. (Green = UART, Blue = I2C). If it is in UART proceed to step 3. If it is in I2C proceed to section “Going from I2C to UART”.
          3. Flash your Arduino with the sample code for pH or peristaltic pump. Note: Remember to set the baud rate to 9600 and append “carriage return” in your Arduino serial monitor. The serial monitor is used to talk to the EZO board.
          4. To ensure that you can communicate with the circuit send the command i in your serial monitor. This will return the device information.
          5. Send the command i2c,n where n is an integer from 1-127. Device reboots and the LED has been changed from green to blue. Protocol change complete! Note: Once the protocol has been changed you will have to alter the Arduino wiring and sample code to use the I2C protocol in order to communicate with the device. Refer to the following: pH, pump.

          Going from I2C to UART

          1. Wire the pH (as shown in Fig7) or PUMP (as shown in Fig8) circuit to the Arduino. Use the breadboard as the base for the circuit or an Atlas Scientific non-USB carrier board.
          2. The LED of the sensor can be used as an indicator of the current data protocol of the circuit. Once power has been issued, note the color. (Green = UART, Blue = I2C). If it is in I2C proceed to step 3. If it is in UART proceed to section “Going from UART to I2C”.
          3. Flash your Arduino with the sample code. As each circuit comes with its unique default I2C address, each code reflects the corresponding address. pH sample code , PMP sample code . Note: Remember to set the baud rate to 9600 and append “carriage return” in your Arduino serial monitor. The serial monitor is used to talk to the EZO board.
          4. To ensure that you can communicate with the circuit send command i in your serial monitor. This will return the device information.
          5. Send the command baud,n where n can be one of the following: 300, 1200, 2400, 9600, 19200, 38400, 57600, 115200. Device reboots and the LED has been changed from blue to green. Protocol change complete! Note: Once the protocol has been changed, you will have to change the Arduino wiring and sample code to use the UART protocol in order to communicate with the device. Refer to the following link.

          Be the First to Share

            Recommendations

            • Backyard Contest

              Backyard Contest
            • Silly Hats Speed Challenge

              Silly Hats Speed Challenge
            • Finish It Already Speed Challenge

              Finish It Already Speed Challenge

            2 Discussions

            0
            juliusau
            juliusau

            Question 6 weeks ago on Step 3

            I switched from UART to I2C. Green to blue but when i uploaded the sample code the serial monitor isn't showing anything. I input command i and it says no data. What might be the problem?

            0
            AtlasScientific
            AtlasScientific

            Answer 6 weeks ago

            Hi,
            well you have successfully changed the circuit from UART to I2C,
            Aside from that, its hard to say where you've gone wrong....
            You can try to re upload the code, and check your wiring.
            If your still having trouble please contact us at support@atlas-scientific.com
            include pictures and screen shots