I am trying to interface a Temperature sensor to RuggedBoard. The sensor I have selected is DHT11 (https://image.dfrobot.com/image/data/KIT0003/DHT11%20datasheet.pdf).
As per the datasheet of phyCORE-i.MX 6UL I can see that there is an ADC pin from the SOM which is 12bit and threshold voltage of 3.3V. (Correct me if I am wrong)
Can you please share with me the ways I can interface the sensor and get the correct temperature reading. (A sample code in GitHub will be very helpful)
--
Thanks in advance
Ashraful
Hello, Hope your doing well, I have experimented and found that we cannot interface some local sensors to This rugged board, like in my case i tried to interface DHT11 sensor to board was not successful i learnt that it to lengthy procedure to interface DHT as it uses serial communication using MRAA Libary, instead we can use python programming and add few packages this will make a easy path to developers,
Hi...i would recommend you to check the data sheet where it has been mentioned in details about interfacing. Based on my knowledge the Ethernet Media Access Controller (MAC) is designed to support 10/100 Mbit/s Ethernet/IEEE 802.3 networks. An external transceiver interface and transceiver function are required to complete the interface to the media. The module has dedicated hardware to support the IEEE 1588 standard.
pcb manufacturing
Sir have a doubt: i am using p10 expansion header pin no 12( pd19/pck0/twd1/ad0) cant we use these pins. And i have writen a code cant that code be used
Thanks for asking this question. As mentioned in the schematic of RB-i.MX 6UL, The P6 expansion connector is having the ADC pin at pin number 27, VCC 3V3 at pin number 1 and GROUND at pin number 36.
On the DHT11 sensor, We are having 3 pins and there are a label i.e (-) and (s) symbols beside the 3 pins. The pin which is beside to (-) is connected to GRND , the second pin is connected to VCC_3V3 and the pin beside to (s) is signal pin and it is connected to ADC pin i.e 27th pin in P6 expansion connector. Just go through the code as mentioned below.
Compile the code using ARM toolchain SDK and run the binary in the board
Code:
#include<stdio.h> #include<unistd.h> #include<err.h> #include<string.h> #include<stdlib.h> int main() { int in,rd; int i; float a,t; int k; char buff[100]; in=open("/sys/bus/iio/devices/iio\:device0/in_voltage1_raw",0666); if(in==-1) printf("error in opening file"); else printf("opened successfully\n"); while(1) { rd=read(in,buff,32); k=atoi(buff); //ASCII to integer conversion a=((float)(3.3 * k)/4095); t=((float)(a * 50)/3.3); printf("%f celsius\n",t); } close(in); return 0; }
Output_log:
root@phyboard-segin-imx6ul-2:~# ./adc1 opened successfully 28.547010 celsius