Electronics Design Laboratory Lecture #10 Electronics Design Laboratory 1
Lessons from Experiment 4 Code debugging: use print statements and serial monitor window Circuit debugging: Re check operation of the speed sensor, driver, speed controller Clean up the circuit Neat layout helps reduce parasitics, reduces errors, helps in debugging Drop short wires from Arduino pins down to the breadboard next to Arduino, then route connections neatly from there Do not forget to include decoupling caps next to each chip Include 1K (or larger) resistors between encoder outputs and Arduino interrupt pins Use scope to check encoder pulses; noise may generate spurious interrupts Electronics Design Laboratory 2
Look Ahead: Project (Experiment 6) About 3 weeks total, 6 sessions, including final demo Must rely on fully functional Lab 2 5 circuits Must include an additional analog circuit design hardware component. Programming only add ons or enhancements do not count. Some possible topics: Additional sensors (light, IR, ultrasonic, audio, ) Additional actuators (light, audio, ) More advanced wireless control Electronics Design Laboratory 3
Experiment 5 and Final Project Experiment 5 time will be split between preparing for your final project and designing a wireless controller for your robot Final Project: start working on final project ideas Milestone 1 (week of Oct 31): informal discussions about project ideas Milestone 2 (week of Nov 4): final project ideas and possible parts lists Project proposal presentations due Sunday, Nov 13. Each group will present the proposal slides in class on Monday, Nov 14 Written project proposals are due Wednesday, Nov 16 Experiment 5 Build the components of a wireless on/off and speed control circuit Write code for the Arduino to receive/set a threshold on an analog control signal for on/off control and to measure the duty cycle of a digital input for speed control Demonstrate wireless on/off and speed control of the robot Electronics Design Laboratory 4
Wireless Control Wireless Controller Transmitter v tx 0 v rx 0 433.92 MHz RF Wireless controller generates PWM signal to be sent to Wireless channel: use transmitter and receiver boards to encode and transfer signal v tx to receiver side v rx wirelessly translates RF signal into a 0 5V signal Arduino receives the same PWM signal that was sent by the wireless controller Electronics Design Laboratory 5
Wireless Transmitter/ 1. Series of pulses is sent to the wireless transmitter 2. When input is high, transmitter outputs a 434MHz signal. This signal is applied to the transmitters antenna and travels through the air 3. A receiver tuned to the same frequency outputs a high value when it senses a signal on its antenna v tx 0 RF v rx 0 Wireless transmitter modulates a signal at a specific frequency This is OK if only one person needs to transmit at a time If a lab full of people all try and transmit at 434MHz Need a way for everyone to use the same frequency while minimizing interference with each other Electronics Design Laboratory 6
Approach Modulate our modulated signal! Our transmitters have the same center frequency of 434MHz Switch this signal on an off at a much lower frequency, unique to each group Band pass filter the received signal at own modulation frequency to reject any signals sent by other groups Electronics Design Laboratory 7
Signals in the wireless TX/RX path Data v tx is at group s unique modulation frequency f m v tx 1/f m 1/f c v rx is at group s unique modulation frequency f m RF v rx Data Carrier frequency f c is fixed at 434 MHz Modulation frequency f m is between 400 Hz an 1 khz By filtering v rx the sent data can be re created Electronics Design Laboratory 8
Wireless Control: Six Blocks Needed Wireless Controller Modulator Transmitter Filter 433.92 MHz RF Wireless Controller generates high/low data signal Modulator turns high/low into pulsed waveform at frequency f m Transmitter generates RF signal at 433 MHz receives RF signal at 433 MHz Filter removes all frequency that we didn t send, i.e. all frequency other than f m and reconstructs data signal responds to data signal received Electronics Design Laboratory 9
Wireless Control: Data and Low Frequency Modulator Wireless Controller Modulator Transmitter Filter Inputs: on/off data signal Outputs: 0 5 V PWM signal at f m Electronics Design Laboratory 10
Wireless Control: Data and Low Frequency Modulator Wireless Controller Modulator Transmitter Filter f m = 1.44/(C*(R A +2R B )) D = (R B )/(R A +2R B ), choose D = 45% Output v tx 1/f m R A Input Data 0.01μF R B < ½R A C = 0.01μF *An alternative 50% duty cycle 555 oscillator is given in Fig.14 of the 555 data sheet ECEN 2830 Astable Operation (Fig.4 of the 555 data sheet*) Electronics Design Laboratory 11
Wireless Control: Radio Frequency Tx and Rx Wireless Controller Modulator Transmitter Filter Input: 0 5 V signal at f m Output: messy signal containing many frequencies in additional to the one we want ECEN 2830 Electronics Design Laboratory 12
Transmitter (Tx) WRL 10534 (Rx) WRL 10532 8 7 6 5 4 3 2 1 4 3 2 1 1 2 3 4 Pin 1: GND Pin 2: Data In (0 to V CC pulses v tx ) Pin 3: VCC (5V to 10V) Pin 4: Antenna 1234 5 6 78 Pin 1: GND Pin 2: Data Out (0 to V bat pulses v rx ) Pin 3: analog out (not used in the experiment) Pin 4: +5V (NOT 10V!!) Pin 5: +5V (NOT 10V!!) Pin 6: GND Pin 7: GND Pin 8: Antenna (about 13 17cm) Electronics Design Laboratory 13
Transmitter & Design Notes Follow standard circuit prototyping practices: connect all supply and ground pins, include decoupling capacitors in the close proximity of the supply pins (47 F electrolytic and 0.1 F ceramic) If data input v tx pulses are too long (more than about 10 ms), or too short (less than about 0.5 ms), the receiver output v rx will be noisy Performance will depend on Tx and Rx location and distance. Wire antennas can be used to improve performance (note: /4 = (c/f)/4 = 17 cm) Tx and Rx can be tested separately using the lab waveform generator, and two lab power supply voltages (set both to +5V) Multiple transmitters operating at the same time will interfere with each other Electronics Design Laboratory 14
Wireless Control: Filter and Detector Wireless Controller Modulator Transmitter Filter Input: Messy signal containing many frequencies in additional to the one we want Output: high when f m is present at input, low when f m is absent from input Electronics Design Laboratory 15
Wireless Control: Filter and Detector Wireless Controller Modulator Transmitter Filter Bandpass filter will attempt to remove all frequencies that we don t want Passband Gain = 0dB Gain Center Frequency Quality Factor Q determines how wide peak is. High Q means narrow passband. f m Frequency ECEN 2830 Electronics Design Laboratory 16
Wireless Control: Filter and Detector Wireless Controller Modulator Transmitter Filter Bandpass filter will attempt to remove all frequencies that we don t want Gain Gain 0dB Group X Group Y 0dB f m Frequency f m Frequency Electronics Design Laboratory 17
Wireless Control: Filter 3 Wireless Controller Modulator Transmitter Filter 1 One version of bandpass filter implementation 10nF 2 R3 2 R1 10nF R2 3 47kΩ 47kΩ 0.1μF Electronics Design Laboratory 18
Band Pass Filtering Group X Gain 0dB Group X Group Y My f m Frequency Gain Group Y 0dB f m Frequency Electronics Design Laboratory 19
Wireless Control: Filter and Detector Wireless Controller Modulator Transmitter Filter 1 10nF R3 2 R1 10nF R2 3 One version of bandpass filter implementation 47kΩ 47kΩ 0.1μF Electronics Design Laboratory 20
Wireless Control: Filter and Detector: Peak Detector My 4.3V Output Filter 10nF Group X 2.8V Output 2 R1 10nF R3 Peak Detector R2 One version of bandpass filter implementation 47kΩ 47kΩ 0.1μF 3 4 Group Y 3.4V Output Electronics Design Laboratory 21
Amplitude Detector: Peak Detector and Comparator Wireless Controller Modulator Transmitter Filter Input: Messy signal containing many frequencies in additional to the one we want 10nF Output: High when f m is present at input, low when f m is absent from input Input R1 10nF R3 v f Peak Detector v pd Comparator R2 One version of bandpass filter implementation 47kΩ 47kΩ 0.1μF V threshold R5 0.1μF R4 Output Electronics Design Laboratory 22
Amplitude Detector: Peak Detector and Comparator Input Output Input: Messy signal containing many frequencies in additional to the one we want Output: High when f m is present at input, low when f m is absent from input 10nF Input R1 10nF R3 v f Peak Detector v pd Comparator R2 One version of bandpass filter implementation 47kΩ 47kΩ 0.1μF V threshold R5 0.1μF R4 Output Electronics Design Laboratory 23