<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.cognifront.com/docs/index.php?action=history&amp;feed=atom&amp;title=MDM331AID%2FExperiment_14</id>
	<title>MDM331AID/Experiment 14 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.cognifront.com/docs/index.php?action=history&amp;feed=atom&amp;title=MDM331AID%2FExperiment_14"/>
	<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;action=history"/>
	<updated>2026-10-21T02:47:03Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1389&amp;oldid=prev</id>
		<title>CogWikiEditor: /* Working Principle */</title>
		<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1389&amp;oldid=prev"/>
		<updated>2026-10-08T03:50:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Working Principle&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 03:50, 8 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l227&quot;&gt;Line 227:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 227:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The raw vibration activity is processed locally on the ESP32.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The raw vibration activity is processed locally on the ESP32.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;lt;WiFi.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;lt;WiFi.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;lt;WebServer.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;#include &amp;lt;WebServer.h&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l418&quot;&gt;Line 418:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 418:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   server.handleClient();&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   server.handleClient();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Code Explanation ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Code Explanation ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>CogWikiEditor</name></author>
	</entry>
	<entry>
		<id>https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1388&amp;oldid=prev</id>
		<title>CogWikiEditor: /* Program */</title>
		<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1388&amp;oldid=prev"/>
		<updated>2026-10-08T03:49:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Program&lt;/span&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;amp;diff=1388&amp;amp;oldid=1387&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>CogWikiEditor</name></author>
	</entry>
	<entry>
		<id>https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1387&amp;oldid=prev</id>
		<title>CogWikiEditor at 03:32, 8 October 2026</title>
		<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1387&amp;oldid=prev"/>
		<updated>2026-10-08T03:32:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;amp;diff=1387&amp;amp;oldid=1361&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>CogWikiEditor</name></author>
	</entry>
	<entry>
		<id>https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1361&amp;oldid=prev</id>
		<title>CogWikiEditor: Created page with &quot;= Experiment: Smart Threshold Alerts for Data Minimization using Privacy-by-Design =  == Aim ==  To design and implement a Privacy-by-Design IoT system using an LDR sensor and ESP32 that generates an alert only when a predefined threshold is crossed, thereby minimizing unnecessary sensor data transmission.  == Objectives ==  # To understand Privacy-by-Design in an IoT system. # To understand the concept of data minimization. # To interface an LDR sensor with ESP32. # To...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.cognifront.com/docs/index.php?title=MDM331AID/Experiment_14&amp;diff=1361&amp;oldid=prev"/>
		<updated>2026-10-07T13:29:38Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= Experiment: Smart Threshold Alerts for Data Minimization using Privacy-by-Design =  == Aim ==  To design and implement a Privacy-by-Design IoT system using an LDR sensor and ESP32 that generates an alert only when a predefined threshold is crossed, thereby minimizing unnecessary sensor data transmission.  == Objectives ==  # To understand Privacy-by-Design in an IoT system. # To understand the concept of data minimization. # To interface an LDR sensor with ESP32. # To...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Experiment: Smart Threshold Alerts for Data Minimization using Privacy-by-Design =&lt;br /&gt;
&lt;br /&gt;
== Aim ==&lt;br /&gt;
&lt;br /&gt;
To design and implement a Privacy-by-Design IoT system using an LDR sensor and ESP32 that generates an alert only when a predefined threshold is crossed, thereby minimizing unnecessary sensor data transmission.&lt;br /&gt;
&lt;br /&gt;
== Objectives ==&lt;br /&gt;
&lt;br /&gt;
# To understand Privacy-by-Design in an IoT system.&lt;br /&gt;
# To understand the concept of data minimization.&lt;br /&gt;
# To interface an LDR sensor with ESP32.&lt;br /&gt;
# To detect changes in light intensity.&lt;br /&gt;
# To define a threshold for detecting darkness.&lt;br /&gt;
# To generate a POWER CUT alert when darkness is detected.&lt;br /&gt;
# To process raw sensor data locally on the ESP32.&lt;br /&gt;
# To avoid continuously transmitting raw LDR readings.&lt;br /&gt;
# To transmit or expose only the required alert information.&lt;br /&gt;
# To demonstrate data minimization through data inspection.&lt;br /&gt;
&lt;br /&gt;
== Components Required ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sr. No.&lt;br /&gt;
! Component&lt;br /&gt;
! Quantity&lt;br /&gt;
! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| ESP32 Development Board&lt;br /&gt;
| 1&lt;br /&gt;
| Reads the LDR and hosts the web server&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| LDR&lt;br /&gt;
| 1&lt;br /&gt;
| Detects light intensity&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| 10 kOhm Resistor&lt;br /&gt;
| 1&lt;br /&gt;
| Forms the LDR voltage divider&lt;br /&gt;
|-&lt;br /&gt;
| 4&lt;br /&gt;
| Breadboard&lt;br /&gt;
| 1&lt;br /&gt;
| Circuit connections&lt;br /&gt;
|-&lt;br /&gt;
| 5&lt;br /&gt;
| Jumper Wires&lt;br /&gt;
| As required&lt;br /&gt;
| Electrical connections&lt;br /&gt;
|-&lt;br /&gt;
| 6&lt;br /&gt;
| Smartphone&lt;br /&gt;
| 1&lt;br /&gt;
| Accesses the ESP32 web page&lt;br /&gt;
|-&lt;br /&gt;
| 7&lt;br /&gt;
| USB Cable&lt;br /&gt;
| 1&lt;br /&gt;
| Programming and powering ESP32&lt;br /&gt;
|-&lt;br /&gt;
| 8&lt;br /&gt;
| Computer with Arduino IDE&lt;br /&gt;
| 1&lt;br /&gt;
| Programming the ESP32&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Theory ==&lt;br /&gt;
&lt;br /&gt;
=== Internet of Things ===&lt;br /&gt;
&lt;br /&gt;
The Internet of Things, or IoT, is a system in which physical devices use sensors and communication technologies to collect and exchange information.&lt;br /&gt;
&lt;br /&gt;
In a conventional IoT system, sensor readings may be continuously transmitted even when the application does not require all of the readings.&lt;br /&gt;
&lt;br /&gt;
For example, an LDR monitoring system may continuously generate values such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
3860&lt;br /&gt;
3715&lt;br /&gt;
3521&lt;br /&gt;
3480&lt;br /&gt;
3405&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the purpose of the application is only to detect a power cut, the application does not need every individual LDR reading.&lt;br /&gt;
&lt;br /&gt;
The ESP32 can instead process the sensor data locally and generate an alert only when the required condition occurs.&lt;br /&gt;
&lt;br /&gt;
=== Privacy-by-Design ===&lt;br /&gt;
&lt;br /&gt;
Privacy-by-Design means that privacy is considered while designing the system rather than being added later.&lt;br /&gt;
&lt;br /&gt;
One important part of Privacy-by-Design is data minimization.&lt;br /&gt;
&lt;br /&gt;
Data minimization means collecting, processing, transmitting, and storing only the information that is necessary for the intended purpose.&lt;br /&gt;
&lt;br /&gt;
In this experiment, the purpose is to detect a possible power cut.&lt;br /&gt;
&lt;br /&gt;
Therefore, the system does not need to continuously expose the exact LDR readings.&lt;br /&gt;
&lt;br /&gt;
The ESP32 processes the readings locally and only generates the required alert when the threshold is crossed.&lt;br /&gt;
&lt;br /&gt;
=== Smart Threshold Alert ===&lt;br /&gt;
&lt;br /&gt;
A threshold is a predefined value used to identify a particular condition.&lt;br /&gt;
&lt;br /&gt;
The ESP32 reads the LDR value and compares it with the selected threshold.&lt;br /&gt;
&lt;br /&gt;
The operation is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR reading&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
ESP32&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Check threshold&lt;br /&gt;
    |&lt;br /&gt;
    +-------------------+&lt;br /&gt;
    |                   |&lt;br /&gt;
    v                   v&lt;br /&gt;
Normal condition    Dark condition&lt;br /&gt;
    |                   |&lt;br /&gt;
    v                   v&lt;br /&gt;
No alert            POWER CUT&lt;br /&gt;
                    alert&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The threshold value depends on the LDR circuit and surrounding lighting conditions.&lt;br /&gt;
&lt;br /&gt;
Therefore, the threshold should be calibrated before performing the experiment.&lt;br /&gt;
&lt;br /&gt;
=== Data Minimization ===&lt;br /&gt;
&lt;br /&gt;
In a conventional system, raw LDR readings may be continuously sent to another device or server.&lt;br /&gt;
&lt;br /&gt;
In the proposed system:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR reading&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Local processing on ESP32&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Threshold check&lt;br /&gt;
    |&lt;br /&gt;
    +------------------+&lt;br /&gt;
    |                  |&lt;br /&gt;
    v                  v&lt;br /&gt;
Normal             Dark&lt;br /&gt;
    |                  |&lt;br /&gt;
    v                  v&lt;br /&gt;
No alert           POWER CUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The raw LDR value is used locally for decision making.&lt;br /&gt;
&lt;br /&gt;
Unnecessary raw readings are therefore not continuously exposed outside the device.&lt;br /&gt;
&lt;br /&gt;
== Pin Connections ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! LDR Circuit&lt;br /&gt;
! ESP32&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| LDR voltage divider output&lt;br /&gt;
| GPIO 34&lt;br /&gt;
| Analog input&lt;br /&gt;
|-&lt;br /&gt;
| Supply&lt;br /&gt;
| 3.3V&lt;br /&gt;
| Circuit supply&lt;br /&gt;
|-&lt;br /&gt;
| Ground&lt;br /&gt;
| GND&lt;br /&gt;
| Common ground&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A typical voltage divider is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        3.3V&lt;br /&gt;
          |&lt;br /&gt;
         LDR&lt;br /&gt;
          |&lt;br /&gt;
          +-------- GPIO 34&lt;br /&gt;
          |&lt;br /&gt;
        10 kOhm&lt;br /&gt;
          |&lt;br /&gt;
         GND&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The voltage at GPIO 34 changes according to the amount of light falling on the LDR.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; Depending on the circuit arrangement, the LDR reading may increase or decrease when the sensor is covered. The actual behavior should be checked during calibration.&lt;br /&gt;
&lt;br /&gt;
== Connection Diagram ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
                 ESP32&lt;br /&gt;
             +------------+&lt;br /&gt;
             |            |&lt;br /&gt;
      3.3V --|            |&lt;br /&gt;
             |            |&lt;br /&gt;
             | GPIO 34 &amp;lt;--|------ LDR Circuit&lt;br /&gt;
             |            |&lt;br /&gt;
       GND --|            |&lt;br /&gt;
             |            |&lt;br /&gt;
             +------------+&lt;br /&gt;
                    |&lt;br /&gt;
                    |&lt;br /&gt;
             Wi-Fi Access Point&lt;br /&gt;
                    |&lt;br /&gt;
                    |&lt;br /&gt;
             Smartphone Browser&lt;br /&gt;
                    |&lt;br /&gt;
                    |&lt;br /&gt;
              192.168.1.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working Principle ==&lt;br /&gt;
&lt;br /&gt;
The ESP32 works as a Wi-Fi Access Point and hosts a web server.&lt;br /&gt;
&lt;br /&gt;
The smartphone connects directly to the Wi-Fi network created by the ESP32.&lt;br /&gt;
&lt;br /&gt;
The student then opens:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://192.168.1.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ESP32 reads the LDR value.&lt;br /&gt;
&lt;br /&gt;
The value is compared with the threshold.&lt;br /&gt;
&lt;br /&gt;
When sufficient light is present, the system remains in the normal condition.&lt;br /&gt;
&lt;br /&gt;
When the LDR is covered and the reading crosses the threshold, the ESP32 considers the condition to represent a power cut.&lt;br /&gt;
&lt;br /&gt;
The smartphone then displays the POWER CUT alert.&lt;br /&gt;
&lt;br /&gt;
The raw LDR value is processed locally.&lt;br /&gt;
&lt;br /&gt;
== Program ==&lt;br /&gt;
&lt;br /&gt;
The following program avoids embedding HTML source directly into the MediaWiki page.&lt;br /&gt;
&lt;br /&gt;
The web page is constructed using character values so that the program does not contain HTML tags as literal text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;amp;lt;WiFi.h&amp;amp;gt;&lt;br /&gt;
#include &amp;amp;lt;WebServer.h&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
const int LDR_PIN = 34;&lt;br /&gt;
&lt;br /&gt;
const char* ap_ssid = &amp;quot;ESP32-Power-Monitor&amp;quot;;&lt;br /&gt;
const char* ap_password = &amp;quot;12345678&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
WebServer server(80);&lt;br /&gt;
&lt;br /&gt;
const int LDR_THRESHOLD = 2000;&lt;br /&gt;
&lt;br /&gt;
bool powerCut = false;&lt;br /&gt;
&lt;br /&gt;
void handleRoot()&lt;br /&gt;
{&lt;br /&gt;
  int ldrValue = analogRead(LDR_PIN);&lt;br /&gt;
&lt;br /&gt;
  if (ldrValue &amp;amp;lt; LDR_THRESHOLD)&lt;br /&gt;
  {&lt;br /&gt;
    powerCut = true;&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    powerCut = false;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  String page = &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  char lt = 60;&lt;br /&gt;
  char gt = 62;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;html&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;head&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;meta name=&amp;#039;viewport&amp;#039; content=&amp;#039;width=device-width, initial-scale=1&amp;#039;&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;title&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
  page += &amp;quot;Smart Power Monitor&amp;quot;;&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;/title&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;/head&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;body&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;h1&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
  page += &amp;quot;Smart Power Monitor&amp;quot;;&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;/h1&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  if (powerCut)&lt;br /&gt;
  {&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;h2&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
    page += &amp;quot;POWER CUT&amp;quot;;&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;/h2&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;p&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
    page += &amp;quot;Dark condition detected.&amp;quot;;&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;/p&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
  }&lt;br /&gt;
  else&lt;br /&gt;
  {&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;h2&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
    page += &amp;quot;NORMAL&amp;quot;;&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;/h2&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;p&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
    page += &amp;quot;No power cut detected.&amp;quot;;&lt;br /&gt;
    page += lt;&lt;br /&gt;
    page += &amp;quot;/p&amp;quot;;&lt;br /&gt;
    page += gt;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;/body&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  page += lt;&lt;br /&gt;
  page += &amp;quot;/html&amp;quot;;&lt;br /&gt;
  page += gt;&lt;br /&gt;
&lt;br /&gt;
  server.send(200, &amp;quot;text/html&amp;quot;, page);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(115200);&lt;br /&gt;
&lt;br /&gt;
  pinMode(LDR_PIN, INPUT);&lt;br /&gt;
&lt;br /&gt;
  WiFi.softAPConfig(&lt;br /&gt;
    IPAddress(192,168,1,4),&lt;br /&gt;
    IPAddress(192,168,1,1),&lt;br /&gt;
    IPAddress(255,255,255,0)&lt;br /&gt;
  );&lt;br /&gt;
&lt;br /&gt;
  WiFi.softAP(ap_ssid, ap_password);&lt;br /&gt;
&lt;br /&gt;
  Serial.println(&amp;quot;ESP32 Access Point started&amp;quot;);&lt;br /&gt;
  Serial.print(&amp;quot;IP Address: &amp;quot;);&lt;br /&gt;
  Serial.println(WiFi.softAPIP());&lt;br /&gt;
&lt;br /&gt;
  server.on(&amp;quot;/&amp;quot;, handleRoot);&lt;br /&gt;
&lt;br /&gt;
  server.begin();&lt;br /&gt;
&lt;br /&gt;
  Serial.println(&amp;quot;Web server started&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  server.handleClient();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Code Explanation ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Code or Function&lt;br /&gt;
! Explanation&lt;br /&gt;
|-&lt;br /&gt;
| WiFi.h&lt;br /&gt;
| Provides ESP32 Wi-Fi functionality.&lt;br /&gt;
|-&lt;br /&gt;
| WebServer.h&lt;br /&gt;
| Provides the web server functionality.&lt;br /&gt;
|-&lt;br /&gt;
| LDR_PIN&lt;br /&gt;
| Defines GPIO 34 as the LDR analog input.&lt;br /&gt;
|-&lt;br /&gt;
| WiFi.softAP&lt;br /&gt;
| Creates a Wi-Fi Access Point using the ESP32.&lt;br /&gt;
|-&lt;br /&gt;
| WiFi.softAPConfig&lt;br /&gt;
| Sets the Access Point IP address to 192.168.1.4.&lt;br /&gt;
|-&lt;br /&gt;
| WebServer server(80)&lt;br /&gt;
| Creates an HTTP web server on port 80.&lt;br /&gt;
|-&lt;br /&gt;
| LDR_THRESHOLD&lt;br /&gt;
| Defines the value used to detect the dark condition.&lt;br /&gt;
|-&lt;br /&gt;
| analogRead&lt;br /&gt;
| Reads the analog value from the LDR circuit.&lt;br /&gt;
|-&lt;br /&gt;
| powerCut&lt;br /&gt;
| Stores whether a dark condition has been detected.&lt;br /&gt;
|-&lt;br /&gt;
| handleRoot&lt;br /&gt;
| Generates the web page displayed on the smartphone.&lt;br /&gt;
|-&lt;br /&gt;
| server.send&lt;br /&gt;
| Sends the web page to the browser.&lt;br /&gt;
|-&lt;br /&gt;
| server.handleClient&lt;br /&gt;
| Processes browser requests.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Access Point ===&lt;br /&gt;
&lt;br /&gt;
The ESP32 creates its own Wi-Fi network.&lt;br /&gt;
&lt;br /&gt;
The network name is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ESP32-Power-Monitor&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The IP address is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
192.168.1.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The smartphone can therefore access the web page using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
http://192.168.1.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Threshold Detection ===&lt;br /&gt;
&lt;br /&gt;
The ESP32 reads the LDR using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
int ldrValue = analogRead(LDR_PIN);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The value is compared with the threshold:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if (ldrValue &amp;lt; LDR_THRESHOLD)&lt;br /&gt;
{&lt;br /&gt;
  powerCut = true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the condition is satisfied, the ESP32 generates the POWER CUT alert.&lt;br /&gt;
&lt;br /&gt;
== Calibration of LDR Threshold ==&lt;br /&gt;
&lt;br /&gt;
The threshold should be calibrated before the experiment.&lt;br /&gt;
&lt;br /&gt;
# Upload the program to the ESP32.&lt;br /&gt;
# Open the Arduino IDE Serial Monitor.&lt;br /&gt;
# Observe the LDR readings under normal light.&lt;br /&gt;
# Cover the LDR with a finger.&lt;br /&gt;
# Observe the LDR readings again.&lt;br /&gt;
# Compare the readings for bright and dark conditions.&lt;br /&gt;
# Select a suitable threshold between the two conditions.&lt;br /&gt;
# Change the LDR_THRESHOLD value in the program.&lt;br /&gt;
# Upload the program again.&lt;br /&gt;
# Test the system.&lt;br /&gt;
&lt;br /&gt;
For example, the readings may be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Normal light:&lt;br /&gt;
3000 to 3800&lt;br /&gt;
&lt;br /&gt;
LDR covered:&lt;br /&gt;
500 to 1200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In such a case, a threshold somewhere between these ranges can be selected.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The above values are examples only. Actual values depend on the LDR circuit and lighting conditions.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Procedure ==&lt;br /&gt;
&lt;br /&gt;
# Connect the LDR and resistor as a voltage divider.&lt;br /&gt;
# Connect the output of the voltage divider to GPIO 34.&lt;br /&gt;
# Connect the circuit to 3.3V and GND.&lt;br /&gt;
# Connect the ESP32 to the computer.&lt;br /&gt;
# Open Arduino IDE.&lt;br /&gt;
# Select the appropriate ESP32 board.&lt;br /&gt;
# Select the appropriate COM port.&lt;br /&gt;
# Upload the program.&lt;br /&gt;
# Open the Serial Monitor.&lt;br /&gt;
# Verify that the ESP32 Access Point has started.&lt;br /&gt;
# Connect the smartphone to ESP32-Power-Monitor.&lt;br /&gt;
# Open the smartphone browser.&lt;br /&gt;
# Enter http://192.168.1.4.&lt;br /&gt;
# Observe the NORMAL status.&lt;br /&gt;
# Keep the LDR exposed to light.&lt;br /&gt;
# Cover the LDR using a finger.&lt;br /&gt;
# Observe the POWER CUT alert.&lt;br /&gt;
# Remove the finger.&lt;br /&gt;
# Verify that the normal condition is restored.&lt;br /&gt;
# Perform the data inspection demonstration.&lt;br /&gt;
&lt;br /&gt;
== Observations and Output ==&lt;br /&gt;
&lt;br /&gt;
=== Normal Condition ===&lt;br /&gt;
&lt;br /&gt;
When the LDR is exposed to sufficient light:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR Condition : Bright&lt;br /&gt;
System Status : NORMAL&lt;br /&gt;
Alert         : None&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
No power-cut alert is generated.&lt;br /&gt;
&lt;br /&gt;
=== Dark Condition ===&lt;br /&gt;
&lt;br /&gt;
When the LDR is covered with a finger:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR Condition : Dark&lt;br /&gt;
System Status : ALERT&lt;br /&gt;
Alert         : POWER CUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ESP32 detects the threshold crossing and generates the alert.&lt;br /&gt;
&lt;br /&gt;
=== Smartphone Output ===&lt;br /&gt;
&lt;br /&gt;
Normal condition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SMART POWER MONITOR&lt;br /&gt;
&lt;br /&gt;
NORMAL&lt;br /&gt;
&lt;br /&gt;
No power cut detected.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Dark condition:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SMART POWER MONITOR&lt;br /&gt;
&lt;br /&gt;
POWER CUT&lt;br /&gt;
&lt;br /&gt;
Dark condition detected.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Demonstration of Data Minimization ==&lt;br /&gt;
&lt;br /&gt;
The main purpose of this experiment is to demonstrate that unnecessary raw sensor data does not need to be transmitted.&lt;br /&gt;
&lt;br /&gt;
=== Conventional System ===&lt;br /&gt;
&lt;br /&gt;
In a conventional IoT system, the server may receive raw LDR readings continuously.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR value: 3860&lt;br /&gt;
&lt;br /&gt;
LDR value: 3715&lt;br /&gt;
&lt;br /&gt;
LDR value: 3521&lt;br /&gt;
&lt;br /&gt;
LDR value: 3480&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The server therefore receives detailed sensor information.&lt;br /&gt;
&lt;br /&gt;
=== Privacy-by-Design System ===&lt;br /&gt;
&lt;br /&gt;
In the proposed system, the ESP32 processes the LDR reading locally.&lt;br /&gt;
&lt;br /&gt;
During normal conditions:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR reading&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Local threshold check&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Normal condition&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
No alert&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the threshold is crossed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR reading&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Local threshold check&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
Dark condition&lt;br /&gt;
    |&lt;br /&gt;
    v&lt;br /&gt;
POWER CUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application only needs to expose the required event.&lt;br /&gt;
&lt;br /&gt;
The raw LDR measurement does not need to be exposed.&lt;br /&gt;
&lt;br /&gt;
== Data Inspection Demonstration ==&lt;br /&gt;
&lt;br /&gt;
The data inspection demonstration is used to compare the amount of information exposed by two system designs.&lt;br /&gt;
&lt;br /&gt;
The demonstration is educational and is intended to show the effect of data minimization.&lt;br /&gt;
&lt;br /&gt;
=== Conventional Design ===&lt;br /&gt;
&lt;br /&gt;
A conventional system may expose information such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
LDR value: 3860&lt;br /&gt;
LDR value: 3715&lt;br /&gt;
LDR value: 3521&lt;br /&gt;
LDR value: 1200&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An observer can therefore obtain detailed information about the sensor readings.&lt;br /&gt;
&lt;br /&gt;
=== Privacy-by-Design Design ===&lt;br /&gt;
&lt;br /&gt;
The Privacy-by-Design system processes the raw value locally.&lt;br /&gt;
&lt;br /&gt;
When there is no threshold event:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
No alert&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When darkness is detected:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POWER CUT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The application therefore exposes only the information needed for the intended purpose.&lt;br /&gt;
&lt;br /&gt;
The raw LDR values are not required by the application.&lt;br /&gt;
&lt;br /&gt;
=== Demonstration Steps ===&lt;br /&gt;
&lt;br /&gt;
# Connect the smartphone to the ESP32 Access Point.&lt;br /&gt;
# Open the ESP32 web page.&lt;br /&gt;
# Observe the normal condition.&lt;br /&gt;
# Cover the LDR with a finger.&lt;br /&gt;
# Observe the POWER CUT alert.&lt;br /&gt;
# Inspect the application data using an appropriate network inspection or server logging method.&lt;br /&gt;
# Observe that the useful application information is the alert rather than a continuous stream of raw LDR values.&lt;br /&gt;
# Explain that the raw reading was processed locally before the alert was generated.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; This demonstration is about data minimization. It does not claim that HTTP communication is encrypted or completely secure.&lt;br /&gt;
&lt;br /&gt;
== Conventional System vs Privacy-by-Design System ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Feature&lt;br /&gt;
! Conventional System&lt;br /&gt;
! Privacy-by-Design System&lt;br /&gt;
|-&lt;br /&gt;
| Sensor processing&lt;br /&gt;
| May be performed at server&lt;br /&gt;
| Performed locally on ESP32&lt;br /&gt;
|-&lt;br /&gt;
| Raw LDR readings&lt;br /&gt;
| May be continuously transmitted&lt;br /&gt;
| Processed locally&lt;br /&gt;
|-&lt;br /&gt;
| Normal readings&lt;br /&gt;
| May be transmitted&lt;br /&gt;
| No unnecessary transmission&lt;br /&gt;
|-&lt;br /&gt;
| Threshold detection&lt;br /&gt;
| May be performed at server&lt;br /&gt;
| Performed on ESP32&lt;br /&gt;
|-&lt;br /&gt;
| Alert&lt;br /&gt;
| May contain sensor information&lt;br /&gt;
| Only required alert is exposed&lt;br /&gt;
|-&lt;br /&gt;
| Data volume&lt;br /&gt;
| Higher&lt;br /&gt;
| Lower&lt;br /&gt;
|-&lt;br /&gt;
| Data exposure&lt;br /&gt;
| Higher&lt;br /&gt;
| Minimized&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Why This is Privacy-by-Design ==&lt;br /&gt;
&lt;br /&gt;
The experiment demonstrates Privacy-by-Design through the following design decisions:&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Local Processing:&amp;#039;&amp;#039;&amp;#039; Raw LDR readings are processed on the ESP32.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Data Minimization:&amp;#039;&amp;#039;&amp;#039; Continuous raw readings are not unnecessarily transmitted.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Purpose Limitation:&amp;#039;&amp;#039;&amp;#039; The system only needs to detect a possible power-cut condition.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Smart Thresholding:&amp;#039;&amp;#039;&amp;#039; An alert is generated only when the threshold is crossed.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Reduced Data Exposure:&amp;#039;&amp;#039;&amp;#039; Unnecessary sensor information is not exposed.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Privacy by Default:&amp;#039;&amp;#039;&amp;#039; The system is designed to minimize data exposure from the beginning.&lt;br /&gt;
&lt;br /&gt;
The main principle demonstrated is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Do not transmit unnecessary information&lt;br /&gt;
when the application does not require it.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Advantages ==&lt;br /&gt;
&lt;br /&gt;
# Reduces unnecessary data transmission.&lt;br /&gt;
# Reduces the amount of sensor information exposed outside the device.&lt;br /&gt;
# Reduces network traffic.&lt;br /&gt;
# Allows fast local decision making.&lt;br /&gt;
# Demonstrates data minimization clearly.&lt;br /&gt;
# Does not require an external cloud server.&lt;br /&gt;
# Can be demonstrated easily using a smartphone.&lt;br /&gt;
# Can be extended to other IoT alert applications.&lt;br /&gt;
&lt;br /&gt;
== Limitations ==&lt;br /&gt;
&lt;br /&gt;
# The LDR provides an indirect indication of a power cut.&lt;br /&gt;
# Changes in environmental lighting can also trigger the alert.&lt;br /&gt;
# The threshold must be calibrated.&lt;br /&gt;
# The HTTP communication used in this experiment is not encrypted.&lt;br /&gt;
# This experiment demonstrates data minimization and not complete IoT security.&lt;br /&gt;
# A real power monitoring system would use an appropriate electrical sensing method.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
&lt;br /&gt;
The smart threshold alert system was successfully implemented using an LDR sensor and ESP32.&lt;br /&gt;
&lt;br /&gt;
The ESP32 locally processed the LDR readings and detected a dark condition using a predefined threshold.&lt;br /&gt;
&lt;br /&gt;
When the threshold was crossed, the smartphone displayed a POWER CUT alert through the ESP32 web server.&lt;br /&gt;
&lt;br /&gt;
The ESP32 used the IP address:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
192.168.1.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The experiment demonstrated that raw LDR readings do not need to be continuously exposed when the application only requires an event notification.&lt;br /&gt;
&lt;br /&gt;
Thus, the experiment demonstrated data minimization through local processing and smart threshold alerts as a practical Privacy-by-Design approach.&lt;br /&gt;
&lt;br /&gt;
== Viva Questions ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q1. What is Privacy-by-Design?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; Privacy-by-Design means incorporating privacy considerations into the design of a system from the beginning.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q2. What is data minimization?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; Data minimization means collecting, processing, transmitting, and storing only the data required for the intended purpose.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q3. Why is an LDR used?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; An LDR is used because its light-sensitive behavior makes it easy to manually generate a threshold event by covering it with a finger.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q4. What does darkness represent in this experiment?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; Darkness is treated as an indication of a possible power cut.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q5. Why is the raw LDR value not continuously transmitted?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; The application only needs to know whether the threshold has been crossed. Therefore, continuous transmission of the raw value is unnecessary.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q6. Where is the threshold checked?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; The threshold is checked locally on the ESP32.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q7. What happens when the threshold is not crossed?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; No power-cut alert is generated and unnecessary sensor data is not exposed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q8. What happens when the threshold is crossed?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; The ESP32 detects the dark condition and generates the POWER CUT alert.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q9. What is the purpose of the data inspection demonstration?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; It demonstrates how much sensor information is exposed and how data minimization reduces unnecessary information.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q10. What information is required when the threshold is crossed?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; The required information is the POWER CUT alert.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q11. Is the system completely secure?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; No. The main purpose is to demonstrate data minimization and Privacy-by-Design. HTTP communication is not encrypted.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q12. Does data minimization mean that no data is transmitted?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; No. It means that only the data necessary for the intended purpose should be transmitted or exposed.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q13. Why is local processing useful?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; Local processing allows the ESP32 to make decisions using raw sensor data without unnecessarily exposing that raw data.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q14. What is a smart threshold alert?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; A smart threshold alert is generated when a sensor reading crosses a predefined threshold representing a meaningful condition.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Q15. What is the main principle demonstrated by this experiment?&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Ans:&amp;#039;&amp;#039;&amp;#039; The main principle is data minimization. Raw sensor information is processed locally and only the required alert is exposed.&lt;/div&gt;</summary>
		<author><name>CogWikiEditor</name></author>
	</entry>
</feed>