Analog I/O

The XMEGA-B1 Xplained offers two sensors, a temperature sensor and a light sensor. In single-ended mode it can also measure two analog inputs, one from the on-board potentiometer and one from a source that is external to the board.

Temperature Sensor

The temperature sensor is made with a NTC resistor connected to PORTB on PB0. The output range on the network included the NTC is 0V – 1.1V (or 0V – 1/3VTG).NTC reference: NCP18WF104J03RB

Figure 1. NTC sensor – PB0 Input voltage vs. temperature

The NTC range is -40°C to +125°C and the input voltage range is 1.047 V -  0.077 V for VTG = 3.3V.

Table 1. NTC characteristics
Temp (°C) Value (kΩ) Temp (°C) Value (kΩ) Temp (°C) Value (kΩ) Temp (°C) Value (kΩ)
-30 2197.225 0 357.012 30 79.222 60 22.224
-29 2055.558 1 338.006 31 75.675 61 21.374
-28 1923.932 2 320.122 32 72.306 62 20.561
-27 1801.573 3 303.287 33 69.104 63 19.782
-26 1687.773 4 287.434 34 66.061 64 19.036
-25 1581.881 5 272.500 35 63.167 65 18.323
-24 1483.100 6 258.426 36 60.415 66 17.640
-23 1391.113 7 245.160 37 57.797 67 16.986
-22 1305.413 8 232.649 38 55.306 68 16.360
-21 1225.531 9 220.847 39 52.934 69 15.760
-20 1151.037 10 209.710 40 50.677 70 15.184
-19 1081.535 11 199.196 41 48.528 71 14.631
-18 1016.661 12 189.258 42 46.482 72 14.101
-17 956.080 13 179.890 43 44.533 73 13.592
-16 899.481 14 171.028 44 42.675 74 13.104
-15 846.579 15 162.651 45 40.904 75 12.635
-14 797.111 16 154.726 46 39.213 76 12.187
-13 750.834 17 147.232 47 37.601 77 11.757
-12 707.524 18 140.142 48 36.063 78 11.344
-11 666.972 19 133.432 49 34.595 79 10.947
-10 628.988 20 127.080 50 33.195 80 10.566
-9 593.342 21 121.066 51 31.859 81 10.200
-8 559.931 22 115.368 52 30.584 82 9.848
-7 528.602 23 109.970 53 29.366 83 9.510
-6 499.212 24 104.852 54 28.203 84 9.185
-5 471.632 25 100.000 55 27.091 85 8.873
-4 445.772 26 95.398 56 26.028 86 8.572
-3 421.480 27 91.032 57 25.013 87 8.283
-2 398.652 28 86.889 58 24.042 88 8.006
-1 377.193 29 82.956 59 23.113 89 7.738
Temp (°C) Value (kΩ) Temp (°C) Value (kΩ) Temp (°C) Value (kΩ) Temp (°C) Value (kΩ)

Light Sensor

The light sensor is made with a Light Dependant Resistor (LDR) connected to PORTB on PB2. The output range on the network included the LDR is 0V – 1.1V (or 0V – 1/3×VTG).

When the light level is low, the resistance of the LDR is high and the input voltage is close to 1.1V (or 1/3×VTG).

Potentiometer voltage

An external voltage can be applied to the kit by using a header as shown in Figure 3‑1. This voltage is routed to pin PB3 on the XMEGA PORTB and can be measured with a single ended measurement of the ADC. However, the external voltage is divided down by 8 before it is applied to the ADC, this divider is fixed.

External voltage input

The output of the on-board potentiometer can be measured on PORTB on PB1 as single ended. The input range is 0V – 0.666V (or 0V – 1/5×VTG).

Note:

A 2.0 V zener diode is mounted in parallel with the ADC input. This protects the ADC input from any overvoltage. That effectively means that an external voltage is allowed between 0V-16V on the premises that VTG is greater than 2.0 V.

Attention:

If VTG is lower than 2.0 V, the ADC input is not protected and the External Voltage Input must be on the range 0V – 8 ×VTG. Otherwise, the device may be damaged.