2020/12/31

How to use / navigate this blog

This is a quick summary of how to use / navigate this blog.

Auto Translation by Google Translate

Use the Select Language widget to translate this blog into the language of you choosing (the translation quality may not be good, but I think it's enough to give you some general idea about the post).













2017/07/26

IOT Fish Tank

For the past couple of months I've been working on a project that allows me to monitor fish tank and feed the fishes.

The things that I want to do are the followings:

- Feed fishes automatically based on preset schedule or manually by pressing a button on the controller;

- Measure water temperature and water level;

- Measure the ambient light, temperature and humidity;

- Check on the fishes remotely;

- Be able to switch on / off peripherals such as lamp / pump / heater / etc. remotely.

After months of trials and errors and several revision of hardware and software, I am happy to present the result below.

2017/07/12

Python - How to get the elapsed time in seconds

Here is the sample code for getting the elapsed time using Python.

The Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
import time

def stopwatch(seconds):
    start = time.time()
    time.clock()    
    elapsed = 0
    while elapsed < seconds:
        elapsed = time.time() - start
        print "loop cycle time: %f, seconds count: %02d" % (time.clock() , elapsed) 
        time.sleep(1)  

stopwatch(20)

2017/06/26

Working with HC-SR04 Ultrasonic Sensor

This is a brief summary of how to use HC-SR04 ultrasonic sensor.

Schematic


RJ-11 as physical I/O interface

For board with multiple I/O ports and each port has multiple wires, I find it quite convenient to use RJ-11 as the physical I/O interface because it could be plugged / unplugged very quickly and it supports up to 6 wires in one port.


2017/06/22

ESP8266 SPIFFS

This is a summary of my experience testing out the SPIFFS feature for ESP8266.

Below is the source of the Arduino sketch used.
https://github.com/G6EJD/SPIFFS-Examples/blob/master/ESP8266_SPIFFS_Example.ino