UART AND I2C MODE SWITCHING FOR ATLAS SCIENTIFIC EZO CIRCUITS

About: Atlas Scientific is on a mission to convert devices that were originally designed to be used by humans into devices that are specifically designed to be used by robots. We isolate the core functionality of h...

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: I2C/UART command using Arduino

Methods 1-3 will work for the following circuits: EZO pH, EZO EC, EZO DO, EZO ORP, EZO RTD, and EZO FLO.

Methods 2 and 3 are more convenient for the EZO PMP and EZO CO2 due to their design.

Supplies:

Step 1: USING THE WHITEBOX LABS I2C TOGGLER

ADVANTAGES:

  • Easiest to set up
  • The fastest method for switching lots of circuits.
  • No 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).

Step 2: MANUAL SWITCHING

ADVANTAGES:

  • Most “DIY”
  • No programming required

MATERIALS:

    • Breadboard
    • Jumper wires
    • Power supply

    The EZO pH and EZO PMP circuits 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 EZO EC short TX to the right PRB. For the EZO RTD and EZO FLO short TX and PRB. For the EZO PMP short TX and INT. For the EZO CO2 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 EZO pH and EZO PMP circuits 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 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). 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 PMP. 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 , PMP.

      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 color status of the EZO is a great 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.

      Share

        Recommendations

        • Arduino Contest 2019

          Arduino Contest 2019
        • Classroom Science Contest

          Classroom Science Contest
        • Colors of the Rainbow Contest

          Colors of the Rainbow Contest

        Discussions