4180T1F23s

pdf

School

Georgia Institute Of Technology *

*We aren’t endorsed by this school

Course

4180

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

4

Uploaded by DeaconCrown13278

Report
Score: _____________ Name:___________________________________________ EE 4180 Test I Test is open book and notes. No electronic devices. Place all answers in the spaces provided. 1. (4%) In software, if the mbed AnalogIn function returns 0.25 the external voltage at the pin is (number only) ______________ 3.3*0.25 = 0.825 __________________ 2. (4%) AnalogOut normally uses a float argument from 0.0 to 1.0 by default. What AnalogOut member function can be used to output a scaled integer argument that would be a bit faster since no automatic float to integer conversion and scaling is required to send out each sample value to the D/A hardware register? (name only) ______________ write_u16 __________________ 3. (4%) This is the most common name for the hardware unit found on some processors that generates an interrupt when power supply voltage levels drop too low and allows code to put hardware in a safe state. (two words) _______________ brown out detection circuit _________________ 4. (4%) This common C language feature can be used to directly and very efficiently access the ARM RISC 32-bit I/O registers. It is used inside the mbed API library C source code for the low-level I/O R/W operations and is also used for any I/O hardware devices that are not directly supported by mbed I/O APIs. _______________ pointer to a structure _______________________________ 5. (4%) What special type of logic output is used on the two I2C signal lines that always requires an external pullup resistor? ___________________ open collector _____________________ 6. (4%) What type of interface did the LIDAR use in the lab? __________________ I2C ______________ 7. (4%) If you see SDA and SCL pins in a chip’s datasheet, the device has this type of standard interface. ___________________ I2C _____________ 8. (4%) What is done in a USB cable to reduce noise on signals? _______ twisted pair wire with differential input _______________________ 9. (4%) This serial port standard requires both positive and negative voltage levels provided by a special voltage conversion circuit. ____________ RS232 ____________________ 10. (4%) At 115K baud, what is the minimum amount of time before the next ASCII character arrives? ________________ 1/11500 = 87 usec ________________ 11. (4%) If a small DC motor without a driver circuit has three large wire leads coming from the coils, it is most likely this type of DC motor. (one word) ________________ Brushless ________________ 12. (4%) How many power transistors are needed to control a typical stepper motor? (numeric value) ___________________ 8 _____________ 13. (4%) What is the common name of the electronic circuit modules or ICs that are intended to function just like older electromechanical relays. (acronym) ________________ SSR ________________ 14. (4%) A small red LED hooked up to a 5V logic output pin needs this additional part in series. (name only not value) _______________ resister _________________ 15. (4%) In addition to a microcontroller with PWM outputs, how many power transistors are needed in the special driver circuit used for small brushless DC motors. (numeric value) ________________ 6 ________________
Problem 17. ( 25% ) Write a complete mbed API C++ program for your hardware design on the previous page in the space provided below following the instructions and constraints provided on the last page of the test. #include "Motor.h" #include "mbed.h" AnalogIn Sensor(p15); Motor DC_motor(p21, p7, p8); // pwm, fwd, rev Serial blue(p28, p27); Ticker Auto; volatile bool Auto_mode = false; bool Open = false; void Auto_ISR() { if (Auto_mode) { if (Sensor > (2.4 / 3.3) && !Open) { DC_motor.speed(-1.0); wait(5); Open = 1; DC_motor.speed(0); } else if (Sensor < (1.2 / 3.3) && Open) { DC_motor.speed(1.0); wait(5); Open = 0; DC_motor.speed(0); } } } int main() { bool Auto_mode = false; bool Open = false; char bnum = 0; char bhit = 0; Auto.attach(&Auto_ISR, 10.0*60.0); while (1) { if (blue.readable()) { if (blue.getc() == '!') { if (blue.getc() == 'B') { // button data packet bnum = blue.getc(); // button number bhit = blue.getc(); // 1=hit, 0=release switch (bnum) { case '5': // button 5 up arrow if (bhit == '1') Auto_mode = !Auto_mode; break; case '7': // button 7 left arrow if (bhit == '1') DC_motor.speed(-1.0); else if(bhit == '0') DC_motor.speed(0.0); break; case '8': // button 8 right arrow if (bhit == '1')DC_motor.speed(1.0); else if(bhit=='0') DC_motor.speed(0.0); break; default: break; } } } } wait(1.0/20.0); } }
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Return this page with Test Name: ____________________________________________ Additional Details and Instructions for Problems 16 and 17 . Build a prototype of the electronics and software needed to remotely control a smart curtain robot using parts from your lab kit as needed using the mbed C++ APIs. It contains a 6V geared down brushed DC motor that clamps onto a curtain rod allowing it to traverse back and forth on the rod. The reversable motor can then open and close the curtain. It is remotely controlled from a phone using Bluetooth. 4-AA batteries inside the module provide power for the robot. An analog light sensor can also be used to automatically open the curtains during the day and close them at night. The Adafruit Bluefruit GUI app on a smartphone serves as the remote control to open and close the curtain manually and the GUI also can be used to enable/disable automatic operation using the light sensor. Additional Software Requirements (no RTOS!) Use the following function, variable, and object names in your mbed API C++ program solution to problem 17 Auto_ISR – The C callback function for light sensor automatic operation - activated by a hardware timer interrupt every 10 minutes Sensor – The input pin that reads the light sensor Blue – The serial port object DC_motor – The motor object Auto_mode – A global Boolean flag that is used to enable/disable automatic operation using the light sensor. Initialize to false. Open – A global Boolean flag that is used to save the state of the curtain in automatic mode only. Initialize to false. bnum – a character to hold the ASCII button number while decoding Bluetooth commands In the Auto_ISR function (that is run automatically once by a hardware timer every 10 minutes), if in automatic mode ( Auto_mode =1), read the light sensor otherwise exit. When the voltage is greater than 2.4V and not Open, run the motor forward for five seconds to open the drape and set Open . If the voltage is less than 1.5V and Open, run the motor in reverse for five seconds to close the drape and clear Open and then exit. (i.e., it needs a bit of Hysteresis to prevent the curtain from opening and closing near the light level change threshold level). For the test in automatic mode, just ignore manual control inputs during the 5 second delay needed to open or close the drape. In main, setup a hardware timer interrupt to run Auto_ISR once every ten minutes. Next in an infinite loop that runs no more than 20 times a second, check for any manual control Bluetooth input messages from the phone. First check to see if the first character of an incoming Bluetooth command is available to read. When no first character is available from the Bluetooth module, skip the Bluetooth message processing code and exit to the end of the loop. When a character is available, parse the Bluetooth command string using a case statement to decode the GUI buttons. Note that the motor runs until you release the two motor control GUI button, so you need to process both hit and release codes for these. For the test in the manual control mode loop, the checksum character can be ignored and just ignore the Open flag. Implement the following remote-control functions: Note: Process both hit and release button codes for manual motor operation. The checksum character should be ignored. GUI touch key ASCII String Smart Plug Function Up Arrow “!B51” Hit – toggle Auto_mode flag Left Arrow hit “!B71” Hit – Start running motor Forward Left Arrow Release “!B70” Release - Stop motor Right Arrow hit “!B81” Hit – Start running motor in Reverse Right Arrow Release “!B80” Release - Stop motor