Dear all Programming Guru’s:
I am a final year undergraduate student from a University in South Africa. In order to complete my degree, I have one final project to complete – I need to create a system that counts the number of people in a test area, and the information thereof will be used as an input to a light dimmer for the test area.
I have elected to use a D6T thermal sensor to detect human presence, and the thermal information gathered will be used as an input to a Neural Network.
Now that you have some background info of the design task, I will present the problem I am currently facing: I can’t get the sensor to work, and I have no idea why.
Also, I should mention that I am part of a class of 255 students, and we were each randomly assigned a project, and no two projects are similar. So the project is not to “get the sensor working”, the scope is much bigger than that. Thus, if you are able to assist me with my current problem – don’t think that you are helping me cheat, or anything like that. Our study leaders have encouraged us to reach out to experienced professionals (such as yourselves) to ask for mentorship.
The other major problem is that I am extremely inexperienced when it comes to programming, as my discipline of study is “Electrical Engineering”. I did one small module on C programming, back in 2012 and I barely passed the module. So please be gentle with me – I am likely to make mistakes. This is my first attempt at programming an I2C device.
Right, now that THAT disclaimer is out of the way; now onto the problem at hand.
In order to get this sensor running and to test to see if it works, I am interfacing a D6T-1A-01 thermal sensor using I2C communication protocol to a 16 Bit PIC24FJ64GB002 microcontroller. The output of the sensor should be displayed on and LCD connected to the uC. Please see the attached zip folder for a photo of the physical circuit. I am programming the devices using the MikroC dsPIC PRO IDE.
I have tested the LCD using simple text, and that part of the code is working fine.
With the entire thing set up, with 5V feeding the sensor and the LCD and 3,3V feeding the uC, I get random numbers output to the LCD. Completely random, and they don’t change with time. When I switch the system off, wait for a while, and switch the system back on, I get a different set of random numbers, but the numbers never change with time. See the attached photo of LCD.
If I disconnect the sensor during operation, nothing happens to the numbers… they stay the same. Sometimes the LCD goes blank, but only sometimes.
I measured the SDA and SCL lines using an oscilloscope, and a photo of the output can be seen in the zip folder. If I look at the D6T user guide (also in the zip folder), it seems like there is missing data?
The Oscilloscope readings also never change, even if I bring a heat source closer to the sensor…
Now, you might be asking yourself, why is this guy posting this question on this forum? The short answer is – because nobody who has responded on the dsPIC MikroC forum has ever worked with a D6T sensor, and so we are chasing our tails a little bit. A chap by the username “Hexreader” was extremely kind in assisting me as far as possible, but without the hardware – there is only so much one can do. Thus, I needed to broaden the scope of outreach. My hope is that, if you’ve ever worked with one of these sensors, that you might be able to spot some obvious mistakes, even if you’ve never coded the sensor using the dsPIC MikroC IDE.
So if you’ve ever worked with a D6T thermal sensor, could you take a look at the attached folder and see if you can spot why my system is not working as hoped?
I would greatly appreciate any and all assistance. You would literally be a life-saver and if necessary, I would even be willing to pay for working code.
If you wish to contact me privately to discuss the matter further, my email address is: firstname.lastname@example.org
Thank you for entertaining this post!
D6T-1A-01Rev0.zip (1.91 MB)