electronics design laboratory lecture #11ecee.colorado.edu/ecen2270/lectures/lecture11.pdf · speed...

20
ECEN 2270 1 Electronics Design Laboratory Electronics Design Laboratory Lecture #11

Upload: lyliem

Post on 03-Jul-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

ECEN 2270 1Electronics Design Laboratory

Electronics Design LaboratoryLecture #11

Project• Must rely on fully functional Lab 2‐4 circuits, Lab 5 circuit is optional– Can re‐do wireless or replace it with a different control method if desired. The project does not have to include remote control.

• Must include an additional hardware component. Programming only add‐ons or enhancements do not count.

• When selecting components check– Range– Voltage– Communication

Electronics Design Laboratory 2ECEN 2270

Sensors• Range

– Ultrasonic– Infrared– Buttons

• Position– Compass– Accelerometer– Gyros– GPS– Tilt

• Sound– Voice Recognition– Microphone– Speakers

• Environment– Temperature– Humidity– Altitude– Pressure– Light (LDR, etc)

• Physical– Pressure– Flex– Vibration– Buttons

• Other– RFID– ZigBee– Bluetooth– Other wireless

Electronics Design Laboratory 3ECEN 2270

Actuators• Your robot• Motors

– DC (Brushed or Brushless)– Stepper– Servo– Linear– Solenoid

• LEDs– Single Color– RGB w/ PWM control– Infrared– 7 segment

Arduino• Shields

– Motor/Stepper/Servo– GPS– Audio (wave, mp3, etc)– Ethernet– GSM– Wifi

• Larger controllers

Final Project and Experiment 5• Final Project

– Project ideas and discussions this week, additional parts you may need? 

– Parts can take 1‐1.5 weeks to get here.  Order early and order extras!

• Experiment 5– Lab 5A: build the components of a wireless on/off and speed control circuit (should be done Tuesday this week)

– Lab 5B: prelab due on Thursday• Write code for the Arduino to measure the on time of a digital input for speed control (should start this Thursday, finish Tuesday next week)

• Demonstrate wireless control of the robot, demo is Thursday next week

Electronics Design Laboratory 4ECEN 2270

Wireless Transmitter/Receiver

• Carrier frequency fc is fixed at 434MHz• Modulation frequency fm is much lower• By filtering vrx the sent data can be re‐created

Electronics Design Laboratory 5ECEN 2270

Data

RF

vtx

1/fm

1/fc

vrx

Data

0 fm 3fm 5fm fc0

0.5

1

1.5

AM Modulation of RF signal at 434 MHz 

Electronics Design Laboratory 6ECEN 2830

0

0.5

1

1.5

0 1/fm 2/fm 3/fm

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

Sinu

soidal M

odulation

ON/O

FF M

odulation 

(Amplitu

de Shift Keying (ASK

)

Time Domain Frequency Domain

CarrierModulationSignal

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

0

1

2

3

4

5

Volts

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

0

1

2

3

4

5

Seconds

Volts

RF Communication

Electronics Design Laboratory 7ECEN 2270

• Group A (Red Waveforms) wants to send a 1sec pulse starting at 100ms.  Group A will use a fm = 500Hz modulation frequency

• Group B (Black Waveforms) wants to send a 1sec pulse as well,  but starting at 500ms.  Group B will use a fm = 1200Hz modulation frequency

• Both groups are going to try and send this signal wirelessly,  using a 434MHz wireless transmitter/receiver pair

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

Group A Data

Group B Data

This is just an example of data sent by two groups

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

0

1

2

3

4

5

Volts

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

0

1

2

3

4

5

Seconds

Volts

RF Communication

Electronics Design Laboratory 8ECEN 2270

Both signals are modulated using a 555 timer oscillating at 500Hz for Group A, and 1.2kHz for Group B

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

5VDC

Input

Output

fm1 = 500Hz

fm2 = 1.2kHz

Group A Modulated Data

Group B Modulated Data

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2-3

-2

-1

0

1

2

3

Volts

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2-3

-2

-1

0

1

2

3

Seconds

Volts

RF Communication

Electronics Design Laboratory 9ECEN 2270

The RF transmitter modulates the signal a second time at the carrier frequency of 434 MHz

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

fc = 434 MHz

fm1 = 500Hz

fm2 = 1.2kHz

Group A RF Signal

Group B RF Signal

0 1 2-3

-2

-1

0

1

2

3

Volts

0 1 2-3

-2

-1

0

1

2

3

0 1 2-3

-2

-1

0

1

2

3

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2

-5

0

5

Seconds

Intesity

RF Communication

Electronics Design Laboratory 10ECEN 2270

• Both RF transmitters are sending on the same frequency

• In addition, there is a noticeable amount of noise in most environments

• The result is an extremely messy signal, and this is with just two groups transmitting simple data pulses. 

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

Group A Transmission

Group B Transmission RF Noise

Total RF noise and signal

RF Communication

Electronics Design Laboratory 11ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

• When neither transmitter is operating,  the RF spectrum is dominated by noise

• This random noise floor is generally of a low magnitude and equally distributed across all frequencies

fc

Noise spectrum when no one is transmitting

RF Communication

Electronics Design Laboratory 12ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

fc

• When Group A begins to transmit,  spikes in the frequency spectrum appear

• These spikes are much larger than the noise floor and at known frequencies! 

fc+fm1fc‐fm1

RF Communication

Electronics Design Laboratory 13ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

fc+fm2fc‐fm2

fc

• When Group B begins to transmit,  additional spikes in the frequency spectrum appear

• These spikes are at a different frequency than Group A’s transmissions!

• Neither signal overlaps with the other

RF Communication

Electronics Design Laboratory 14ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

fcfc

• An RF receiver acts as a demodulator

• This demodulation shifts the frequency spectrum such that fc = 434MHz is shifted to 0Hz

• Both Group A and Group B receivers are picking up everything

fm1 fm2

RF Communication

Electronics Design Laboratory 15ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

• Each group’s filter is tuned to their specific modulation frequency

• This is how we separate our signal from noise and other groups

5VDC

5VDC47kΩ

47kΩ 0.1μF

210nF

10nF

R3

R1

R23

fm1 fm2

Group A Filtered Output

Group B Filtered Output

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

2

4

Seconds

Magnitude

0

1

2

3

4

5

Seconds

Volts

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

1

2

3

4

5

Seconds

Volts

RF Communication

Electronics Design Laboratory 16ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

• Each groups filter is tuned to their specific modulation frequency

• This is how we separate our signal from noise and other groups

5VDC

5VDC47kΩ

47kΩ 0.1μF

110nF

10nF

R3

R1

R22

Group A Filtered Output

Group B Filtered Output

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

2

4

Seconds

Magnitude

0

1

2

3

4

5

Seconds

Volts

0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 20

1

2

3

4

5

Seconds

Volts

RF Communication

Electronics Design Laboratory 17ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

• Each groups filter is tuned to their specific modulation frequency

• This is how we separate our signal from noise and other groups

Group A Filtered Output

Group B Filtered Outputfm2

18ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

RF Communication

• Peak detector follows the peak value of the waveform

• This value is a diode  drop less than the real peak!

• We can use a comparator on this peak detector output in order to generate our pulse outputs.

Out

Peak Detector

Electronics Design Laboratory

In

0.05 0.1 0.15 0.2 0.250

2

4

Seconds

Magnitude

0

1

2

3

4

5

Seconds

Volts

0.08 0.085 0.09 0.095 0.1 0.105 0.11 0.115 0.120

1

2

3

4

5

Seconds

Volts

0.7V

0.7V

Vthreshold

Vthreshold

19ECEN 2270

Input Signal Transmitter Receiver Robot

(Arduino)Modulator Filter Peak Detector

Complete Receiver

Electronics Design Laboratory

5VDC

5VDC47kΩ

47kΩ 0.1μF

Input10nF

R3

R1

R2

Peak Detector

5VDC

5VDC

R40.1μFR5

Comparator

Output

vf vpd

Vthreshold

Filter should have a gain of 1 (0dB) at fm

When you are transmitting, vf should be a 0‐5V sinewave 

centered around 2.5 V

RC time constant in the peak detector  should be large enough 

so that ripple in vpd is small. The peak detector output vpd

should be around 4 V when you are transmitting. 

Comparator Vthreshold should be close to but below the (vpd)minwhen you are transmitting

0‐5 V digital data to Arduino

ECEN 2830 Electronics Design Laboratory 20

You may use another 555 (or another Arduino) on the transmitter side to generate the DATA signal

DATA is encoded via pulse width ton

DATA