The main reason is the I2C mode enabling to daisy-chain many devices given that they have an unique address. With I2C, one pair of wires (one for the Clock and another for the Data) is sufficient to chain up several devices. When you need to read or write data, you call up the device by its address. In this tutorial, I use I2C to daisy-chain DO, pH, Real-Time Clock modules and 20x04 LCD display.
Alternatively, we can connect the DO and pH breakout by Serial Communication. This method needs two wires per device, one for transmit (TX) and one for receive (RX). To communicate with other device, the wires are crossed, TX connects to RX, and RX to TX between clients. Serial method is simple and do not need address like I2C. The Arduino Nano board has one pair of Serial communication and when we use this two pins to read data from one device, it cannot be used to program from a computer or print out data to a monitor. Fortunately, there are
AltSoftSerial libraries to utilize some of pins for Serial Communication.
The pH and DO breakouts are shipped with Serial communication as the default mode Transmit/Receive (TX/RX). To use the I2C mode Clock line (SCL), and Data line (SDA), switch mode by:
More details, please check on page 39 (Datasheet for pH circuit link here )
To switch mode using the Serial Monitor, the code has to updated to the UNO/MEGA with the pH breakout connects in Serial mode then enter to Serial Monitor/Arduino IDE
I2C,n, which n is an integer between 1-127, and for address of the pH breakout. The default is 99 (0x63). After that the wiring is redo in I2C mode.
It is backward after using high-speed USB stick with FAT32 or exFAT format and then working on the SD Card module. Use FAT16 is recommended. Consults this reference on Arduino.cc for more. For Linux users, format SD card with FAT16 with
sudo mkdosfs -F 16 /dev/sdb1 command and
blkid for checking partitions mounted to the system.
The SD module uses 5 wires (MISO, MOSI, SS, VCC, GND) and is faster than I2C. More details on these two modes are here. The designated pins for SPI mode on Arduino Mega and UNO/Nano are different.
Yes, I get the point there. I worked on this project sometimes around December 2015. I were 85% environmental engineer then. So this tutorial is for the beginner or anyone looking for a simple option to record data. Other options are ESP8266 with its internal flash, using Raspberry Pi, or pushing data directly to the server by MQTT.
For outdoor or remote applications, having SD card module is handy since the wireless communication either by WiFi or via GSM requires a stiff learning curves.
After soldering or wiring devices, I often (but not always) check for a short circuit. It was a painful experience to have a short circuit and what I had left were burned components and a disctint but similar smell.
To check the circuit, turn the dial to test conductivity with a symbol looks like a small speaker. Then I checked the conductivity between VCC and GND, if no sound that is good and then moving on to check the voltage. If there was a sound, the circuit was short. Checking voltage is assure a good connectivity.