Hoa (David) To Get In Touch

Get In Touch

Prefer using email? Say hi at hoa.hh.to@gmail.com

Smart Home Utility

Proof-of-concept solution to manage household utilities leveraging smart home technology.

Technology used: C#, Unity3D, AWS Serverless Architecture, Android Studio

Smart Home Utility is a proof-of-concept that let the user manage their household utilities (gas, hydro, and electricity) usage through a mobile phone.

SHU comprises 4 main components:

  1. Smart meters
  2. Central IoT Hub
  3. AWS Database
  4. Mobile application

The meters will be installed on the corresponding pipes within the household. These meters will constantly records the utilities’ usages which are stored in the database and displayed on the mobile application. The user can monitor the usage, set usage threshold, and receive notifications through the app.


My work

To easily demonstrate the capabilities of SHU, I programmed a simulation using Unity3D which showcases how the solution works in practice.

The cylinder model represents the user in their household along with appliances that simulate the consumption of each utility. For example, when the lights are turned on, the readings for electricity consumption increases:

This is achieved by writing a C# script to set an initial value, increase the value every frame that the lights are on, calculate the differences,

IEnumerator measuringElecUsage(int updateTimer)
{
    // Send requeset using API after delaying for "timer" seconds.
    while (true)
    {
        yield return new WaitForSeconds(updateTimer);
        
        if ((light_1.enabled && !light_2.enabled) || (!light_1.enabled && light_2.enabled))
            currentElecUsage += elecDefaultValue;
        // Light 1 = 1 && Light2 = 1
        else if (light_1.enabled && light_2.enabled)
            currentElecUsage += elecDefaultValue * 2;
        else
            currentElecUsage = 0.0m;
        totalElecUsage += currentElecUsage;
            
        // Debug.Log("Elec Usage : " + currentElecUsage);
    }
}

then finally send the data as a JSON to the AWS endpoint.

public async Task SendRequest()
{
    var req = new Request
    {
        id = "iNAanuUM", // id
        type = "centralHub", // type
        devices = new List<IDevice>{ // devices
        ...
        new Device{
            id = "FKUsIR3l",
             type = "ELECTRICITY_METER",
              consumption = new Consumption
              {
                value = currentElecUsage,
                 unit = "wH",
                 }},
    }};
    
    var s = JsonConvert.SerializeObject(req, new JsonSerializerSettings
    {
        Formatting = Formatting.Indented
    });

    var httpClient = new HttpClient();
    httpClient.DefaultRequestHeaders.Add("token", "*******");
    var response = httpClient.PostAsync("***.amazonaws.com/smart-utility-iot/devices", new StringContent(s)).GetAwaiter().GetResult();
    ...
}  

Acknowledgement

Smart Home Utility is a Master academic group project for the course Advanced Software Engineering at University of Windsor. This is an ambitious group project that tested the limit of the team’s technical knowledge, resources management, and collaborative skills.

I am grateful for the contributions of all of my teammates.

Feel free to check out more details regarding this project here


Hey, I’m Hoa, you can call me David, happy to meet connect with you!

I’m a designer and a developer with over 12 years of experience under my belt.

As a passionate developer, I'm on the lookout for opportunities to further improve my skills and contribute to exciting projects. With experience in web development, programming APIs, plugins for frameworks, and delving into computer networking, I thrive on problem-solving challenges.

I’d love to learn about your company and see how I can help, feel free to email me!

Get in Touch