Phone: +86-20-8520 1025       Email: SALES@FRIENDLYARM.COM / techsupport@friendlyarm.com Forum    Wiki

  • Shopping Cart
  • Login
  • Register
  • CPU Module
  • Mini Board
    • Cortex-A9(Quad-Core)
    • Cortex-A8
    • ARM11
    • ARM9
  • NanoPC & NanoPi
  • Hats & Docks
  • Enclosure & Holder
    • 3D Printed
    • Acrylic
    • Metal
    • Plastic
  • Matrix Accessories
    • Actuator
    • Camera
    • Communication
    • Display
    • GPS
    • Heat Sink
    • Power
    • Sensor
    • Serial Comm Board
    • SSD/MicroSD
    • Others
  • BakeBit Sensors/Modules
  • LCD Module
  • Value Pack & Kit
FriendlyElec

Login | Register

  • Home
  • Downloads
  • Forum
  • Wiki
  • Information
    • About Us
    • Privacy Policy
    • Terms & Conditions
  • Distributor
  • FreeBoard
Temperature Sensor TPM-01 Temperature Sensor TPM-01 Temperature Sensor TPM-01 Temperature Sensor TPM-01
Temperature Sensor TPM-01

Temperature Sensor TPM-01

0 reviews / Write a review
  • $99,999.00
(USD)
Buyer responsible for payment of duty.
  • Availability: Out Of Stock

  • Brand: FriendlyElec
  • Product Code: TPM-01


  • Description
  • Reviews (0)

1 Introduction

We utilitze the DS18B20 in this module. The DS18B20 can be powered from its data line. Each DS18B20 is assigned a unique ID. Its temperature range is -55 degree Celsius to +125 degree Celsius. The thermometer resolution is programmable from 9 to 12 bits. When the measured temperature is between -10 degree Celsius to +85 degree Celsius the accuracy can be at 0.5 degree. It uses the unique 1-wire interface which requires only one port pin for communication. Among all three DS18B20 pins V is power, G is ground and S is data.

2 Features

  • -55 degree Celsius to +125 degree Celsius
  • One wire interface for communication
  • Tiny, easy to be used in various situations
  • 2.54mm spacing pin

3 How To

  • Connect to Tiny4412 SDK (1506)

    GND: Ground

    VCC: 5V

    S: GPIO_PIN1

Code Sample in C Under Linux

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "libfahw.h"
 void parseCmd(int argc, char **argv, int *pin)
{
int num = atoi(argv[1]);
switch(num) {
case 1:
*pin = TINY4412_GPIO_PIN1;
break;
case 2:
*pin = TINY4412_GPIO_PIN2;
break;
case 3:
*pin = TINY4412_GPIO_PIN3;
break;
case 4:
*pin = TINY4412_GPIO_PIN4;
break;
case 5:
*pin = TINY4412_GPIO_PIN5;
break;
case 6:
*pin = TINY4412_GPIO_PIN6;
break;
case 7:
*pin = TINY4412_GPIO_PIN7;
break;
case 8:
*pin = TINY4412_GPIO_PIN8;
break;
case 9:
*pin = TINY4412_GPIO_PIN9;
break;
case 10:
*pin = TINY4412_GPIO_PIN10;
break;
default:
printf("Unsupported pin TINY4412_GPIO_PIN%d ", num);
num = 1;
*pin = TINY4412_GPIO_PIN1;
break;
}
printf("Using pin TINY4412_GPIO_PIN%d ", num);
}
 int main(int argc, char ** argv)
{
int devFD = -1;
int pin = TINY4412_GPIO_PIN1;
char *temperature = (char *) malloc(
32);
memset(temperature, 0, 32);
  if (argc == 2) {
parseCmd(argc, argv, &pin);
} else {
printf("Using default pin TINY4412_GPIO_PIN1 ");
}
  if ((devFD = ds18b20Init(pin)) == -1) {
printf("Fail to init ds18b20 ");
return -1;
}
if (ds18b20Read(temperature) > 0) {
printf("Temperature = %s ", temperature);
} else {
printf("Fail to get temperature ");
}
free(temperature);
ds18b20DeInit(devFD);
return 0;
}

Compile and Run

git clone http://github.com/friendlyarm/fa-hardware.git
cd fa-hardware
cd demo
cd matrix-temperature_sensor
make

Copy your compiled bin to your board and you are ready to go.

Resources


Write a review

Write a review

Note: HTML is not translated!
    Bad           Good


Power & Source of Big Ideas

Follow us
  •  
  •  
  •  
  •  
  •  
  •  
  •  
Newsletter

New in alerts - Sign up to our Newsletter.

Contact Us
  • Room 118,Building A, Shilian Technology Park, No.33 Science Road,Science City,Luogang District, Guangzhou,GuangDong China
  • +86-20-8520 1025
  • sales@friendlyarm.com
  • techsupport@friendlyarm.com
Information
  • About Us
  • Downloads
  • Privacy Policy
  • Terms&Conditions
  • Distributor
  • FreeBoard
Customer Service
  • Contact Us
  • Returns
  • Site Map
My Account
  • My Account
  • Order History
  • Wish List
  • Newsletter


Copyright © 2008-2025 friendlyelec.com All rights reserved.
Top
Categories
  • CPU Module (14)
  • Mini Board (3)
  • NanoPC & NanoPi (35)
  • Hats & Docks (12)
  • Enclosure & Holder (16)
  • BakeBit Sensors/Modules (2)
  • Matrix Accessories (74)
  • LCD Module (16)
  • Value Pack & Kit (11)