Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I only need help with midterm changes requierement part 2. Wiring Connections All wire connections in Red are external wires from your breadboard to the

image text in transcribed
image text in transcribed
I only need help with "midterm changes requierement" part 2.
Wiring Connections All wire connections in Red are external wires from your breadboard to the demo connectors. 1- The entire breadboard is powered from the VCC line from the demo board which is 3.3V. This reduced voltage is coming from the USB 5V supply, and therefore be power conservative. 2. Pins 1A and 2A of the H-Bridge Driver L293 (or equivalent) are connected to Port 1.5 and 1.4. These two pins from the micro control the direction of the motor. When both of them are 00 or 11, the motor stops. It is always a good practice to bring the two pins to zero before you change direction 01 or 10. 3- Pin 12EN (bridge enable signal) is connected to Port1.6 of the micro which is the PWM signal generated by the internal PWM counter. The duty cycle of this PWM is proportional to the light intensity read from the light sensor. 4- For testing while saving power, keep the motor out and use instead two LEDs connected in opposite polarity along with 330 ohm resistor to the bridge drive outputs, 1Y, 2Y. 5. The temp sensor LM34 (or equivalent) is connected to Port1.0 (A0). For a room temperature of 78 F degrees, you read exactly 780 V on AO. Using 10-bit resolution, the digital value of the temperature the sensor analog value in decimal * (3.3/ 1024) *100. 6- The photo cell is connected to Port 1.2 (A2). With the lK resistor in series (matching the phot cell value in normal light room, about 1.2K), you should read about half of the 3.3v supply value. The phot cell and the resistor work as a voltage divider, so you should read about 3.3v/2. When you block the light completely from the photo sensor, the reading goes higher and close to the VCC value (3.3 V). When you apply direct light onto the sensor, the reading goes lower and close to the GND value (OV). 7- The touch switch is connected to Portl.1 (AI) and a 100K ohm resistor. When you touch the transistor base, the reading on Aldrops from #1000 to #50. To make a better circuit, also touch the GND pin. The Midterm Project Assemble the entire circuit as shown on the next page. Use the skeleton code software MidTerm-V30 to make sure you got your hardware is connected properly. Do not change any part of the software till you get you hardware completely functional as follows: 1. The motor starts spinning in FW direction at about 50% duty cycle, which corresponds to the light intensity of the "normal" room light. 2. If the light decreases by hand shadow, the speed of motor decreases, and if you apply more light, the motor would speed up, basically the speed will follow the duty cycle of the PWM signal which is proportional to the light 3- The touch switch is used to change the motor direction, RV direction while touching. 4- The temperature sensor reading about (218-240) is used to turn on/off the SSR using absolute values, basically if the temperature is higher than the roomtemp * 1.2, it will turn the LED on. For now, you will control an LED (on port 2.0) instead of the SSR. Please do not assemble/use the SSR/AC line circuit until I show you how to do it in the lab. 5. At the board start-up or reset, the micro reads the room temp/light/touch and saves values as the "normal" room temp/light/touch (or baseline values) for use within the main infinite loop. 6- Please follow the exact layout on the bread board to make it easy for me to troubleshoot it for you. Midterm Changes Requirement Once you have your hardware perfectly running the skeleton code, please make the following changes for grade. Please make once little change at a time, and fully test it before you start another change. Please do not change you're your hardware connections while testing your software. If you have errors in both software and hardware, it will be impossible to fix multiple problems and it will cause lots of frustration. 1. Change the temperature code so that if the temperature increases by 2% from the baseline (that is temproom * 1.2), the SSR turns on, and the temperature drops below temoproom *1.1, the SSR will turn off 2- The touch switch code must be changed so that every time you touch the switch, the motor direction toggles and stays the same till next touch. When you un-touch, nothing happens. 3- Change the code of motor control so that when the light intensity (the PWM value) is higher than 80%, then turn the motor fully on. And when you block the light by hand, that is when the PWM value is less than say 20% the motor should stop. These are the basic changes you need to make to the skeleton code to get the full grade of he midterm. Only after we completely finish with the Midterm we will talk about the final term project. Wiring Connections All wire connections in Red are external wires from your breadboard to the demo connectors. 1- The entire breadboard is powered from the VCC line from the demo board which is 3.3V. This reduced voltage is coming from the USB 5V supply, and therefore be power conservative. 2. Pins 1A and 2A of the H-Bridge Driver L293 (or equivalent) are connected to Port 1.5 and 1.4. These two pins from the micro control the direction of the motor. When both of them are 00 or 11, the motor stops. It is always a good practice to bring the two pins to zero before you change direction 01 or 10. 3- Pin 12EN (bridge enable signal) is connected to Port1.6 of the micro which is the PWM signal generated by the internal PWM counter. The duty cycle of this PWM is proportional to the light intensity read from the light sensor. 4- For testing while saving power, keep the motor out and use instead two LEDs connected in opposite polarity along with 330 ohm resistor to the bridge drive outputs, 1Y, 2Y. 5. The temp sensor LM34 (or equivalent) is connected to Port1.0 (A0). For a room temperature of 78 F degrees, you read exactly 780 V on AO. Using 10-bit resolution, the digital value of the temperature the sensor analog value in decimal * (3.3/ 1024) *100. 6- The photo cell is connected to Port 1.2 (A2). With the lK resistor in series (matching the phot cell value in normal light room, about 1.2K), you should read about half of the 3.3v supply value. The phot cell and the resistor work as a voltage divider, so you should read about 3.3v/2. When you block the light completely from the photo sensor, the reading goes higher and close to the VCC value (3.3 V). When you apply direct light onto the sensor, the reading goes lower and close to the GND value (OV). 7- The touch switch is connected to Portl.1 (AI) and a 100K ohm resistor. When you touch the transistor base, the reading on Aldrops from #1000 to #50. To make a better circuit, also touch the GND pin. The Midterm Project Assemble the entire circuit as shown on the next page. Use the skeleton code software MidTerm-V30 to make sure you got your hardware is connected properly. Do not change any part of the software till you get you hardware completely functional as follows: 1. The motor starts spinning in FW direction at about 50% duty cycle, which corresponds to the light intensity of the "normal" room light. 2. If the light decreases by hand shadow, the speed of motor decreases, and if you apply more light, the motor would speed up, basically the speed will follow the duty cycle of the PWM signal which is proportional to the light 3- The touch switch is used to change the motor direction, RV direction while touching. 4- The temperature sensor reading about (218-240) is used to turn on/off the SSR using absolute values, basically if the temperature is higher than the roomtemp * 1.2, it will turn the LED on. For now, you will control an LED (on port 2.0) instead of the SSR. Please do not assemble/use the SSR/AC line circuit until I show you how to do it in the lab. 5. At the board start-up or reset, the micro reads the room temp/light/touch and saves values as the "normal" room temp/light/touch (or baseline values) for use within the main infinite loop. 6- Please follow the exact layout on the bread board to make it easy for me to troubleshoot it for you. Midterm Changes Requirement Once you have your hardware perfectly running the skeleton code, please make the following changes for grade. Please make once little change at a time, and fully test it before you start another change. Please do not change you're your hardware connections while testing your software. If you have errors in both software and hardware, it will be impossible to fix multiple problems and it will cause lots of frustration. 1. Change the temperature code so that if the temperature increases by 2% from the baseline (that is temproom * 1.2), the SSR turns on, and the temperature drops below temoproom *1.1, the SSR will turn off 2- The touch switch code must be changed so that every time you touch the switch, the motor direction toggles and stays the same till next touch. When you un-touch, nothing happens. 3- Change the code of motor control so that when the light intensity (the PWM value) is higher than 80%, then turn the motor fully on. And when you block the light by hand, that is when the PWM value is less than say 20% the motor should stop. These are the basic changes you need to make to the skeleton code to get the full grade of he midterm. Only after we completely finish with the Midterm we will talk about the final term project

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Accounting questions