Skip to content

Instantly share code, notes, and snippets.

@shawnkoon
Created November 3, 2016 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawnkoon/ca6a1c5a1ed516be855008213c0fb7b4 to your computer and use it in GitHub Desktop.
Save shawnkoon/ca6a1c5a1ed516be855008213c0fb7b4 to your computer and use it in GitHub Desktop.
1) For a 4-bit scaled-resistor DAC, with a contribution from each on-bit of 1V, and an 8R resistor = 8 Ohms with 10% precision: what is the worst case error, in Volts, of Vout, when the input is 0001, which should produce an output of -1 V / 8 = -0.125? Error is the absolute value of the difference between the expected output and the actual output. You may use the approximate error formula discussed in class.
2) What must the precision of the 4R resistor be in order to produce a voltage accuracy that is no worse than the above for an input of 0010? Show your calculations.
3) For a 6-bit SAR ADC, with an input range of 0 to 10V, show the sequence of successive approximations for a 3V input. Use the same table format shown in the lecture notes.
4) You’re the lone technology guy at a microbrewery startup and are designing an automated system to control the temperatures in the mash tun. Mashing is a steeping process wherein enzymes break down the starches in malted grain to form sugars, which will later be fermented. The “step mash” process will be used, which requires holding the grain and water mixture at various temperature steps for various periods of time. Your brew master wants to observe temperatures across the range of input water temp (60 deg F) up to the “mash out” temp (175 deg F), in 1 degree increments. After discussing the difference between resolution and accuracy it was determined that the brew master can live with an accuracy of +/- 0.7 deg F on the readouts. Note that your brew master wants to see Fahrenheit, but scientific instruments generally use Celsius. The temperature sensor you will be using produces an analog voltage according to the following graph (after calibration). The centerline gives the nominal response, and the surrounding lines show the possible error interval (from things like drift and nonlinearity).
In order to keep your interface circuits as simple as possible, you will not be applying any voltage gain or adding or subtracting any analog offset to the sensor prior to conversion. You would like to use 0V and 5V as the low and high references for your ADC (because those voltages are already available as your processor power). The error of your ADC is ±½ LSB (in addition to the quantization error). What is the minimum number of bits that your ADC needs to have in order to ensure that your digitized increments are at least as good as the increments and accuracy desired by the brew master?
5) Take a look at the Arduino analogReference() function. For a 5V Arduino Uno (using the
ATmega328), which setting is your best choice assuming you will use the internal ADC and do not wish to generate an external voltage reference? Which setting is your best choice for the Arduino Mega?
6) Given the power of the heaters and the volume of the mash, it has been determined that the fastest the mash tun can change temperature is 4 degF per minute. Assuming that each degree (Farenheit) of transition should be observed, and that you are using a built-in Arduino ADC with the 5V reference, how often should you obtain samples of the mash tun temperature? Use the approach discussed for the pressure vessel example in class.
7) If you use an Arduino with the 5V reference, how can you satisfy the mash tun requirements? Be specific about what you would do. That doesn’t mean you should give me code, but you need to clearly state how often you sample the ADC, what, if any, processing you do with the samples, and how you convert the readings to temperature, in deg F.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment