Utilities Programming Guide
Development website
  • Initial page
  • Introduction
  • USB Library
  • Utilities Library
  • Input/Output pins
  • Getting Free RAM
  • Reading basic sensors
  • Waspmote Stack EEPROM
  • Code examples and extended information
  • API changelog
Powered by GitBook
On this page

Was this helpful?

Reading basic sensors

PreviousGetting Free RAMNextWaspmote Stack EEPROM

Last updated 4 years ago

Was this helpful?

There are some basic sensors that can be plugged directly to Waspmote except for the light sensor which needs some hardware modifications.

DS18B20 Temperature Sensor

This temperature sensor also needs a simple hardware modification to be directly plugged to Waspmote. Three pins come out of the sensor: Red (3V3), Black (GND) and White (Output pin). A 4K7 resistor must be connected between the red and white pins. The sensor output can be plugged in any Waspmote digital pin. When reading the sensor the output pin is selected as input parameter:

Example of use:

{
    // temperature sensor plugged to DIGITAL8 pin
    float temp;
    temp = Utils.readTempDS1820(DIGITAL8);
}

Reading DS18B20 temperature sensor example:

http://www.development.libelium.com/bs-05-reading-ds18b20