GPIO - Using DS18B20 thermometer


  • Ameba x 1
  • DS18B20 x 1


DS18B20 is a digital thermometer which measures temperatures from -55°C to +125°C, and provides ±0.5°C accuracy from -10°C to +85°C. DS18B20 1-Wire interface which requires only one port
pin for communication, and the data input/output is handled in microseconds scale.

Ameba uses OneWire library ( ) with slight modification to control DS18B20. Please download the modified OneWire library:
Please refer to Arduino official tutorial to add .zip library to Ameba:

Wiring diagram:

Open the example in “File” -> “Examples” -> “AmebaOneWire” -> “DS18x20_Temperature”, compile and upload to ameba.

Press the reset button, and observe the serial monitor:

Code Reference

Related API documentation of OneWire library can be found in OneWire official site:

Please confirm that QQ communication software is installed