A laboratory data logger built around a microcontroller shows three separate problems
PHYSICS · Multi-part · Fermi University Physics · Electronics, Instrumentation & Communication · Digital electronics, embedded systems and data acquisition · Digital electronics, embedded systems and data acquisition
Electronics for Measurement, Ch The microcontroller as laboratory hardware
Problem
A laboratory data logger built around a microcontroller shows three separate problems, each explained by a different member of the team.
((a)) The photodiode channel is sampled by a software loop intended to run at 5kHz (200μs nominal interval). Over 10000 samples the measured mean interval is exactly 200.0μs, yet the digitised waveform shows small residual scatter about the expected sine. One team member says: "the mean interval is exactly right, so the sampling must be uniform and the scatter must come from somewhere else." Say what is wrong with this claim.
((b)) The same channel is also serviced by a timer interrupt that starts an SD-card write, with a latency of 4μs, a critical section of 60μs while the buffer is written, and one competing interrupt that can delay it by 6μs. The record shows occasional gaps of up to 70μs timed to the SD-card writes, but the designer calculated an "average" response time of 10μs (latency plus a typical, not worst-case, critical section) and concluded this was safe against the 200μs sampling interval. Say what is wrong with this reasoning, give the correct worst-case figure, and say whether it still fits within the 200μs interval.
((c)) A humidity sensor is read over a 3.3V I2C bus with a 2.2kΩ pull-up, clocked at 400kHz (maximum allowed 30 to 70 per cent rise time 0.30μs). With a short cable the bus capacitance is 100pF and readings are reliable. Extending the cable raises the bus capacitance to 350pF and the readings become unreliable. A team member says: "the bus rate is set in software, so the cable length cannot be the cause." Say what is wrong with this claim, and support it with the rise time 0.85RC for both cable lengths.