> [AD Class Reference](https://obniz.github.io/obniz/obnizjs/classes/obnizcore.components.peripheralad.html)
> [AD API Reference](/reference/websocket/ad)

AD reads analog voltage applied on each io. Usage example is reading brightness from light sensor which output light level as voltage.

[ad.getWait()](https://obniz.github.io/obniz/obnizjs/classes/obnizcore.components.peripheralad.html#getwait) return current voltage once like io.inputWait(). ad0 means ad for io0. Normally, ad is not available on each io. Please refer to device detail.

```javascript
// Javascript Example
var voltage = await obniz.ad0.getWait();

```

Measurable voltage range depends on device. obniz Board series measure 0 to 5v(vcc). And

[ad.start()](https://obniz.github.io/obniz/obnizjs/classes/obnizcore.components.peripheralad.html#start) function start monitoring and receive voltage changes.

```javascript
// Javascript Example

obniz.ad0.start(function(voltage){
 console.log("changed to "+voltage+" v")
});

```

Frequency depends on network speed. But Maximum is 30 Samples/sec.

## About obniz Board Series AD

obniz Board series has specially designed AD circuit.

AD is independent. It also works while IO is used for another function.

![](images/ad_0.png)

AD also monitors vdd of obniz Board itself(normally 5v). Each ad result will be calibrated regarding below.

| obnizOS version | calibration method     |
| --------------- | ---------------------- |
| under 1.2       | Always                 |
| 1.2 or higher   | Only Vdd is under 4.5v |





