ee 330 final project voice control light...
TRANSCRIPT
EE 330 Final Project
Voice control Light Controller
Team member: Daoxi Sun, Chen Cheng
Fall 2014
Fall 2014 EE330 final project report Daoxi Sun
2
Introduction
For this final project the goal is to design a light controller with two control options, one
is SPST switch and another one is voice. The light should be controlled by SPST switch
when there is enough light, and it should be controlled by voice when it is dark.
Lab Work
We wrote Verilog code to simulate this, the complete main code is shown on the next
page, we put enough comments in the code to help explain what each part does, reading
comments in the code will really help graders understand our code.
Fall 2014 EE330 final project report Daoxi Sun
3
continued:
Fall 2014 EE330 final project report Daoxi Sun
4
Now we break our code into 4 parts and explain them separately:
In the first part we set up and initialize everything, we use 1 second for time scale for the
convenience of using 30 seconds timer as well as testing real world situation, we declare
all variables in this part, and build clock by inverting the signal every 0.5 period.
Fall 2014 EE330 final project report Daoxi Sun
5
In the second part we take care of situation when the environment is dark (p==0), in this
case the light should be turned on ( l<=1) if there is sound and turned off ( l<=0 ) 30
seconds after that. The key variable t which represents timer will be introduced later.
In the third part we deal with situation when it is bright (p == 1), basically the light
should be completely controlled by the switch (sw).
In the last part we build the timer, this is done by increasing timer (t) by 1 on each
positive edge of the 1Hz clock, and stop increasing after reaching 30 in binary (11110).
Fall 2014 EE330 final project report Daoxi Sun
6
Now we test it by using testbench (shown on next page), the comments in the code
explains what each line does, note that we tested it first at when it is bright ( p == 1 ), so
not all the signal starts from 0, the code is shown below:
Fall 2014 EE330 final project report Daoxi Sun
7
continued:
Fall 2014 EE330 final project report Daoxi Sun
8
We complied the code and started simulation, setting total time to 100 seconds, and we
have the following waveform generated:
Note on the waveform above we divided it from part a to part e (see the red-circle), to
make verification simpler, we made the following simple truth table:
Fall 2014 EE330 final project report Daoxi Sun
9
input input input output
m (microphone) p (phototransistor) sw (switch) l (light output)
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1
*note: t (timer) is a 5-bit variable only to help us resetting the l (light), it keeps increasing
1 by 1 until reaching 11110 (30 in decimal), and it set l (light) to 0 when changing from
11101(29 in decimal) to 11110 (30 in decimal).
Now we look at the part a to part e of the waveform:
---Part a: initial condition, bright environment, but no sound and switch is off, so light
should be turned off.
---Part b: there is some sound, but because it is bright, the light is not turned on.
---Part c: when it is bright, we can use sw (switch) to control the light, and it works as
intended.
Fall 2014 EE330 final project report Daoxi Sun
10
---Part d: now we make the environment dark (p=0), and make some sound so that the
light is turned on, the light keeps on after sound disappear, and it keeps on for 30 seconds
then it’s turned off by the t(timer).
---Part e: we try to use switch to control the light when it is dark, the light won’t change,
which is intended.
Therefore, our code works well based on our test.
Next we build the schematic and synthesize as following:
Fall 2014 EE330 final project report Daoxi Sun
11
Here is the resulted schematic:
Fall 2014 EE330 final project report Daoxi Sun
12
And then we created symbol for it:
Next we build the standard cell placement:
With route:
Fall 2014 EE330 final project report Daoxi Sun
13
With filler:
Fall 2014 EE330 final project report Daoxi Sun
14
Furthermore, we are to generate layout for our design, it is shown below:
Fall 2014 EE330 final project report Daoxi Sun
15
It passed DRC:
And here is the extracted view of the layout:
Since we are not able to print our design on silicon board, we can only simulate in
software level not hardware level, but here is how we will implement the input in the
Verilog code:
For the m (microphone) input, we will first use a microphone to get AC signal, then we
filter out the DC bias with a large capacitor, the filtered AC signal then goes through a
rectifier to be converted to DC, finally the signal is sent to comparator to see if the
voltage level is above a certain voltage, the design is shown below:
Fall 2014 EE330 final project report Daoxi Sun
16
The microphone we use is POM-1644P microphone, the datasheet is shown below:
For the sw (switch), it will be a very simple circuit shown below:
Fall 2014 EE330 final project report Daoxi Sun
17
In the end, we are to connect the circuits above to our Verilog designed part to make the
whole system work.
Conclusion
This project was a bit challenging for us, we utilized a lot of what we learnt from EE330
and many other classes such as Cpr E 281 and EE 230. The biggest issue for us when we
were doing the project is the fact that all Linux machines in Coover were repeatedly
down due to U: drive problem. We spent a lot of time to figure out how to approach the
solution, how to debug Verilog, as well as generating waveforms, layout and so on.
Overall this project helped us a lot to prepare for designing real world VLSI, and this
light controller will save a lot of power from closing during daytime and turning on only
when there are people around.