FINAL Project02 – The Use of Rainwater

Introduction of OLED I2C Display1891524023223_.pic.jpg

How to connect and program the Geekcreit 0.96 inch 4 pin white I2C OLED module with Arduino. OLED display based on a SSD1306 OLED driver IC.

The display connects to Arduino using only four wires – two for power and two for data, making the wiring very simple. The data connection is I2C (I²C, IIC or Inter-Integrated Circuit). This interface is sometimes called TWI (Two Wire Interface).

Reference from: https://startingelectronics.org/tutorials/arduino/modules/OLED-128×64-I2C-display/

Testing – 1 Display Text on OLED Screen

arduino-oled-connection.jpg

 

 

 

 

Connect the display to UNO board as the image shown.

Before start coding, I need to import two zip libraries for add graphic to the display.

屏幕快照 2018-04-18 04.50.39

 

 

 

1911524023224_.pic_hd.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

After reading the reviews of this module from Amazon, I’ve done some changes to the raw files, and started coding on a sketch template from https://startingelectronics.org/tutorials/arduino/modules/OLED-128×64-I2C-display/

Here’s the code.

屏幕快照 2018-04-18 05.08.50.png

This is how it shows on the display.

1921524025932_.pic_hd.jpg

Testing – 2   Display Sensor Data on the Screen

 2071524097426_.pic_hd.jpg

Add a water level sensor to the circuit on pin A0.

A Flow Chart for Programing

display.png

 

屏幕快照 2018-04-18 05.02.36.png

Then add these code before setup as a intro for the water level sensor.
屏幕快照 2018-04-18 05.03.53.png

 

 

 

Also add these to loop to run the program, so the reading will be taken from pin A0 and displayed on the screen.

 

 

 

Here’s the video show how it works.

https://youtu.be/CXJux2UsGps

And this is the full code for this part.

https://create.arduino.cc/editor/yusu1224/5c4b83ed-bc22-41dd-ab72-c5f25af18e65/preview

Conclusion

As I’ve make the valve and OLED display run perfectly, then I put them into one circuit, and merged the code together.

2061524097424_.pic_hd.jpg

The Full Version Flow Chart

rainwater.png

The full code for this project is here.

https://create.arduino.cc/editor/yusu1224/9c289f2c-b899-421a-b835-d8177f93cb41/preview

Prototype Building

1941524025939_.pic_hd.jpg1951524025944_.pic_hd.jpg1931524025935_.pic_hd.jpg1961524025944_.pic_hd.jpg

Here’s the video for the working prototype.

The model will leak water, so I use finger instead of water to show how it works.

https://youtu.be/wwJpjVUDl_8

 

Reference

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s