Sunday, May 27, 2018

WEEK 13: CONSTRUCTING THE COMPLETE CIRCUIT

Complete circuit of the water quality monitoring system (Fritzing)

The final product of the water quality monitoring system is constructed based on the fritzing done as shown in the picture above. 

Hardware setup of the final product

The configuration of the hardware that has been set up on which pin the sensors are connected to, is as shown in the table below. Both pH sensor and temperature sensor is connected to the analog pin while the dissolved oxygen sensor is connected to the I2C pin of the microcontroller since the sensor module is switched into I2C mode.

Circuit configuration



WEEK 12: COMPILING THE CODING

All the codings of the individual sensors is compiled in one program where the program enables data transmission to the cloud server. The WiFi Id and password is set up in the coding (on the highlighted part in the picture below) to successfully connect to the WiFi connection. 

Set up the WiFi Id and password

Each of the sensors used is designed with its specific variable in the coding to be called out to display the data on the dashboard by accessing the specific IP address. The data won't be display properly or it will display nothing at all if wrong variables is set on the node-red.

Variables designed for each of the sensor

Node-Red dashboard designed for the user interface

WEEK 11: DISSOLVED OXYGEN SENSOR

Dissolved oxygen sensor circuit

The EZO sensor module can be operated by either by using UART or I2C protocol. I choose to use the I2C protocol since I can't seem to solve the error arise from the UART coding. Since the I2C protocol is used, the sensor module need to change into I2C mode as the sensor module is in UART mode by default. The coding for both mode is as provided at the manufacturer’s website, so it can be use according to the switched mode.

Switching the sensor module into I2C mode

Two 4.7k resistor need to be used as a pull-up resistor for each SDA and SCL line when using the I2C mode to operate the dissolved oxygen sensor. The SDA pin of the EZO sensor module is connected to the SDA pin of the microcontroller and the same goes with the SCL pin connection, the EZO sensor module’s SCL pin is connected to the SCL pin on the microcontroller.

Connection for the I2C mode


WEEK 10: VALIDATING THE TEMPERATURE SENSOR

DS18B20 Temperature sensor circuit

The accuracy of the DS18B20 temperature sensor is tested using a digital thermometer where the reading obtained from both DS18B20 temperature sensor and the digital thermometer is compared. The reading for the DS18B20 is as displayed on the serial monitor of Energia software. 

Measurement comparisonn between DS18B20 and Digital Thermometer

The accuracy of the temperature sensor can be calculated using the percentage error. The calculation is as shown below.


The percentage error of the DS18B20 temperature sensor compared to the digital thermometer is just 0.44%, that is almost zero which is suitable for the water temperature measurement for its accuracy.


WEEK 9: pH SENSOR Calibration

I've tried testing the pH sensor to see whether it able to produce a reading or not. The connection between the board and the pH sensor is as below:

CC3200 and pH module connection (fritzing)

A 10 k potentiometer is used to as a part of the calibration. The DATA pin of the pH module is connected to the potentiometer where the output from it is connected to the  to the analogRead pin 2 of the CC3200 board while the VCC and Ground pin is connected accordingly.

Before it can be use to measure the pH water, it needs to be calibrate first to ensure its accuracy. The calibration is divided into two part, which is the sensor module calibration and the probe calibration. For the sensor module calibration, the BNC part of the sensor module is short-circuit by using a stripped wire to simulate a neutral pH reading that is pH 7. The 10k potentiometer controls the output voltage to the analog pin of the microcontroller so that the output voltage from the is 2.5V the neutral state, pH 7. 

Short-circuit of the BNC connector
The pH probe is calibrated using the buffer solution. There is three buffer solution which the common buffer solution used are pH 4.01 and pH 6.86, as it applies to the range of most pH applications while the other one is pH 9.18. The buffer solution is made by adding the buffer powder to 250 ml of distilled water and stirred until dissolved.

Buffer powder
Replace the stripped wire with the probe, connect it to the sensor module and immersed the probe in the pH solution. The offset for the pH probe calibration is set at the coding on the Energia software based on the value of the pH displayed on the serial monitor. In example, if the reading on the serial monitor is pH 5.44 and the buffer solution is pH 6.86, change the offset value to 1.42.


Setting pH the pH probe offset

WEEK 8: PORTABLE HOTSPOT

Since this project implement the IOT platform in the water quality monitoring system in the fish farm, a portable WiFi device needs to be used to ensure the system is connected to WiFi the whole time. This is because WiFi connection is needed to ensure that the data collected from the sensors is transferred to the cloud server so that it can be accessed by the user.

For that reason, I'm using the Tenda portable WiFi device or known as Tenda pocket WiFi to solve the WiFi connection problem.

Tenda 3G185 Portable Mobile Wireless Router
Any sim-card with active internet connection be plug into the Tenda pocket WiFi to enable the WiFi function of the device. However it only supports 3G and 2G connection which means it olnly connects to 3G connection even though 4G LTE supported sim-card is inserted.

Inner part of the Tenda pocket WiFi
The sim-card slot of the Tenda pocket WiFi is shown in the picture above. The WiFi Id and password can be found just below the barcode of the device near to the sim-card slot. After inserting the sim-card, the device needs to be set up first to fully enable the WiFi connection. The steps on the setup for the Tenda pocket WiFi can is as shown here. Despite of it compact size, the Tenda pocket WiFi use a powerful internal battery of 2000mAh that can lasts up to 6 hours which is ideal for extended hours of outdoor use.

Tuesday, April 10, 2018

WEEK 7: pH SENSOR

This time the pH sensor has arrived after a lot of problems faced during the delivery process where the shop assistant does not update the order status of the item. The pH sensor comes with the pH probe, pH module and the buffer pH solution. I have to wait until the buffer pH solution arrived first in order to test the pH sensor because somehow there is no buffer pH solution in the parcel received. 

I have informed the shop assistant about this problem. The shop assistant said that the cost of the delivery will be covered by them and the calibration solution will be arrived in 1-2 working days. 

pH probe.

pH module.
Pin configuration of the pH module.