This module controls LED brightness by adjusting potentiometer and

Interactive LED Coffee Table
BY
JEKHYUNG CHOI
LI JIANG
Final Report for ECE 445, Senior Design, Fall 2016
TA: Jacob Byran
07 Dec 2016
Project no: 27
Abstract
The interactive LED coffee table was designed for both decoration and safety purpose. First, in
order to be a mean of decoration, the LEDs were designed to display different patterns and colors
based on object location and temperature. Second, when a hot object is placed, the LEDs will
glow red in order to warn the user of the high object temperature. The table uses wall plug-in
adaptor and voltage regulator to power every other modules of the product. The LEDs are
controlled by a microcontroller (MCU), which takes input from Infrared (IR) phototransistors
and thermopile temperature sensors.
ii
Contents
1. Introduction .............................................................................................................................................. 1
1.1 Statement of Purpose ......................................................................................................................... 1
1.2 Functions ............................................................................................................................................. 1
1.3 Components ........................................................................................................................................ 1
1.3.1 Microcontroller ............................................................................................................................ 1
1.3.2 LED Panel...................................................................................................................................... 1
1.3.3 Temperature Sensors ................................................................................................................... 2
1.3.4 IR Sensors ..................................................................................................................................... 2
1.3.5 Power Supply ............................................................................................................................... 2
1.3.6 Knob and Toggle Switch ............................................................................................................... 2
2. Design........................................................................................................................................................ 3
2.1 Microcontroller ................................................................................................................................... 3
2.2 LED Panel and Driver ........................................................................................................................... 3
2.3 Temperature Sensor ........................................................................................................................... 5
2.4 IR Proximity Sensor ............................................................................................................................. 6
2.5 Power Supply ...................................................................................................................................... 7
2.6 Knob and Toggle Switch ...................................................................................................................... 7
3. Design Verification .................................................................................................................................... 9
3.1 Power .................................................................................................................................................. 9
3.2 Microcontroller ................................................................................................................................... 9
3.3 LED panel and LED control ................................................................................................................ 10
3.4 Thermopile and Op-amp ................................................................................................................... 10
3.5 IR Proximity Detection ...................................................................................................................... 10
3.6 Knob and Switch................................................................................................................................ 11
4. Conclusion ............................................................................................................................................... 14
5.1 Accomplishments .............................................................................................................................. 14
5.2 Uncertainties ..................................................................................................................................... 14
5.3 Ethics Statement ............................................................................................................................... 14
5.4 Future Work ...................................................................................................................................... 14
iii
References .................................................................................................................................................. 16
Appendix A: Requirement and Verification Table ..................................................................................... 17
iv
1. Introduction
1.1 Statement of Purpose
Surface on furniture in the house usually does not interactive with users. Although few LED
furniture on market are interactive, such as LED Bar and Table, we want to design a product
with more interactive features. Our product detects pressure and temperature from the objects on
the table so that it gives warning of objects by glowing in different color depends on the
temperature. So, the LED displays not only glowing for decorative interior use, but also give
users information on temperature of the object on table for safety use.
1.2 Functions
The coffee table with an LED dot matrix panel, which lights up around objects, which are placed
on the table surface, and changes LED color corresponding to objects’ temperature. LED color
changes corresponding to temperature of objects on table surface. Blue color for “cold” object
and red color for “hot” object. And red LED blinks for hot object that is over a dangerous
temperature to human’s skin.
1.3 Components
Figure 1. Block Diagram
1.3.1 Microcontroller
This module receives analog data from sensors and sends commands to LED control module.
1.3.2 LED Panel
This module receives command from MCU and turns up LEDs.
1
1.3.3 Temperature Sensors
This module amplifies and shifts sensor output voltage and sends processed data to MCU.
1.3.4 IR Sensors
This module connects with multiplexers and outputs selected analog signal to MCU.
1.3.5 Power Supply
This module consists of one 9V 5A AC/DC wall plug-in adaptor and one 5V 5A DC voltage
regulator.
1.3.6 Knob and Toggle Switch
This module controls LED brightness by adjusting potentiometer and turns IR LED circuit on/off
by controlling the relay.
2
2. Design
2.1 Microcontroller
Microcontroller (MCU) is the central module of the project. It is the interface, which communicates with
sensor module and LED control module. The MCU accepts analog input from thermopile temperature
sensors and IR phototransistors and outputs digital values to shift register and sink drivers to control LED
brightness and locations of LEDs to turn on. Also, the MCU sends command to relay, which was
designed to connect with IR LED circuit, so that the IR LED circuit can be entirely turned on/off.
Figure 2. Microcontroller schematic
2.2 LED Panel and Driver
LED panel mainly consists of RGB LEDs, MOSFETs, sink drivers, and shift register. The P-channel and
N-channel MOSFETs work as voltage-controlled switch and are connected with the anode side of the
LEDs. Shift register has eight output pins, each of which goes to the gate pin of MOSFETs and controls
LED row selection. There are three sink drivers in total and each sink driver connects with one of three
cathode sides of the RGB LEDs and thus control LED column selection. In order to calibrate the balance
of red, green, and blue color, three potentiometers are each connected with external resistor pin of sink
driver. Also, another potentiometer was designed to dynamically control the LED brightness by sending
analog voltage to MCU. Then the digital output from MCU to output enable pin of shifter register
changes correspondingly, so that the PWM duty cycle of the LEDs can be controlled.
3
Figure 3. Constant current LED sink driver schematic
Figure 4. Serial-in-parallel-out shift register schematic
4
Figure 5: Schematic of P-channel MOSFETs and N-channel MOSFETs
2.3 Temperature Sensor
Thermopile temperature sensor consists of one thermopile and one thermistor. Thermopile works as
voltage source when there is temperature changing above it, so it can remotely detect the temperature of
object on table surface. Thermistor changes its resistor based on room temperature, so it can be used for
calibration purpose. Since the output voltage of the thermopile ranges from -5mV to 11mV, the value is
too small to be detected precisely by MCU. So, we decided to use an op-amp to amplify the output
voltage. Also, since the MCU cannot accept negative voltage, in order to map the output voltage range to
non-negative interval, we decided to use another op-amp for voltage summing purpose. So, after the
operations of two op-amps, the output voltage was designed to be in the interval from 0V to 5V.
5
Figure 6. Thermopile and operational Amplifier
Figure 7. Thermopile and op-amp circuit on perf board
2.4 IR Proximity Sensor
IR phototransistors can detect 940nm IR light emitted from IR LEDs. So, when an object is placed above
the IR LED, the IR light will be reflected back and received by the IR phototransistors. There are 64 IR
phototransistors in total. Since there are not enough analog pins in MCU, multiplexers will be used to
select IR phototransistors’ output voltages and thus reduce the number of analog pins required for MCU.
6
Figure 8. Two 8:1 Multiplexers and one 2:1 Multiplexer Schematic
2.5 Power Supply
Figure 9. Power jack and power regulator schematic
2.6 Knob and Toggle Switch
In user interface, a relay was designed to work as a switch of the IR LED circuit. MCU sends an analog
signal to relay and relay outputs either 0V or 5V to IR LED circuit based on the MCU input, so that the
IR LEDs are entirely controlled on/off. Also, a potentiometer was designed to connect with the shifter
register in the LED control module. It works as a voltage divider and its resistor decides the output digital
value from MCU to shifter register. So, user can turn the potentiometer in order to change the overall
LED brightness.
7
Figure 10. Relay that works as switch of IR LED circuit
Figure 11: Knob that controls the LED overall brightness
8
3. Design Verification
3.1 Power
All components in the system require 5V operating voltage. To verify the stable 5V output from
the power module, we used oscilloscope to measure the output voltage of voltage regulator. The
measured data stayed stably at 5.06V, which met the requirement. Also, since the entire system
requires maximum 4.6A total current to function properly, we wanted to verify the power
module’s capability of supplying stable voltage at high current sourcing rate. So, we connected
1.8Ω 10W power resistor in parallel with the power module. However, as the theoretical total
current in the system was only 2.78A, the output voltage of the power regulator decreased to
4.79V. We believe that the reason of this verification failure is that the total power of the power
resistor exceeded its maximum tolerable power value, Due to this fact, the real resistance of the
resistor will change and consequently the real total system current could go beyond 5A, which is
the maximum current tolerance of the voltage regulator chip.
Figure 12: Voltage output from power regulator in oscilloscope
3.2 Microcontroller
We designed to assembly Atmega328p chip on PCB board. However, because of the time limitation, we
had no chance to implement this part. So, instead, we used the Arduino Uno as microcontroller, which
performances the same software integration operations in previous design. Also, the microcontroller
module was designed to map the analog signal from thermopile to PWM digital values, which are used
for LED brightness control. Since the thermopile module did not work properly, we could not test the
microcontroller functionality without the appropriate input value.
9
3.3 LED panel and LED control
To test the LED panel and LED control, we wrote test code on Arduino IDE to select LED
coordinate and send commands to LED control module to turn the LED at this coordinate on.
Since shift register and three sink drivers are connected in daisy chain, in each test, we input
four-byte digital values in causal ordering and first three bytes, one byte for each LED color,
operated the column controlling of LED. And the last byte was sent to shift register to control
LED rows. During the verification, the issue we met was that the LED panel had short circuits
occasionally because of the touching of wires on the back of the LED panel. After we enlarged
the distances between each wire and stabilized them with electrical tape, the short circuit
problem was solved and LED panel worked properly. In other word, the LEDs at specific
coordinates were all turned on, according the commands from the microcontroller.
3.4 Thermopile and Op-amp
During the assembly and testing of thermopile temperature sensing module, we had difficulties to
maintain a stable gain value of the amplifier circuit. Tested on breadboard, the op-amps worked
properly and we recorded exact gain and voltage shift value, which was 312 and +1.56V. However, as we
moved on to assembly parts on perfboard, the results went unstable and occasionally went wrong. For
example, the following table 1 shows the data we measured from the testing on perfboard. Only the
second trail met the requirement. Our assumption for this failure is that during the soldering procedure,
some holes in perfboard are not connected well with the parts.
Table 1: Amplifier Gain and Shifted Voltage value of op-amps
Sensor Output voltage Amplifier Gain Shifted Voltage
Trial I: -0.43mV
447.37
+1.47V
Trial II: 1mV
317
+1.56V
Trial III: 7mV
278.5
+1.57V
3.5 IR Proximity Detection
The IR proximity sensor outputs different voltage value depending on the intensity of 940nm IR
light, that the sensor receives. So, in order to verify that the field of view of the entire IR sensor
module covers 90% ± 5% area of the table surface, we decided to evenly split the table surface
into 16 square regions and measure the IR sensor output data when object was placed on specific
testing points, the center and corners of each region. The test object we chose was a shot glass,
whose diameter was 3.5 centimeter. In microcontroller’s aspect, it receives digital input value
from 0 to 5, when no object is placed above the IR sensors. The verification results was that,
testing on each testing points, at least one IR sensor below the object responded to the IR light
that was reflected back by the bottom face of the object.
10
3.6 Knob and Switch
Also, because of the time limitation, we had no chance to implement both knob and switch parts in our
final working product. However, we managed to assembly them on perfboard and they worked
appropriately according to the requirement. That is, relay was powered directly by voltage regulator and
was controlled by MCU to output either 0V or 5V to IR LED module. The phototransistors outputted
higher voltage, which was over the threshold value, when relay was turned on. Moreover, for the knob
part, we successfully tested it on breadboard. It was connected with shifter register. As we turned the
knob, the LED brightness was controlled. However, later we found that the LED brightness was not
related linearly with the potentiometer rotation angle. Then, we realized that this issue could be solved
in software. That was, in order to receive a linearly changing LED brightness, we could pre-calibrate the
LED brightness and save the value in an integer buffer with size of 256. However, since we also did no
have time to implement the entire system software, we were not able to test the knob part as well.
11
4. Costs
Following tables will show the detailed costs of out project. Table 2 outlines the costs for the
components, and Table 3 shows labor costs.
4.1 Parts
Part
Part/ Model Number
Unit
Cost
Quantity Total
Microcontroller
Atmega328p
$5.95
1
$5.95
Diffused Rectangular 5mm RGB
LEDS
259RGBM5C-013
$0.595
64
$38.08
Thermopile Temperature Sensor
ZTP-135SR
$3.10
16
$49.60
IR Phototransistor
LTR-3208
$0.30
16
$4.80
Power Supply
SW-4071
$9.00
1
$9.00
IR LED
1080-1071-ND
$0.293
9
$2.637
Power Jack
CP-102AH-ND
$1.18
1
$1.18
Voltage Regulator
LM1084IT-5.0/NOPBND
$2.66
1
$2.66
P-MOSFET
NDP6020P
$1.58
8
$12.64
N-MOSFET
PSMN022-30PL
$0.58
8
$4.64
Constant Current LED sink driver
296-24383-5-ND
$1.387
3
$4.161
Shift Register
296-1600-5-ND
$0.495
1
$0.495
8:1 Multiplexer
CD74HC4051E
$0.515
8
$4.12
2:1 Multiplexer
CD74HC4053E
$0.488
2
$.976
Potentiometer
3306P-1-102
$0.43
4
$1.72
Relay
CLA280-ND
$6.55
1
$6.55
$155.5
Total Cost
12
4.2 Labor:
Name
Hourly Rate Hour Invested Total Cost
= Hourly Rate x 2.5 x Hours Invested
Jekyung Choi $30.00
200
$15,000
Li Jiang
200
$15,000
400
$30,000
$30.00
Totals
4.3 Total Cost:
Total cost = Part cost + Labor Cost = $30155.5
13
5. Conclusion
5.1 Accomplishments
The individual main modules of project was working as we designed at least on the breadboard.
The PCB board of MUX was working correctly right after we soldered and tested with High,
Low inputs generated from power supply. In Thermopile op-amp module, we successfully get
the stable voltage shifted value we expected and it didn’t change value with any external
difference such as changing breadboard to perfboard, poor soldering.
5.2 Uncertainties
We are uncertain how to catch the stable sensor voltage from thermopile at specific temperature.
Even though we were at the room temperature, the thermopile output voltage kept changing in
large range and sometimes the value went beyond the range from datasheet. We assume we
might need more accurate multimeter that measure precise value. Our project of LED idea
started developing with our TA Jacobs’ marvelous idea. We couldn’t get the perfect device that
we designed with current level experiment. However, after all, we believe that we can improve
this project and can be satisfied with our design in near future.
5.3 Ethics Statement
In this project, we consider the following points from the IEEE Ethics:
[1] To accept responsibility in making decisions consistent with the safety, health, and welfare of
the public and to disclose promptly factors that might endanger the public or the environment.
[3] To be honest and realistic in stating claims or estimates based on available data
[5] To improve the understanding of technology; its appropriate application, and potential
consequences
[9] To avoid injuring others, their property, reputation, or employment by false or malicious
action
These are relevant since our project is more concerned on hardware and has bunch of wires for
that fact. It is important to accept responsibility in safety, improve understanding of the design to
prevent physical injury while we are working on project especially concerning on hardware work.
5.4 Future Work
After this semester, we will still work on this project. Mainly focusing on the software side, we
want to write code for microcontroller to integrate the sensor module and LED display module,
so that users can get instant response as they put any objects on the table surface. Also, in this
semester, we failed to map thermopile output voltage into an appropriate digital range. We will
continue working on this feature so that different LED colors will be displayed corresponding to
object temperature. Moreover, to enhance the LED display functionality, we want to program on
14
more LED display patterns, which will glow around the objects on surface when they are
detected.
15
References
[1]Daycounter, "Non-Inverting op-amp level Shifter," 2016. [Online]. Available:
http://www.daycounter.com/Circuits/OpAmp-Level-Shifter/OpAmp-Level-Shifter.phtml.
Accessed: Dec. 8, 2016.
[2]N. Emmanuel, "Non-inverting operational amplifier - the Non-inverting op-amp," Basic
Electronics Tutorials, 2013. [Online]. Available: http://www.electronicstutorials.ws/opamp/opamp_3.html. Accessed: Dec. 8, 2016.
[3]Contributors and J. 0, "Voltage Dividers,". [Online]. Available:
https://learn.sparkfun.com/tutorials/voltage-dividers. Accessed: Dec. 8, 2016.
16
Appendix A: Requirement and Verification Table
Power:
Requirements
Verification
Voltage Regulator:
Voltage Regulator:
1. Connected with 12V 5A power supply,
1. Setup test program on Arduino IDE:
the 5V 5A voltage Regulator should
Turn on all 16 IR LED and 64 IR
output 5V voltage when the system
transistors. And then Turn on each
sources total current 4A.
RGB LED on incrementally one at
time and measure voltage and current
output of voltage regulator at each
time.
Microcontroller:
Requirements
Verification
Hardware:
1. Mapping op-amp (0~5V) output
voltage range to Analog-toDigital-Converter resolution
(0~255). 5V/256 = 20mV/step.
Hardware:
1. Use power supply in lab and provide a sweep
voltage with 20mV each step, from 0V to 5V,
to ADC, and check if the decimal value in
microcontroller increments by 1 for each
step.
Software:
1. Handles all LEDs and sensors
with low latency (6.67Mb/s
processing speed needed for
processing all the LEDs and
sensors simultaneously with
low latency), within 0.3
second reaction time.
Software:
1. Record a video. Upon receiving the uploaded
code from Arduino IDE, the Arduino Uno’s
indicator LED will flash, which means
Arduino receives uploaded code and starts
processing. So, we record the LED indicator
flashing time as starting time and record the
LED turn-on time as ending time, then the
difference should be within 0.3 second.
LED Panel and LED control:
17
Requirements
Verification
LED Control:
1. Color indicates correct
color corresponding to
object temperature. (for
difference in every 10
Celsius degree)
LED Control:
1. Put a cup of hot water on table surface, record the
LED color and water temperature using
thermometer. Then, add ice into the hot water at a
constant rate(2 ice cube in every min) and record
LED color and water temperature every 10
seconds.
Shift Register:
1. Every single LED is
addressed correctly by shift
register
Shift Register:
1. We use MCU to send out command to light up a
LED in certain position and see if the LED light
up at desired position. And repeat for every LED
position.
Thermopile and Op-Amp:
Requirement
Verification
1. Mapping temp sensor dynamic range to opamp output voltage. Temp sensor output
voltage range(-5mV,11mV) should be
mapped properly to (0V, 5V). So, the gain
should be G = 312.5 ±10% with output
range of (-1.56V, 3.43V)±10%. Since the
original output voltage starts from negative
value, Voltage shifter of (+1.56V)±10% is
needed. Output voltage goes into (0V,
5V)±10%
1. Use power supply in lab and
provide a sweep voltage with
0.3V step from -5mV to 11mV
(simulate sensors dynamic
range) to op-amp, and use
multimeter measure the output
voltage of op-amp. Verify if the
gain is maintained at 312.5
±10%
IR Proximity Detection:
Requirement
Verification
IR phototransistor Field of
View range should cover 90%
± 5% of the table surface.
Use a regular drinking cup of 8 cm diameter, put it on prescaled points of the table surface and measure the IR
phototransistor output voltage. And the detection rate among
all pre-scaled points should be 90% ± 5%.
Knob and Switch:
18
Requirement
Verification
Knob (potentiometer) changes
LED brightness accurately
corresponding to potentiometer
angle.
Place a light meter at a fixed location and direction to the
LED. Turn potentiometer from 0 degree to 360 degree.
For each 10-degree rotation, record the measured
brightness value the of LED.
Relay turns whole IR LED matrix
on/off upon receiving
microcontroller signal.
Place phototransistors facing directly to the IR LEDs and
check the phototransistor output voltage when relay is turn
on or off.
Requirement Summary:
Module Name
High Level Requirement
Points
Power
This module should be able to provide
enough current and voltage when to each
module in the system.
15
Microcontroller
This module should be able to coordinate
LED module, Thermopile module, and IR
proximity module.
20
LED panel and
LED control
This module should successfully handle
input data from microcontroller and address
correct LED color and position.
20
Thermopile and
Op-amp
This module should output amplified and
shifted positive voltage range 0 ~ +5V to
ADC in microcontroller.
20
IR Proximity
Detection
This module should collect correct position
data of object on table surface to
microcontroller.
15
Knob and Switch
Three knobs (potentiometers) control
brightness of LEDs in LED panel. Also,
relay switches the whole IR LED matrix
on/off.
10
(5 points
for potentiometer, 5
points for relay)
19