Software apps and online services
Hand tools and fabrication machines
In this project, we will be connecting three of Atlas Scientific's EZO sensors (pH, dissolved oxygen and temperature) to a Raspberry Pi 3B+. Instead of wiring the circuits to the Raspberry Pi, we will be using the Whitebox Labs Tentacle T3 shield. These stackable shields plug into the pins of the Pi after which the EZO circuits and probes connect to the shield. Interacting with the sensors is done using the command terminal in Raspbian.Advantages
- No wiring, no breadboards and no soldering necessary.
- Fully assembled shield easily mount onto Raspberry Pi.
- Built-in isolation protects sensors from interference.
- Connect multiple sensors to a Raspberry Pi.
- Works with the following EZO sensors: pH, salinity, dissolved oxygen, oxidation-reduction potential, temperature, peristaltic pump, and carbon dioxide.
a) Download the Raspbian zip file onto your computer from the following LINK. "Raspbian Buster with desktop and recommended software" is used in this project.
c) Insert the micro SD card into the USB card reader and plug the reader into your computer. In case your SD card needs formatting you can use the SD Formatter program.
d) Open the etcher program.
- Select the Raspbian file download from step a.
- Select your SD card.
- Click on the "Flash!" tab to begin writing to the SD card
a) Connect the monitor, keyboard, and mouse to your Raspberry Pi.
b) After the Raspbian image installation on the SD card is finished, remove it from the computer and insert it into the Raspberry Pi. Turn on the power to the Pi.
Default raspberry credentials: user name is pi and password is raspberry
c) Since this is the first time booting Raspbian, you will be asked to adjust a few settings such as language, time zone and adding internet connectivity. Be sure to connect to the internet as this will be needed in later steps.
UPDATE AND UPGRADE PACKAGES
d) Open the command terminal from the Raspbian desktop. Update the system's package list by entering the following command sudo apt-get update
e) Upgrade the installed packages to their latest versions with the command sudo apt-get upgrade
DOWNLOAD SAMPLE CODE
f) In the terminal run the following commands:
This will add the repository of sample code from Atlas Scientific to the Raspberry Pi. Only the i2c code is needed for this project.
g) Install and enable the I2C bus on the Raspberry Pi. Run the following commands:
sudo apt-get install python-smbus
sudo apt-get install i2c-tools
h) Next, open the configuration window by entering sudo raspi-config
Choose "Interfacing Options"
j) You will be presented with the question "Would you like the ARM I2C interface to be enabled?"
Hit "Ok". Then reboot the Pi with command sudo rebootStep 3: Set Sensors To I2C Mode
The Tentacle T3 shield is I2C compatible only. As such the EZO sensor must be in I2C and not UART mode. If you have multiple of the same sensors (for example 2 pH) be sure to assign unique I2C addresses to each. Failure to do so will result in communication conflicts.
For instructions on how to change between protocols and assigning I2C addresses, refer to the following LINK.Step 4: Mount Shield And Sensors To Raspberry Pi
a) Ensure that power to the Raspberry Pi is turned off.
b) Mount the tentacle shield onto the pins of the Raspberry Pi.
c) Insert the EZO circuits onto the shield. Be sure to match the pins correctly.
c) Connect probes to the female BNC connectors of the shield.
a) Turn on the power to the Pi.
b) Open the terminal and enter sudo i2cdetect -y 1
The program will report information about each connected I2C device. The hex representation of the I2C addresses are shown. (dissolved oxygen = 0x61, pH = 0x63, temperature = 0x66)Step 6: Monitor Readings And Interact With Sensors
a) Open the directory that has the sample codes cd ~/Raspberry-Pi-sample-code
b) Run the I2C script sudo python i2c.py
Each time the script is executed, the user is presented with the menu shown above.
Example: List the addresses of the connected sensors and query each for the device information.
Example: Continuously poll pH sensor
Example: Check if the dissolved oxygen sensor is calibrated.