Wednesday, May 30, 2018

WEEK 17: FYP REPORT PROGRESS

This is the last week to finish up the report as it need to be submit to the FYP coordinator on 1st June 2018 before 5 pm. I've re-submit to Dr. Masum for final review before do the hardcover printing. The plagiarism for my report is 5% so I don't have to do any correction to reduce the plagiarism percentage as it must be less than 20% for the report to be accepted by the FYP coordinator as stated in the FYP handbook.

The cover page and the plagiarism percentage of the FYP report
I went to the Achik Printing factory to do the hardcover printing for the FYP report as this is the only nearby printing shop that offers a fast service with a cheaper price compared to others where I can collect it the next day.

The Hardcover of the final FYP report


Tuesday, May 29, 2018

WEEK 16: FINAL YEAR PROJECT REPORT PROGRESS

The last thing to do is to complete the Chapter 4 and 5 which is the Result and the Conclusion of the Final Year Project Report. I've done it and submitted to Dr. Masum to check it. He said that I need to do some correction and improvement in some part of the report where there is some grammatical mistakes and the position of the captions of the figure to be corrected.

Most of the parts to be corrected is on the introduction and chapter summary on chapter 2 and chapter 4 which I need to elaborate more on what has been done in the progress of completing the project and the results obtained from testing the project.

Cover page of the draft submitted to Dr. Masum


One of the correction and improvement to be made on the report.

Sunday, May 27, 2018

WEEK 15: FYP 2 PRESENTATION DAY

The Final Year Project 2 presentation day was held on 2nd May 2018 in week 14 where all of the students taking Final Year Project 2 presenting their project. The assessors that is assigned to assess my project is Sir Azlan and another one is Sir Zainal, the assessor from the industry. I have presented my project by presenting the poster I've done which include all the things about my project before showing them how my project works. Fortunately, all the real-time data that is currently measured is successfully displayed on the node-red dashboard.

The poster of my project

At the end of the presentation, Sir Zainal said that my project need to have the feedback system integrated in it to control the condition of the water quality which the feature would be able to re-balance the water quality condition into optimal state. 

WEEK 14: FINAL PROJECT TESTING


The hardware setup is the same as shown in the previous post. The experiment to test the functionality of the monitoring system is set up by placing the sensors in the water. The sensors are tested using a water that is simulated to the one used in the catfish tank except for the chlorine content in the water is not filtered but it will not affect the reading produced by the sensors. The temperature sensor is tested by adding a slightly hot and cold water into the container used to hold the water which also will affect the amount of dissolved oxygen and the pH value of the water. This is because more dissolved oxygen present in the cold water than warm and the pH measurement varies in different temperature. The normal condition for the pH measurement is at 25 C at where the pH value varies at ±0.001 pH in a temperature other than 25 C.

The changes in water temperature

The graph rises a bit when a little hot water is added before it goes back to a constant reading. When a slightly cold water is added, the water temperature drops from 30.31°C to 28.43°C. The changes in the water temperature is not obvious as shows in the graph for the insignificant drops of 1.88°C.

Changes in pH value of the water

The pH value turns from neutral state into acidic and alkaline state when the pH solution of 4.00 (acidic) and 9.18 (alkaline) is added to it.the colour changes from green which indicates normal condition into red colour which indicates a warning sign when the water quality is in a bad condition.

Dissolved oxygen value

From the beginning until the end, the sensor produced a reading 0 mg/L for the content of the dissolved oxygen. This condition means that there is no oxygen at all in the water which makes the water not suitable to be used for the catfish or any other living creature to live in. it is possible for the water to possess no oxygen at all since I’m using tap water which normally possess 10 mg/L of the dissolved oxygen content in it. The voltage output from the sensor is not zero when measured using the multimeter, which means that there is oxygen detected by the sensors since the content of the dissolved oxygen in the water is directly proportional to the voltage output from the probe. The connection and coding of the dissolved oxygen sensor needs to be revised according to the datasheet provided on the manufacturer’s website.



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.

WEEK 6: DS18B20 WATER TEMPERATURE SENSOR

The DS18B20 water temperature I oredered from Cytron Technologies has arrived.

DS18B20 water temperature sensor.

The hardware used :

  • DS18B20 water temperature sensor
  • 2.7k resistor


Connection:


Connection between the DS18B20 and CC3200 board

The DATA pin is connected to the pin 10 of the board.

The 2.7k resistor is connected to the VCC and DATA pin of the DS18B20.

I refer to the DS18B20 Testing in circuit constructing and testing where OneWire protocol is used in the providing calibrated digital temperature readings directly which is why the DATA pin is connected to the CC3200 digital pin. For more information about the OneWire protocol can be found here.

The OneWire program can be found in the example tab on the Energia IDE to test the DS18B20 sensor.

Choose the DS18x20_Temperature program from the OneWire tab.

OneWire program.
The output for the program is as shown below. It displays the temperature measured by the DS18B20 water temperature sensor when uploaded into the CC3200 board.

The temperature measured is displayed on the Serial Monitor.


Tuesday, April 3, 2018

WEEK 5: ANALOG READING- POTENTIOMETER



This is the task that I did to test the board to read the analog input and display it on the serial monitor. A potentiometer is a simple mechanical device that provides a varying amount of resistance when its shaft is turned. By passing voltage through a potentiometer and into an analog input of the board, the amount of the resistance produced by the potentiometer can be measured as an anlog value. The value of the potentiometer resistance is monitored after the serial communication between the CC3200 board and the Energia IDE software on the computer has been established.

Hardware Used :
  • CC3200 board
  • 10k Potentiometer



Connection : 



Connection between the potentiometer and CC3200 board    

The three pins from the potentiometer is connected to the board where the connection to the board is based on the pin description shown on the picture above. The +5V connected to the 5 volts, the ground is connected to the ground and the signal or also known as data pin is connected to the analog pin on the board where I'm using the pin 2 on the board.

I'm using the program "Analog Read Serial" from the example menu and the output is as shown below.

The program and the output display of the potentiometer resistance value.




Wednesday, March 28, 2018

WEEK 5: FRITZING - Connection

Below is the list of sensors I'm using:-
a) DS18B20 water temperature sensor
b) SEN0161 pH water sensor 
c) Atlas Scientific dissolved oxygen sensor

So based on the sensors above, I've done the virtual connection which I'm planning to do on the hardware later. I tried using the Fritzing software which I only manage to do the connection on the dissolved oxygen module since I can't find the part for pH and water temperature.


Fritzing of the hardware

Thursday, March 22, 2018

WEEK 4: COMPARING THE PRICE OFFERED AT JALAN PASAR

While waiting for the temperature sensor to arrive, I've also surveyed the pH and dissolved oxygen sensor. So, I went to the Jalan Pasar, a well-known place to shops for the electronic components and stuffs related to it. Since I'm in a tight budget, i went a few shops to compare the prices. 

Unfortunately, the dissolved sensor is not available at all the shop i visited and the only solution for that is by ordering the dissolved oxygen sensor online at the trusted website. To ensure that that the websites is trusted, I always done a little bit of research on it by reading all of the customer reviews before deciding whether to buy from the certain website or not.

For the pH sensor, the prices ranged from RM150 to RM180 for the one that includes the pH module whereas the price for the pH probe without the module is only RM60 as offered at the Sigma Electronics. Besides that, the price for the pH sensor with pH module at QQ Trading is RM180 while the shop which I'm not sure what the name of the company offered a lower price than QQ Trading which is RM169.

pH probe without pH module available at Sigma Elcetronics.
                                             
pH sensor (pH module included) at QQ Trading.
In the end, I decided to take a look at the price of the pH sensor offered online since there is not much choices at the shops in Jalan Pasar which the price may be much cheaper than the one offered at Jalan Pasar.

This is the shop which I'm not sure the name of the company.
                                           
The uncle (owner of the shop) checking the component using multimeter.

                                         
                                               
                                  

WEEK 3: TEMPERATURE SENSOR

I've successfully ordered the DS18B20 temperature sensor online on the Cytron website. For your information, Cytron offers free shipping as a part of the benefits when you signed up for their student program which is why I ordered the temperature sensor here.

Order Information on Cytron's Website.

So, as shown in above the total price is RM16.69 (including GST) since i ordered two temperature sensor for me and my friend. The temperature sensor is estimated to be arrived in 2-3 working days unless there's a problem with the item or the process, where the time of arrival may be delay for a few days.



Wednesday, March 14, 2018

WEEK 3: TEMPERATURE SENSOR

I've decided to use the DS18B20 temperature sensor as it is waterproof. Since my water quality monitoring project requires the sensor to be immersed in the water, so this type of water temperature sensor is very suitable to be used in my project.

DS18B20 Temperature Sensor
The DS18B20 Digital Temperature Probe provides 9 to 12 bit (configurable) temperature readings which indicate the temperature of the device. Information is sent to/from the DS18B20 over a 1-Wire interface, so that only one wire (and ground) needs to be connected from a central microprocessor to a DS18B20. Power for reading, writing, and performing temperature conversions can be derived from the data line itself with no need for an external power source. Each DS18B20 contains a unique silicon serial number, multiple DS18B20 temperature sensors can exist on the same 1-Wire bus. This allows for placing temperature sensors in many different places which is a perfect sensor to be used for monitoring purpose.

The specification of the water temperature is as below:

DS18B20 Temperature Sensor Specification


Wednesday, February 21, 2018

WEEK 2: RUNNING THE WI-FI PROGRAM ON CC3200

I'm testing the CC3200 board with the IoT program which sends the data to the cloud via the server created. At first, i thought there's something wrong with the MQTT user interface because the symbols all have been zoomed in. So i asked for Dr. Zulkhairi and Dr. Masum's help to complete the task. It turns out the MQTT still can be used despite of the zoomed user interface.

Zoomed MQTT lens user interface

The normal MQTT user interface should look just like the picture below:

Normal MQTT lens user interface
Next, I need to connect to the server environment using the Node-Red interface. I had to use my own hotspot because it can't work using the bmi's wifi.

Change the wifi variable according to the wifi used to run the program


Node-Red command prompt to set up the server environment

Despite of the zoomed user interface, i able to successfully complete the task with my supervisors help. The data from the sensors which i tried to display the temperature of the surroundings measured by the built-in temperature sensor from the cloud.

Node-Red Dashboard that display the data