Search for question
Question

Supposed you are tasked to build a simple carbon monoxide sensor that functions in the following way:

1. Measure the CO2 sensor, which gives an analog output of 0 to 1.0V

2. A value of more than 0.5V represents a dangerous level of CO2 (0.0V means no CO2)

3. In the case of a dangerous condition, an alert must be given in the form of illuminating an

external LED connected to any GPIO pin.

4. The sampling rate of the sensor must be 1kHz.

5. Use must use an ATTINY84 Microcontroller, which is also an 8-bit AVR processor similar (but

different) to our 32u4 (datasheet attached).

1. Take a few minutes to review the datasheet to familiarize yourself with the available GPIO pins,

available timers, and ADC setup. Review the address mappings in section 22 as well. For this part of

the exam, you can not use known registers like PORTB etc. You must use unsigned char pointers to

the correct addresses.

2. Write a function called void SetupTimer() that sets up any timer to function as a 1kHz timer (no

PWM generation, no pins connected). The timer should reset every 1ms. Be sure to set up the

appropriate registers in section 11.9 of the datasheet.

3. Write a function called void SetupLED() which sets up the selected GPIO pin (you can select any

appropriate pin) for the LED alert.

4. Write a function called void SetupADC() which sets up the ADC to the appropriate MUX channel (you

can choose any one you want). Set up the ADC to use a prescaler of 16, and use your timer overflow

as an Auto Trigger Source for the ADC. See section 16.13.4 (Table 16.7)

5. Write the setup function that calls your functions described above.

6. Write the loop function that reads the ADC and performs the logic to illuminate the LED

appropriately. Don't make the LED flicker if the ADC hovers around 0.5V!

7. Sketch the schematic that shows which pins you used and the interconnect diagram of the LED,

ATTINY, and the CO2 sensor.

8. Now, using Platform IO, start a new project and use the board "Generic ATTINY84". Import the code

you developed in 1. through 7., but now you can use the defined registers like PORTA etc. Submit

the .cpp file with your code.


Most Viewed Questions Of Embedded System

5. A ferromagnetic core with a constant relative permeability of 1500 is shown in the following figure. The core depth is 9 cm, and all dimensions are as shown in the figure.The air gap length on the leftmost column of the core is 0.5 cm. Because of the fringing effect, the effective area of the air gaps is 4 percent larger than its physical size. If there are400 turns in the coil wrapped around the center leg of the core, - Draw the magnetic equivalent circuit of the system. ) Find 4, l2, l3, l4, l5, l6, and l7 in meters. ) Find cross-sectional areas in each section of the core in m² and name them as A1, A2,A3, A4, A5, As, A, , as well as Aag for the air gap considering the fringing effects. d) Find all reluctances in the equivalent circuit. Calculate equivalent reluctance seen from the coil. Calculate the inductance of the coil. (


3. Using PSPICE (or alternate) Build a CMOS inverter as in the figure. Set up a DC sweep simulation that sweeps Vin from 0 to 5 V in 0.05 V increments. Run the simulation. If everything was set up correctly,the voltage transfer characteristic (VTC) should be plotted.


1) What is Abstraction? What is the difference between Abstractions and mislead or alter important information? What is complexity and how do we deal with it. Please provide examples.


For 27th when it is 10:30 AM LT (Clock time),answer the following questions. 1. What is the geographical position (coordinates) of KC? (Points 3) 2. What is the difference of the Local Time (LT) from Greenwich Mean Time (GMT) in hours for KC? 3. Calculate LSTM for KC. 4. Calculate Equation of Time (EoT). 5. Calculate time correction factor. 6. Calculate local solar time. 7. Calculate hour angle for this time.


Design an air core inductor with an inductance value of 84 nH. Use a copper wire of 0.050 inch diameter wound on a core diameter or0.100 inch. Determine the number of turns required assuming a tight spaced winding.


An AM modulation process uses a carrier frequency of 100kHz. Suppose that the modulated signal is used to modulate a 200kHz carrier. Find the frequencies of the demodulation process that can be used to recover the original signal.


0. Using the inductor from Problem 8, determine the self resonant frequency of the inductor and comment on the maximum frequency in which the inductor may be used in a tuned circuit application.


Model a chip resistor (size 0603) with a resistance of 50S in ADS.Consider an application in which 502 impedance must be maintained with +10%. Create a linear analysis and determine the maximum usable frequency of the chip resistor.


On Figure P4a, you have a Common Emitter (CE) NPN BJT amplifier. Notice (unlike the circuits that we have studied in class) the absence of a source resistor R sig and load resistor R,. If we know how this L·amplifier behaves without Rsig and R, we can infer its behaviors if Rsig and R, were to be added. You are to design the amplifier circuit on Figure P4a, i.e., find appropriate values for RB,, RB,, Rc,and R.Such that the voltage gain of the ampliifier You are to design the amplifier circuit on Figure P4a, i.e., find appropriate values for RB,, RB,, Rc,and RE, such that the voltage gain of the amplifier \left|\boldsymbol{A}_{\boldsymbol{v}}\right|=\left|\frac{\boldsymbol{v}_{\boldsymbol{p a t}}}{\boldsymbol{v}_{\boldsymbol{s} \boldsymbol{q}_{g}}}\right| \geq \mathbf{2} \mathbf{V} / \mathbf{v}


Design an AC/DC power supply to meet a set of specifications given below: Specifications: The output load current is 100 mA while the output voltage is to remain V out =12 V and produce an output with a ripple of not more than 3%. Use cut-in voltage for VD1,VD2, VD3, VD4 as 0.7 V. Design Approach: The circuit configuration to be designed followed was discussed in class.A diode bridge circuit with an RC filter and a Zener diode will be in parallel with the output load are used. Choices: An AC input voltage with an rms value of Vin = 110 V at 60 Hz is available. A Zener diode with a Zener voltage of Vzo= 12 V and a Zener resistance of r 2 that can operate over a current range of 10 <Iz< 100 mA is available.Also, chose your own transformer (you should specify the number if turns in the primary and secondary coils of the transformer). a) Show the complete circuit of the AC/DC converter and label all components b) Calculate all relevant parameters in the AC/DC power supply. Show all calculations of the relevant parameters (R, C, Np, Ns, Vs, Rin, VDI, VD2, VD3, VD4, Iz, IL, Vr, IDavg, IDpeak, PIV...)