Jump to content

Search the Community

Showing results for tags 'dht11'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 9 results

  1. I have been trying to interface DHT11 sensor with MSP430G2553. But I always end up getting a checksum error. I have attched the code and the library I am using. My sensor is the normal one with 4 pins coming out of it. I connect pin1 to Vcc(3.3V), pin2 to data pin(P1_3) and pin4 to GND. Please help. #include <dht.h> dht DHT; #define DHT11_PIN 5 void setup() { Serial.begin(9600); Serial.println("DHT TEST PROGRAM "); Serial.print("LIBRARY VERSION: "); Serial.println(DHT_LIB_VERSION); Serial.println(); Serial.println("Type,\tstatus,\tHumidity (%),\tTemperature (C)"); } void loop() { // READ DATA Serial.print("DHT11, \t"); int chk = DHT.read11(DHT11_PIN); switch (chk) { case DHTLIB_OK: Serial.print("OK,\t"); break; case DHTLIB_ERROR_CHECKSUM: Serial.print("Checksum error,\t"); break; case DHTLIB_ERROR_TIMEOUT: Serial.print("Time out error,\t"); break; default: Serial.print("Unknown error,\t"); break; } // DISPLAY DATA Serial.print(DHT.humidity, 1); Serial.print(",\t"); Serial.println(DHT.temperature, 1); delay(2000); } // // END OF FILE dht.zip
  2. albertRM

    Readding DHT11

    Hi all i'm programming by MSP430fr5739 a temperature and humidity reading by the DHT11 sensor. ?The wire are correct, and so the problem is'nt in the link, it is in the code. This is my code, usind the dht11 library, find on internet. ?The main problem is that i don't know how to read the value of T and H, and maybe there is some problems in the reading (probably in the interrupt) ?Thanks for the advice. ?MAIN CODE: #include <msp430.h> #include <DHT11_LIB.h> unsigned char RH_byte1; unsigned char RH_byte2; unsigned char T_byte1; unsigned char T_byte2; unsigned char checksum; unsigned char Packet[5]; unsigned char volatile TOUT; unsigned char volatile SECOND_TIMER=0; void init(void); #pragma vector = TIMER0_A0_VECTOR __interrupt void CCR0_ISR(void){ SECOND_TIMER++; TOUT=1; //TOG (P1OUT,0x01); per il led CLR (TA0CCTL0, CCIFG); } void init(){ WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer PJDIR = BIT1+BIT2+BIT3; // Set LED to output direction PJOUT = BIT1; //high the LED PJOUT = BIT2; //Set clock and timer CSCTL1 = BIT1+BIT2 ; // DCO a 8MHz CSCTL2= SELS_3; // SMCLK take DCOCLK TA0CCR0 = 50000; // Initialize the timer to count at 20Hz TA0CTL = TAIE_1; // Enable interrupt TA0CTL = TASSEL_2 + ID_3 + MC_1+ TACLR ; // SMCLK, div 8, up mode, e fa il clear _enable_interrupt(); //Enable global interrupt } void main(void) { init(); while(1){ //Must wait 1 second initially and between all reads if(SECOND_TIMER >= 5){ TOG (PJOUT,BIT1); // Simple way to gather all data with one instruction read_Packet(Packet); RH_byte1 = Packet[0]; RH_byte2 = Packet[1]; T_byte1 = Packet[2]; T_byte2 = Packet[3]; checksum = Packet[4]; if (check_Checksum(Packet)) SET (PJOUT, BIT1); //Se il checksum giusto si riaccende SET (TA0CTL, TACLR); SET (TA0CTL, 0x10); //Up mode TA0CCR0 = 50000; //Initialize the timer to count at 5Hz SECOND_TIMER = 0; //Clear counter } } } DHT11 LIBRARY: #ifndef DHT11_LIB_H_ #define DHT11_LIB_H_ #define TST(x,y) (x & (y)) #define SET(x,y) (x|= (y)) #define CLR(x,y) (x &= ~(y)) #define TOG(x,y) (x ^= (y)) #define DPIN BIT0 extern unsigned char volatile TOUT; void start_Signal(void); void start_Signal(){ SET(P2DIR, DPIN); // Set Data pin to output direction CLR(P2OUT,DPIN); // Set output to low __delay_cycles(25000); // Low for at least 18ms SET(P2OUT,DPIN); //HIGH __delay_cycles(30); // High for at 20us-40us CLR(P2DIR,DPIN); // Mette il pin in ricezione (Input) } unsigned char check_Response(void); unsigned char check_Response(){ TOUT=0; SET(TA0CTL,TACLR); //Reset timer to 0; TA0CCR0 = 100; //Set timer to overflow in 100uS. SET(TA0CTL,CCIE); //And enable timer interrupt while(!(TST(P2IN,DPIN)) && !TOUT); //while if IN=0 if (TOUT) return 0; else { SET(TA0CTL,TACLR); SET(TA0CTL,CCIE); while((TST(P2IN,DPIN)) && !TOUT); if(TOUT) return 0; else{ CLR(TA0CTL,CCIE); // Disable timer interrupt return 1; } } } unsigned char read_Byte(void); unsigned char read_Byte(){ TOUT = 0; unsigned char num = 0; unsigned char i; CLR(TA0CTL,CCIE); for (i=8; i>0; i--){ while(!(TST(P2IN,DPIN))); //wait the hing signal SET(TA0CTL,TACLR); // clear SET(TA0CTL,0x10); //Up mode (Mode control 01b) SET(TA0CTL,CCIE); //enable interrupt while(TST(P2IN,DPIN)); //wait the low signal CLR(TA0CTL,0x30); //held counter if (TA0R > 0x28) //TA0R
  3. albertRM

    How read DHT11

    Hello everyone, I just started programming in C ++ to solve a small university project. I am a newbie in programming that's why I ask you a hand in writing the code. I'm working with Msp430fr5739 and the temperature and humidity sensor is the DHT11. The connections have already been made and we have to write the code. I already have the library DHT11 and I'm working in CCS. Can someone share a code that works and allows me to read the values of temperature and humidity? Thank you (and sorry for my english)
  4. A library for reading dht sensors (temperature and humidity). Since dht sensors are pretty slow, I have used highlevel functions in the lib, there should be plenty of cycles even at 1MHz, but I have only tested it on the CC3200 sofar. Easy example, other functions are available for getting the raw values instead of float. if (dht::readFloatData(2, &temperature, &humidity, true) == 0) { Serial.print("T: "); Serial.print(temperature); Serial.print(" H: "); Serial.println(humidity); } Zip file included, source code lives at https://github.com/MORA99/Stokerbot/tree/master/Libraries/dht Note: This lib requires working micros, delayMicroseconds and pulseIn functions, if you are using it on CC3200 you may need to patch your Energia installation. dht.zip
  5. Hi All, Somehow I've made a stupid mistake with this weather thingie I put together and I can't figure out what's wrong. I need your help! Project description: Weather thingie - Reports temperature, humidity and light readings via bluetooth. Operation is simple, connect to the device and it will report something like "27 C 57 H 96 L\r\n" ~ every second. The LED on board will alternate state every second. I set this up on a breadboard before making the PCB as I was not familiar with the DHT11 or and quirky requirements it might have. The project worked fine on the breadboard. I suspect I have either a PCB design fault or defective components? Perhaps? I dunno. TIA 0xFFFF main.c
  6. SureshBonagiri

    DHT11 sensor reading under timer ISR

    Hi all, I am facing problem while reading DHT values in timer ISR function. I am able to get the data if use i dht.readHumidity() (using dht library) in loop function but not able to get when i use in timer ISR function. Can anyone please help me out. Thanks in Advance.
  7. Hey guys, I am trying to work with this library: http://forum.43oh.com/topic/2239-solved-dht22-temp-rh-one-wire-sensor-on-energia/?p=19474 To my knowledge, everything is configured correctly. I have confirmed that the device does work fine on an Arduino Uno with this resistor, 10k. I have also confirmed that it works with a 4.7k. It also works with both 3.3v and 5v. However, on the MSP430, using the above library (stock) the values I am getting are very wrong, for example: debug bits received 40 debug 27, 0, 11, 0, 38 =? 38 debug checksum ok debug RH% 9984 debug oC 4352 RH% 998.4 % oC 435.2 *C This is in a room ~62F % 40% RH. If I touch or blow on the sensor the values change as you would imagine, so I know that it is reading something and reporting changes properly. I have looked through the code and nothing glaringly obvious sticks out at me. I know I could measure a few reference values and add in a few calculations to adjust the output, but I would rather fix the root of the issue. I understand the library was written for the DHT22 and I am using the DHT11, but they should be drop-in replacements for one another, the DHT22 just being more sensitive. Again, I have used this unit with a DHT22 library on Arduino. I would greatly appreciate any help! I have researched this for a while but have found nothing - it's possible that I'm just not using the right terms, however. Thank you!
  8. Hello, sorry I'm totally beginner working with Stellaris less than a week so probably those questions will be silly but: I saw a project "Using Stellaris LaunchPad as a Thermometer" I wonder is it possible (and if yes how ?) to port to Energia ? Is there any ready library for DHT11 working with LM4F120 ? I saw this only for MSP430. Thank You Mic
  9. Using the DHT Lib and an LCD I am about to get correct values to display on the LCD for between 2 seconds and 10 seconds, then the characters disappear. In the DHT library I had to change return NAN to either return 0 or return ERR to get it to work. I also had to change cli() and sei() to noInterrupts() and interrupts() respectively. I am controlling the contrast on the LCD using PWM fed through a capacitor. I am using the MSP430g2452 chip in a Rev 1.5 Launchpad. (I am at work at the moment, or I would post all the code.) My question is pretty simple: In setup(), I have something like - pinMode(14, OUTPUT); analogWrite(14, 90); Since I am doing the contrast control in the setup function, and not the loop, could something to do with the noInterrupts() be disabling the PWM doing the contrast control? I would just check this when I get home, but I am stuck here for another 3 hours...and it is driving me NUTS :-)
×