Home - Search - Members
Full Version: temperature sensor using 8051 microcontroller to pc visual basic
mic_k86
Jun 3 2008, 12:20 AM
hi,

i have a project of a temperature sensor network. the concept is a temperature sensor sense the water temperature and transmit the temperature value to display and store at pc. it is a project combine of hardware and software. i plan on using 8051 microcontroller at the hardware part and visual basic 6.0 at the software part. but i am weak at writing the 8051 assembler coding the the visual basic coding. anyone in this forum can help me pls...

thanks
sashijoseph
Jun 3 2008, 1:25 AM
What sensor have you decided for water temp?
You would need to interface the sensor to an ADC first.Look here for a tut on 8051 interfacing to an adc. http://www.8051projects.net/adc-interfacing/

Next you will have to pass on the logged values to the pc through the serial port.
Here's a tut on serial interfacing. http://www.8051projects.net/serial-communication/

Finally VB program on the pc side for collecting data from the serial port.Look here..
http://www.8051projects.net/plugins/forum/forum_viewtopic.php?5021.0#post_5060
mic_k86
Jun 4 2008, 11:46 PM
thanks sashijoseph.

i am using temperature sensor DS18S20 for this project. But i have problem for the connection. the pin no.2 (DQ) of the DS18S20 need to connect to which pins of the ADC0804? If direct connect DQ to pin 6 and ground pin 7 of ADC0804 will work? But at some website i found that they mentioned about transducer at this part connection. So what is the correct connection?

thanks
abbas1707
Jun 5 2008, 3:05 AM
DS18S20 is digital thermo meter so no need of aany ADC. for what you are using ADC??
mic_k86
Jun 5 2008, 11:51 PM
so means that direct connect the pin 2 (DQ) to microcontroller 8051 should be ok? but connected to which pin at 8051? Is that pin no.17? Coz i found that only this pin have RD. How to connected for multiple DS18S20?

thanks
abbas1707
Jun 6 2008, 12:35 AM
you can connect it to any pin of 8051 which is an i/o pin. then 1 wire protocol will be used for communication b/w sensor and controller. you can connect mutiple ds18s20 on a single 1-wire bus.pullup has to be used b/w them and controller
mic_k86
Jun 7 2008, 12:16 AM
What you mean pullup in this case? Is that connected multiples ds18s20 with external power supply instead of parasite power? Is it possible to connect different ds18s20 to different i/o pin?
abbas1707
Jun 8 2008, 5:31 AM
pullup resistor. it is possible to connect different ds18s20 to different i/o pins but it will...be totally a bad design.you have to follow the standard way which is 1 wire bus
mic_k86
Jun 8 2008, 6:29 PM
erm...can you give me an example of circuit diagram on how to connect in pullup resistor? If using parasite power for DS18S20, the Vdd pin is connected to ground or leave it not connected?
Ajay
Jun 8 2008, 8:36 PM
Pullup is something like this...
VCC |----/\/\/\/\---->Pin

vdd can be connected to ground if you are using parasitic mode of power but do not forget to add a mosfet for pullup. which is needed most.

Please read datasheet for more information on pullup requirements.
mic_k86
Jun 8 2008, 11:02 PM
so means that if only 1 DS18S20 is used, then no need add on pullup, rite? direct connect the DQ pin to the i/o pin the circuit will work already, rite?
mic_k86
Jun 12 2008, 5:05 PM
is my connection for multiple DS18S20 is correct? i have attach a circuit diagram at below. pls check it out.


Ajay
Jun 13 2008, 12:48 AM
yes they are right.. no need of that jumper, its understandable that wires are passing over each other but not connected
but if you still want to keep it you can

Which software are you using?
mic_k86
Jun 23 2008, 12:36 AM
i'm using express SCH inside express PCB software. But i can't convert the schematic diagram drawing to PCB. anyone can help me on this? bside, as you can see in the above diagram, the microcontroller pin doesn't arrange from 1 to 40. can the pin arrangement be changed?
Ajay
Jun 23 2008, 8:37 AM
you dont have to worry about the arrangement, when you design PCB, the footprints are always in arranged order. All you need to do is select the right footprint for your part, like for 8051 DIP package 40 pins and 300mils width (check datasheet for more info).
mic_k86
Jun 23 2008, 10:38 PM
oh i see. is that at expressPCB i need to draw again the circuit? is that this software doesn't hv any function like automatic convert the schematic diagram to PCB diagram?
mic_k86
Jun 24 2008, 6:10 AM
following is my project full circuit diagram. now i having problem on the microcontroller 8051 assembly language. how to wrote the coding so that the temperature sensor can continuous reading the temperature value and continuous display at the PC using visual basic? anyone can help me on this matter? thanks
mic_k86
Jun 24 2008, 6:20 AM
Ajay
Jun 26 2008, 7:56 AM
search in website for VB Serial communication or MSCOMM you will get all your answers..
mic_k86
Jun 26 2008, 5:37 PM
erm...i mean is the coding (assembly language) for 8051 microcontroller not coding for visual basic.
Ajay
Jun 28 2008, 6:11 AM
use simple serial communication to send data to UART.

see tutorial for more help..
sashijoseph
Jun 28 2008, 10:03 AM
erm...i mean is the coding (assembly language) for 8051 microcontroller not coding for visual basic.

The asm coding is for the micro to send data to the pc(serial Tx) and the VB program is for the PC to receive the serial data from the micro(serial Rx).
Instead of coding in VB,for testing purposes,you can use the hyperterminal program.If everything goes well then you can create your custom application in VB.
mic_k86
Jul 2 2008, 6:37 AM
from the UART tutorial, i found two note: 8051 programming to UART and software UART for 8051. Is that coding in both note are need for my circuit? Or either one note coding already enough? Have any similar example of ready write coding for reference? thanks
sashijoseph
Jul 2 2008, 9:13 PM
8051 UART programming is the one you need,not the software uart.
The software uart is for emulating a hardware uart in situations where the hardware uart is unavailable.
mic_k86
Jul 7 2008, 5:41 AM



sensor.zip
following is the coding i modify from the DS1820 Based Temperature Controller (AT89C2051) at download section. can anyone help me check my coding is correct or not? thanks
Ajay
Jul 7 2008, 7:37 AM
have you compiled it and tested it on hardware yourself?

If not please do it only then we will be able to find out what the problem is and it will be easy to debug it. I hope you can understand.
mic_k86
Jul 7 2008, 6:58 PM
i am on the way of purchasing the hardware component. however, i found that at my county hard to purchase intel 8051 microcontroller. if i replace the microcontroller with atmel 89c51, do i need modification on my project?

for compiling, i am using asem 5113. is asem 5113 good or got any other better compiler?
Ajay
Jul 8 2008, 8:10 AM
there is no modifications needed. intel 8051 and atmel 89C51 both have same features. So you can directly program the hex file. No worries!
Ajay
Jul 8 2008, 8:10 AM
there is no modifications needed. intel 8051 and atmel 89C51 both have same features. So you can directly program the hex file. No worries!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Rickey's World © 2003 - 2007