Hardware Reference
In-Depth Information
Verifying the Code
Once everything is uploaded and set up, plug in the USB from the computer to the reader Arduino and start the serial
monitor. The reader will print what it receives off the analog pin and print the voltage, the degrees Celsius, and the
Fahrenheit conversion. The sensor Arduino will output from 0V to ~5V at ~0.02V per step, or approximately −50°C to
450°C at 2C° per step.
Resistor Ladder
The resistor ladder, or R-R2 ladder, offers the other method to give an Arduino analog out. It uses 20 resistors, with 9
being one value and the other 11 being twice that value. An R-R2 ladder is essentially a network of voltage dividers.
This method works by chaining many digital inputs to one output by successively changing voltage across different
sets of resistors. This is a parallel binary method of controlling the output voltage. The lowest significant bit is the
input closest to the ground resistor, and the highest significant bit is on the opposite end of the chain connected to the
output. Figure 6-2 demonstrates a schematic of the resistor ladder, in which Vin 0 is the lowest significant bit and will
have the smallest voltage change when it is in a high state. You can expand a resistor ladder to any bit resolution by
adding extra Vin n+1 units to the end of the ladder.
Figure 6-2. R-R2 ladder schematic
The resistor values used can be arbitrary, as long as one value is twice the value of the other and not so great as to
affect the final output. Decent values to start with are 1kW and 470W. With a stack of 5% resistors and a good voltmeter,
it is possible to get a good 2:1 ratio with these resistors. You can make an R-R2 ladder scalable to any bit precision by
adding or removing two resistors from the chain.
For this example, a 10-bit converter will be made to match the resolution of the Arduino's ADC. Then the code
will implement a 10-bit binary counter to control the constructed DAC. The resistor values will be referred to as 1R for
the lower-value resistors and 2R for the ones of twice that value.
To get set up refer to Figure 6-3 , start with one 2R and connect one end to ground and the other end to another
terminal strip on the same side of the board. Then from that terminal strip in a continuing pattern down that side of
the board place the nine 1R connecting, the last one to analog pin 0 on the reader Arduino. The remaining ten 2Rs
have one end placed at all the junctions of the 1R and the other end connected to sensor Arduino pins starting from
pin 2 to pin 11 in order from the resistor closest to the ground 2R. The other remaining connections are the 5V and
ground pins between the Arduinos. The code for the reader is the same as loaded for the RC low-pass filter.
 
Search WWH ::




Custom Search