Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

IoT applications: smart cities and energy

Practical IoT applications in smart cities and energy: definitions, system components, laws for energy and battery sizing, worked numerical examples for battery life and streetlight savings, exam tips and quick checks.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Smart cities and energy systems are major places engineers apply IoT. An engineer uses IoT devices and networks to monitor, control and optimise city services (lighting, traffic, waste, water) and energy systems (smart meters, microgrids, demand response) to save cost, reduce emissions, and improve service reliability.

Key ideas

All bolded terms are defined at first use.

  • Internet of Things (IoT): networked physical devices (things) with sensors, actuators and software that collect and exchange data. I define it here so later topics like MQTT, CoAP and sensors are referred to but not re-taught.
  • Smart city: a city that uses digital technologies and data (including IoT) to improve the efficiency of services, reduce resource use, and improve quality of life.
  • Sensor: a device that measures a physical quantity (for example light intensity, current, temperature) and produces a readable electrical signal.
  • Actuator: a device that performs an action in the physical world under electronic control (for example a relay switching a lamp).
  • Gateway: a network device that connects IoT sensors/actuators (often using low-power wireless) to the Internet or cloud; it may perform protocol translation, security, and edge processing.
  • Edge computing: computing that happens close to the devices (at or near the gateway) instead of in the central cloud; used to reduce latency and network load.
  • Smart meter / Advanced Metering Infrastructure (AMI): a meter that measures energy consumption/production and communicates data for billing, monitoring and demand response.
  • Demand response: adjusting consumer power usage in response to supply conditions (price signals or grid needs) to balance supply and demand.
  • Microgrid: a local group of electricity sources and loads that can operate connected to the main grid or islanded; often includes distributed energy resources (DER) like solar and batteries.

System architecture (what to draw for exams): draw a three-layer diagram left-to-right or top-to-bottom.

  • Layer 1 (Field): many sensors (smart meters, environmental sensors, vehicle detectors) and actuators (streetlight controllers, switches). Label: power source (battery / mains), comm interfaces (LoRa, NB-IoT, Wi‑Fi), and show sample power values.
  • Layer 2 (Edge/Gateway): several gateways that collect messages, do local analytics, and forward to cloud. Label: protocol translation, security (TLS), local database and decision rules.
  • Layer 3 (Cloud/Applications): data storage, analytics, dashboards, billing, demand-response control center, operator interfaces. Show feedback arrows to actuators via gateways.

Energy management principles used in IoT smart cities:

  • Monitor first: continuous or periodic measurement of energy use.
  • Control second: actuate devices to reduce waste (dimming lights, shifting loads).
  • Optimize third: use analytics to schedule loads, integrate DER and storage, and perform demand response.

Important assumptions for calculations below: stable DC supply for sensors, battery voltages constant (use average), communication energy dominated by radio transmissions, sleep/active currents as given in each worked example.

Formulas

P = V · I — electrical power. V is voltage in volts (V), I is current in amperes (A), P is power in watts (W). For AC, use real power: P = Vrms · Irms · pf (power factor, 0–1); for purely resistive loads pf ≈ 1.

E = P · t — energy. E in joules (J) when P in watts and t in seconds. For everyday energy in watt-hours use Wh = P(W) · t(h).

Wh = V · Ah — relationship between watt-hours and ampere-hours. Wh in watt-hours, V in volts, Ah in ampere-hours. Applies to battery capacity at nominal voltage.

I_avg = I_active·D + I_sleep·(1 - D) — average current for a periodic duty-cycle task. I_avg in A, I_active is current during active period, I_sleep is current during sleep, D is duty cycle fraction = t_active / t_period.

Battery life (hours) = Battery_capacity_Ah / I_avg (A) — when battery voltage matches the device nominal voltage and converter losses are ignored. Battery life in hours.

Energy_saved (%) = (E_original - E_new) / E_original · 100 — percent energy saving.

When transmitting messages: Daily_data = message_size_bytes · messages_per_day — total bytes per day per device. Use to compute data-plan or network load. Include protocol/header overhead when sizing data plans and network links.

Notes: include a conversion efficiency factor η (0 < η ≤ 1) when appropriate: E_load = η · E_source (so required source energy = E_load / η); for battery-life estimates, multiply usable battery capacity by η.

Worked examples

Example 1 — Battery life of a LoRaWAN environmental sensor (numerical) Problem: A sensor node runs on a 3.6 V, 8 Ah lithium battery. It wakes once per hour, stays active 2 s per transmission and draws 40 mA when active. In sleep it draws 10 µA. Find average current and battery life in days. Show steps. Step 1: Convert currents to amperes. I_active = 40 mA = 0.040 A. I_sleep = 10 µA = 0.00001 A. Step 2: Duty cycle D = t_active / t_period = 2 s / 3600 s = 0.0005556. Step 3: Average current I_avg = I_active·D + I_sleep·(1 - D). I_avg = 0.040·0.0005556 + 0.00001·(1 - 0.0005556) I_avg = 0.000022222 + 0.0000099944 ≈ 0.0000322167 A = 32.22 µA. Step 4: Battery capacity = 8 Ah. Battery life hours = 8 Ah / 0.0000322167 A ≈ 248,286 hours. Convert to days: 248,286 / 24 ≈ 10,345 days ≈ 28.3 years. Comment: This long life assumes ideal conditions, no self-discharge, no converter losses, and that radio Tx energy is included in the 40 mA figure. Real life expectancy will be much lower; check battery self-discharge and regulatory duty-cycle limits. (Reviewer: check typical active current for chosen radio.)

Example 2 — Energy savings from smart streetlight dimming (numerical) Problem: 1000 streetlights each 150 W when fully on. With IoT control they run full power 6 hours/night and 50% dim (75 W) for 6 hours. Compute daily energy saving and annual saving in kWh. Step 1: Original daily energy per lamp (always full for 12 hours) = 150 W · 12 h = 1800 Wh = 1.8 kWh. Step 2: New daily energy per lamp = full 6 h: 150·6 = 900 Wh; dim 6 h: 75·6 = 450 Wh; total = 1350 Wh = 1.35 kWh. Step 3: Daily saving per lamp = 1.8 - 1.35 = 0.45 kWh. Step 4: For 1000 lamps daily saving = 0.45 · 1000 = 450 kWh/day. Step 5: Annual saving ≈ 450 · 365 = 164,250 kWh/year. Step 6: Percent saving = (0.45 / 1.8)·100 = 25%. Final: Daily saving 450 kWh, annual saving 164,250 kWh (≈25% reduction). Note: does not include control electronics consumption or maintenance effects; include those in detailed design.

Example 3 — Short model answer (theory) for an exam long question Question: Outline an IoT design for integrating rooftop solar and battery storage into a neighborhood microgrid to support demand response. Model answer bullets (full-marks answer includes):

  • List components: PV inverters, battery storage (BMS), smart meters (AMI), local gateway with edge controller, cloud analytics and DR market interface, communication links (e.g., NB‑IoT/LoRaWAN to gateway, gateway to cloud via broadband).
  • Data flows: meters and inverters report generation and consumption every 1–15 minutes; gateway aggregates, runs local optimization (voltage, SOC constraints) and sends aggregated bids to DR platform.
  • Control actions: charge/discharge battery, curtail or shift flexible loads, islanding procedure, safety interlocks per grid codes.
  • Performance metrics: energy cost reduction, peak shaving (kW), reliability (hours of autonomy), and communication latency requirements for grid stability.
  • Security & standards: authenticate devices, encrypt control messages (TLS/DTLS), follow IEC 61850/IEEE 1547 and/or IEEE 2030.5 (SEP2) for DER interoperability, use OpenADR for DR where applicable, and apply IEC 62351; comply with local interconnection regulations.
  • Draw architecture (as earlier) and explain trade-offs (latency vs. centralised analytics, local autonomy during comm outage).

Common mistakes

  • Omitting duty cycle when computing average current; then overestimating consumption.
  • Ignoring inefficiencies (power converters, battery discharge efficiency, self-discharge) in battery-life estimates.
  • Assuming wired-grid reliability for all nodes; many IoT devices rely on battery and wireless networks which have packet loss and latency.
  • Mixing peak power and average power in savings calculations.

For your exam

Kinds of questions:

  • Definitions and short notes (define smart city, gateway, demand response).
  • Diagram: draw an IoT architecture for smart city lighting or a microgrid and label components/flows.
  • Derivation: battery-life calculation with duty cycle, energy saved by dimming.
  • Numerical: calculate data usage, battery life, or energy savings with given numbers.
  • Long/essay: design an IoT solution for a specific city service and discuss security, scalability and standards.

What full-marks answers include:

  • Correct definitions (bolded terms in your answer are not required but be precise).
  • A clear, labeled diagram if asked (include sensors, gateway, cloud, actuators, and data/control arrows).
  • Step-by-step derivation with unit conversions shown.
  • Discussion of practical constraints (power, network bandwidth, latency, security, standards) and assumptions stated.

Quick check

  1. Define a smart meter in one sentence.
  2. Write the formula relating energy in Wh to battery capacity in Ah and voltage.
  3. A device draws 20 mA for 5 s each hour and 5 µA in sleep. Compute duty cycle and average current (no need to compute battery life). Answers: 1. A smart meter is an electricity meter that measures consumption and communicates usage data for monitoring, billing and control. 2. Wh = V · Ah. 3. Duty cycle D = 5/3600 ≈ 0.001389; I_avg = 0.02·0.001389 + 0.000005·(1 - 0.001389) ≈ 0.00002778 + 0.000004993 ≈ 0.00003277 A (≈32.8 µA).

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?