Physics Guidelines
Physics Guidelines
Switch
Team 46
Michael Chen
Christine Chung
Spencer Robieson
Spring 2023
Contents
1 Introduction 2
1.1 Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Visual Aid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 High-level Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Design 3
2.1 Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Power Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Full Bridge Rectifier . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2.2 DC/DC Flyback Converter . . . . . . . . . . . . . . . . . . . . . 6
2.2.3 Light Power Control . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2.4 Voltage Step Down . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Sensor Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1 Ultrasonic Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3.2 Luminosity Sensor (Ambient Light Detection) . . . . . . . . . . 9
2.4 Control Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4.1 Microcontroller . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 Tolerance Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1
1 Introduction
1.1 Problem
Most light switches are binary switches and do not have brightness control. There are
dimmer switches that allow the user to control brightness, but they do not automatically
adjust if the ambient light changes. Users may need to adjust the light if they are in
the same room for a long period of time and do not want large changes in light level.
There are existing smart no-neutral switches, and lights that detect ambient light (like
the BenQ e-Reading Desk Lamp), but there are no existing solutions that combine the
two. We are seeking to make users’ lives more convenient by introducing this brightness
adjusting smart switch.
1.2 Solution
We plan to create a smart switch that can be connected to any existing light switch
(including switches lacking neutral connections) and intelligently control lights. Sensors
on the switch will be able to detect the ambient light and any obstructions. These
sensor measurements will then be combined with simple user input through switches
by our control system. This control system will then adjust the power level of the lights
according to the previously mentioned user inputs. The lights will vary in brightness
and maintain a constant, user set level.
As shown in figure 1, the switch will interface between the light bulb and the AC
mains with the circuitry that we design.
2
1.4 High-level Requirements
Our project intends to achieve the goals listed below.
1. Be able to connected to existing light fixtures and switches, even those without a
neutral wire.
2. Maintain a constant light level for the room at the user set brightness.
4. Have an override switch that allows for absolute control of the lights.
2 Design
2.1 Block Diagram
The block diagram in figure 2 outlines our three subsystems, and the power/data signals
between the different subsystems. The power subsystem will take a voltage from the
120 V AC mains and convert it to a 5V output. This 5V output voltage is then used
to power the control and data subsystems. The control system takes input from the
user interface and sensors, and output a signal to triac conduct on and off. This triac
controls whether or not the light bulb receives power.
3
2.2 Power Subsystem
Since we are designing a smart switch with no neutral connection, the smart switch has
to obtain power and stay in standby mode. It will have a power harvesting circuit that
allows a small amount of power to the light bulb even when the switch is not turned
on to complete the circuit. When the switch is turned on, enough power will be sent to
the light bulb to light it up. The power supply should be able to extract power from
the open circuit over a wide voltage range.
In order to power the switch, we are sourcing power from the 120V 60Hz AC source
existing in the wall circuit on the neutral side and providing isolated switching conver-
sion in DC. The circuit design will consist of a triac optocoupler to control the power
passing to the bulb, chopping up the waveform into the desired trigger angle with the
optocoupler [5] [9]. From there, a zener diode will be paired with the input filtering
needed to feed into a flyback converter to provide isolated DC/DC conversion to power
the rest of the control circuits [10]. The decision of opting for a switching regulator
over a linear regulator was made based on efficiency characteristics, and the isolation
included in a flyback reduces the potential for a short [1] [6] [3]. This increases safety
for the user.
4
Figure 4: Triac Dimming Waveform
The full bridge rectifier will take the AC mains waveform and output a DC waveform
to the DC/DC flyback converter. An input capacitor will be used to reduce the ripple
and smooth the waveform provided to the flyback converter. As illustrated in figure 6,
the full bridge rectifier consists of 4 diodes in a bridge configuration to produce a steady
DC value with less ripple. The voltage ripple can be smoothed out by the smoothing
capacitor placed parallel on the output side of the rectifier, improving the average DC
output while reducing the AC variation of the output. A full bridge rectifier is more
advantageous to use in our application over a using a center tapped full wave rectifier
as it requires more size and cost. The expected output waveform is attached as shown
in figure 5.
5
2.2.2 DC/DC Flyback Converter
The flyback converter will receive input power from the full bridge rectifier and output
a 5V signal. This 5V signal will be the basis for all the DC electronics included on
the PCB. Due to the nature of the no neutral power harvesting circuit, the converter
must be able to function over a wide voltage range and maintain the 5V output. This
5V output will power the microcontroller and ultrasonic sensor. A flyback converter
essentially offers a buck-boost topology isolated by a transformer as the storage induc-
tor, with the output voltage adjustable. For our design purposes, we will be operating
in CCM (continuous conduction mode) where part of the energy stored in the flyback
transformer remains in the transformer when the switch is on. CCM offers smaller
ripple as well as lower RMS current, lower MOSFET conduction and turn-off losses,
and better full-load efficiency, best suited for medium to high power operations. We are
still in the process of confirming the exact component sizes, but figure 6 is our targeted
approach. T1 is our transformer, U1 is our switching controller, and U2 is our linear
regulator. To accomplish our desired functionality, we define the system specifications
using the following equations.
The conversion ratio from the output of the rectifier into the converter should ideally
be stepping down from approximately 150V to 5V. We can accomplish this through the
following equation. Since we are working at a 60Hz fixed frequency, our duty ratio will
then be adjusted accordingly.
Vout D N2
=
Vin 1 − D N1
6
Figure 6: AC/DC to DC/DC
Conduction to the light will be managed by a triac dimming circuit as picture in figure
3. The circuit illustrated has a simulated PWM source labelled as V2, which would be
an output from our microcontroller. That signal will be the trigger into the MOC3021,
a triac driven optoisolator, which is an ideal choice when controlling high voltage AC
loads through digital control. The optocoupler cannot directly drive loads due to its
limited current rating, so it is connected to another triac to act as a power switch to
provide enough current to drive the loads. When we trigger the control to turn the
LED on with our microcontroller, we adjust the time delay to cut the waveform to our
desired preference. Since we are sourcing from the 120V/60Hz AC wall source, we have
the period of the desired output signal at 16.66ms, which is calculated by computing
the inverse of 60Hz. Our lightbulb is modeled as R1 (circled in pink), so the lightbulb
will receive the chopped waveform (pictured in figure 4) coming out of the triac on the
neutral connection. The other end of the lightbulb is the 120V/60Hz AC wall source,
which we will call the ’hot’ line.
7
will provide power to the ambient light sensor.
Requirements Verification
• Flyback converter should output 5V • Connect a differential probe across fly-
±10% back voltage output
• Connect the circuit to the 120V AC
mains
• Monitor the output voltage for 5 minutes
and ensure that the value is between 4.5-
5.5V
This component is intended to prevent obstructions of the ambient light sensor from
rapidly changing the light level. If an obstruction (like a person) is detected in front of
the switch, a high signal will be output and the light control will pause and maintain the
current light level until the obstruction is removed. After the obstruction is removed,
the output will change back to a low signal and the circuit will resume monitoring the
ambient light level and controlling the light level.
8
2.3.2 Luminosity Sensor (Ambient Light Detection)
This subsystem will detect the existing ambient light and adjust the power to the over-
head lighting to match the desired light level. The power level adjustment will be triac
controlled to only pass a portion of the AC mains waveform to the lights. The sensor
has I 2 C data output, which can connect to a I 2 C controller on our microcontroller to
read the data.
We will be using an Arduino and special testing modules to test the sensor subsys-
tem. This will allow for easy connection of the Arduino and output to the console on
a laptop.
Requirements Verification
• The ultrasonic sensor must be able to • Connect the Arduino 5V to the VCC pin,
accurately detect a person between the analog out to trig pin, analog in to echo
heights of 5’ and 6’ within 1 m. pin, and ground to ground pin.
• Start the custom Arduino module.
Check the console to ensure that there
is a connection.
• Have a person stand in front of the sensor
at distances ranging between 5-50cm in
10cm increments.
• Verify that the distance calculated from
the output of the ultrasonic sensor is ac-
curate to the actual distance of the per-
son.
• The luminosity sensor must be able to • Connect the Arduino 3.3V to the VCC
detect the typical brightness in a room pin, ground to GND pin, and I 2 C data
from 100-4000 lumens. and clock pins to the corresponding ports
on the Arduino
• Cover the sensor and verify that close to
0 lumens is measured.
• Gradually increase the light level and
verify that the lumens measured in-
creases as the intensity of light shined on
the sensor inscreases.
9
2.4 Control Subsystem
This subsystem will provide the control for the light. By taking in data from the
sensors and user interface controls, the microcontroller will vary the power that the
light receives. The microcontroller will intake data from the sensors using an analog to
digital converter.
2.4.1 Microcontroller
The microcontroller is responsible for handling the inputs from the User Interface and
Environment subsystem and controlling the power to the light. It will first set the
operation mode based on the user override switch and whether obstruction is detected
by the ultrasonic sensor. The microcontroller will interface with the ultrasonic sensor
using an analog to digital converter. If the override switch is on, the system operates
as a simple switch. If not but there is an obstruction, the system will hold the current
light power level until the obstruction clears. In normal operation, the microcontroller
will utilize inputs of the luminosity sensor and the desired light level switch to run a
control loop that adjusts the power sent to the light to approach the desired light level
received by the luminosity sensor. The light control will continue to adjust to reach
the desired level unless it reaches a limit by the minimum or maximum power levels
available to the light.
10
Requirements Verification
• Microcontroller must be able to interface • Connect jumper wires to triac to connect
with user interface and light bulb simul- to a power meter
taneously
• Vary luminosity sensor input from 100-
4000 lumens and set ultrasonic sensor
readings between 5 and 100 cm.
• Manually test each combination of user
input and environment sensor possibili-
ties through unit tests through Arduino.
Check Arduino console at each combina-
tion to verify sensors are reanding.
• The output should be verified by mea-
suring the power delivered to the light
bulb.
• Microcontroller must allow the triac to • Connect a voltage probe across the mi-
conduct to allow for power siphoning, crocontroller and another voltage probe
while ensuring the light stays off across the light bulb connection to view
waveforms throughout the operation of
the light bulb.
• Vary the light bulb dimming output from
the lowest (2 W) to highest setting (9
W) to ensure the entire range behaves
properly and power is always delivered
back to the control circuit.
11
Dch is the DC link capacitor charging duty ratio as illustrated in the figure below.
The actual voltage ripple can be calculated with the parameters below as well.
IDC
Vripple =
2f C
For the flyback converter, we want to make sure that the transformer does not go
into saturation. The zener-diode clamp circuit on the primary side ensures that when
switching through the MOSFET, high voltage spikes that could damage the switch can
be avoided. If the transformer goes into saturation, the switch can also be damaged from
the increasing rate of the supplied current. This is why well-calculated switching control
and well-calculated transformer sizing is needed to keep the transformer unsaturated.
The switches should be sized based on the switch stress. The following equations are
guidelines for defining this tolerance.
Iin
Iswpk =
D
The peak switch current is calculated as a ratio of the current coming into the
primary side over the duty ratio. If the current across the switch
To decrease the voltage switch stress, the maximum duty ratio D can be reduced.
However it could also cause voltage stresses on the secondary sides’ diodes. In general,
it is best to set the maximum duty ratio so that the nominal voltage across the switch
is 65-70% of the MOSFET voltage rating.
With the following information, we will size our MOSFET to meet these specifica-
tions.
12
3 Cost and Schedule
3.1 Cost Analysis
3.1.1 Parts
This is our parts lists that we have purchased to assemble our project.
Description Part Number Unit Cost ($) Quantity Total Cost ($)
atmega328p MCU ATMEGA328P-PU 7.70 1 7.70
DIP28
Override switch SW-T3-1A-A-A3-S1 0.88 1 0.88
Analog to digital MCP3021A2T- 1.42 1 1.42
converter E/OT
3.3 V linear regulator TPS71433DCK 0.18 1 0.18
Diode ES2CA-13-F 0.73 5 3.85
Triac optoisolator MOC3021 0.54 1 0.54
Triac 583-BT136 0.67 1 0.67
Ultrasonic sensor 3942 3.95 1 3.95
Ambient light sensor ALS-DPDIC17-78C- 2.78 4 11.12
L749/TR8
Switching controller UCC28720D 1.65 1 1.65
Transformer 750314178 2.83 1 2.83
1 uF cap CL05A105KP5NNNC 0.10 3 0.30
16 MHz crystal 16M20P2/49SMT 0.16 1 0.16
330 Ω resistor RC0603JR-07330RL 0.10 1 0.10
360 Ω resistor RC0603JR-07360RL 0.10 1 0.10
470 Ω resistor ERA-3AEB471V 0.35 1 0.35
47 nF capacitor C0603C473K4RECAUTO
0.18 1 0.18
22 Ω fuse resistor EMC2-22RKI 0.65 1 0.65
Diode switching RH06-T 0.18 1 0.18
bridge
Transformer 750314178 10.65 1 10.65
Flyback controller UCC28720 0.53 1 0.53
3.3 V linear regulator TPS71533DCKR 0.91 1 0.91
Schottky diode SS110-TP 0.35 1 0.35
Diode BAS316,115 0.15 1 0.15
Test point (red) 5000 0.42 4 1.68
Test point (black) 5001 0.42 4 1.68
13
100 Ω resistor RC0805FR-07100RL 0.10 1 0.10
4.99 kΩ resistor CPF0603F4K99C1 0.20 1 0.20
20 Ω resistor CPF0603F20RC1 0.19 1 0.19
127 kΩ resistor RC0402FR-07127KL 0.10 1 0.10
499 Ω resistor CPF0603F499RC1 0.20 1 0.20
40.2 kΩ resistor CPF0603F40K2C1 0.20 1 0.20
5.6 Ω resistor RC0805JR-075R6L 0.10 1 0.10
2.2 uF capacitor CKG57NX7T2W225M500JH
3.79 1 3.79
1 uF capacitor CL10A105KO8NNNC 0.10 3 0.30
10 pF capacitor 06033C100KAT2A 0.20 1 0.20
1 uF capacitor CL21B105KBFNNNE 0.11 1 0.11
220 uF capacitor 10TPE220ML 2.37 1 2.37
Diode CGRM4007-G 0.37 1 0.37
82 V zener diode MMSZ5268BT1G 0.24 1 0.25
Banana plugs CT2230-0 1.40 2 2.80
0 Ω jumper RMCF0603ZT0R00 0.10 1 0.10
22 pF capacitor 06035A220JAT2A 0.10 1 0.10
1 kΩ resistor ESR03EZPF1001 0.15 2 0.30
10 kΩ resistor ESR03EZPJ103 0.14 2 0.28
Potentiometer P120PK-Y25BR10K 0.93 1 0.93
Table 4: Parts list
3.1.2 Labor
According to the Grainger College of Engineering, the average salary for an electrical
engineering graduate is $80,296 [7]. This translates to an hourly rate of about $38/hour.
14
3.1.3 Total Cost
Based on the labor hour estimates, the labor cost total is $38 per hr x (123+110+118)
hrs = $13,338
Totaling up table 4 the total parts cost is $65.75.
3.2 Schedule
• Week of 2/20: Write Design Doc and test circuit simulation
• Week of 2/27: Design review and begin PCB design/preliminary parts order
• Week of 3/6: Review board layout/routing, first round PCB order, order other parts,
writing initial software
• Week of 3/27: Assess PCB and software, edit and order in second round PCB if
necessary
• Week of 4/3: Debug continued, assemble in housing and test, more software debugging
as necessary
15
disconnecting any components. Our project will also include safety documentation for
the user very clearly list these steps to ensure their safety.
Another possible danger is the circuit shorting and causing an electrical fire. From
2015-2019 there were an average of 46,700 home electrical fires [2]. To protect our
users we decided to use a flyback converter for our AC-DC power converter system.
The flyback converter provides galvanic isolation between the AC mains input and the
circuit output. Due to this topology, the output side of the transformer is isolated from
high current [6]. The input side of the power system will be protected by the usual
circuit breakers that are included in home circuits.
Section I.5 specifies to seek critique of technical work and work to correct any errors,
and section I.6 specifies to improve our technical competence. We intend to verify our
designs with TAs and other students with experience in the power electronics and circuit
design areas. By consulting with others, we can achieve better, safer designs with lower
chance of failure.
As our project is a light switch, we do not believe that there are major ethical
concerns beyond the power system is as safe as possible. The device is entirely self-
contained, and no data from the user is stored or shared.
16
References
[1] For your DC power application, which switching power supply topology is right?
Altium. url: https://resources.altium.com/p/your-dc-power-application-
which-switching-power-supply-topology-right. (accessed 02/09/2023).
[2] Home Electrical Fires. National Fire Protection Association. url: https://www.
nfpa . org / News - and - Research / Data - research - and - tools / Electrical /
Electrical. (accessed 02/22/2023).
[3] J. Hubner. Power supply design tutorial (part 1-2) - topologies and fundamentals,
continued. Power Electronic News. url: https://www.powerelectronicsnews.
com/power-supply-design-tutorial-part-1-2-topologies-and-fundamentals-
continued/. (accessed 02/09/2023).
[4] IEEE Code of Ethics. IEEE. url: https://www.ieee.org/about/corporate/
governance/p7-8.html. (accessed 02/09/2023).
[5] Opto Triacs and Solid State Relays. Learn About Electronics. url: https://
learnabout - electronics . org / Semiconductors / thyristors _ 66 . php. (ac-
cessed 02/09/2023).
[6] Zachariah Peterson. Isolated vs non-isolated power supplies: The Right Choice
Without Fail. Altium. url: https : / / resources . altium . com / p / isolated -
vs-non-isolated-power-supplies-right-choice-without-fail. (accessed
02/09/2023).
[7] Post Graduate Success. Grainger College of Engineering. url: https://grainger.
illinois.edu/academics/undergraduate/majors-and-minors/electrical-
engineering. (accessed 02/22/2023).
[8] Train-the-Trainer: Basic Electrical Safety. OSHA. url: https : / / www . osha .
gov/sites/default/files/2019- 04/Basic_Electricity_Materials.pdf.
(accessed 02/22/2023).
[9] What is the difference between zero-cross triac couplers and non-zero-cross triac
couplers? How should they be used properly? Toshiba Electronic Devices & Storage
Corporation. url: https://toshiba.semicon-storage.com/us/semiconductor/
knowledge/faq/opto/opto-054.html. (accessed 02/09/2023).
[10] Vincent Zhang and Ambreesh Tripathi. How to Design Flyback Converter with
LM3481 Boost Controller. Texas Instruments. url: https://www.ti.com/lit/
an/snva761a/snva761a.pdf. (accessed 02/09/2023).
17