View previous topic :: View next topic |
Author |
Message |
Martin Holm Guest
|
pic rs232 temperature |
Posted: Mon Jan 27, 2003 1:55 pm |
|
|
Hi,
Do any of you guys know about projects with a pic measuring temperature and the data logged to a pc trough a rs232 port?
Does it sound as a difficult project?
I'm also looking for an example in c.
Martin
___________________________
This message was ported from CCS's old forum
Original Post ID: 11047 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: pic rs232 temperature |
Posted: Mon Jan 27, 2003 2:24 pm |
|
|
:=Hi,
:=
:= Do any of you guys know about projects with a pic measuring temperature and the data logged to a pc trough a rs232 port?
:=Does it sound as a difficult project?
:=I'm also looking for an example in c.
:=
---------------------------------------------------------
Try Jon Fick's page. He has a data logger project on it.
The code seems fairly complicated as an example for a beginner,
but at least it should give you some ideas.
<a href="http://www.VermontFicks.org/pic.htm" TARGET="_blank">http://www.VermontFicks.org/pic.htm</a>
___________________________
This message was ported from CCS's old forum
Original Post ID: 11049 |
|
|
Steve H Guest
|
What I do (yet again) :-) |
Posted: Mon Jan 27, 2003 2:42 pm |
|
|
You can take a look at my universal data acquisition project at the page below. Hook up a couple of LM34, 35's or 50's and get 8 analog temperature channels at 1 mV resolution.
Steve H.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11051 |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
Re: pic rs232 temperature |
Posted: Mon Jan 27, 2003 2:53 pm |
|
|
I did a project using a PT-100 RTD (100 ohms at 0 degrees Celsius). It used analog devices AD2402 ADC to get readings. Readings were curved with Calendar / Van Dussen equations to fit characteristics of the element resulting in a circuit that measured temperature with resolution of .001F degrees repeat ably accurate to .01 F. The trick is not using any op amps and draw power from a battery also power off the rs232 level converter when not in use. It was so sensitive it could detect changes in air pressure from the associated change in air temperature when opening a door to the room it was in. That product never really made it past marketing. Part cost was around $45 and half of that was a precision RTD.
You can find notes on the AD website about using the AD2402 in this circuit.
Data logging is a simple task by comparison. Try a protocol based on MODBUS. Look as www.modbus.org for the modbus standard. On the PC you can write a VB application or use hyperterminal to log a file.
___________________________
This message was ported from CCS's old forum
Original Post ID: 11053 |
|
|
kolio Guest
|
Re: pic rs232 temperature |
Posted: Tue Jan 28, 2003 4:15 am |
|
|
:=Hi,
:=
:= Do any of you guys know about projects with a pic measuring temperature and the data logged to a pc trough a rs232 port?
:=Does it sound as a difficult project?
:=I'm also looking for an example in c.
:=
:= Martin
Hi,
If you want something really simple, check Dallas(Maxim) 1-wire digital thermometer DS18x20. It can be controlled directly thru serial or parallel port. Put some protection and/or level shifting if it's necessary. But if you want to play with PIC - this is another issue ;-)
Wish you luck!
___________________________
This message was ported from CCS's old forum
Original Post ID: 11068 |
|
|
Neutone
Joined: 08 Sep 2003 Posts: 839 Location: Houston
|
|
Posted: Fri Dec 12, 2003 8:30 am |
|
|
That ADC I mentioned using was actually a LTC2402
LTC2401/LTC2402 1-/2-Channel 24-Bit µPowerNo Latency Delta-SigmaADC in MSOP-10
http://www.linear.com/pdf/24012f.pdf |
|
|
jds-pic
Joined: 17 Sep 2003 Posts: 205
|
Re: pic rs232 temperature |
Posted: Fri Dec 12, 2003 9:56 am |
|
|
kolio wrote: |
If you want something really simple, check Dallas(Maxim) 1-wire digital thermometer DS18x20. |
here are my onewire generic and DS1822-specific drivers...
http://losdos.dyndns.org:8080/public/onewire/lib-onewire.h
or
http://losdos.dyndns.org:8080/public/onewire/lib-onewire.html
using a onewire device such as this, making a PIC-based temperature sensor which periodically emits the info via RS232 is utterly simple. there is very little programming involved in getting this up. but the first step is to NOT worry about temperature measurement -- get your PIC to run a simple program that emits a fixed message via RS232. this will tell you that your Vcc, I/O, clock, WDT, MAX232, and so forth are all configured correctly and functional. once you have that infrastructure running, you can move on to the job of gathering temperature samples. do not make the mistake of starting to build a house without building the foundation first. get your PIC running, get your development environment sorted out, get your programming cables made up, and so on. then worry about application specific stuff. otherwise you are just going to get frustrated because nothing works and you'll have no where to start troubleshooting.
regards,
jds-pic |
|
|
dazlogan
Joined: 19 Oct 2003 Posts: 24 Location: Cambridge, UK
|
Simple? |
Posted: Sun Dec 14, 2003 8:46 am |
|
|
Hello,
I would have thought the simplest method would be to use a temp. sensor with an analogue output suitable to inject straight into a PIC a/d input pin.
The basic process would be:
1. Read a/d input
2. Send a/d value out via RS232
3. Go back to 1
?
Regards,
Darren |
|
|
Guest
|
pic rs232 response |
Posted: Thu Dec 18, 2003 1:19 pm |
|
|
I have the development kit and there is an exercice with a temperature chip: ds1631 which communicate (I2C) with a 16f877A. You can read the value in an hyperterminal (the 16f877A communicate with the PC (rs232)):
this is the code:
#include <prototype.h>
#include <ds1631.c>
main() {
byte value;
output_low(GREEN_LED);
printf("la ligne avant fonctionne\n");
init_temp();
output_low(RED_LED);
printf("la ligne après fonctionne\n");
do {
printf("la boucle fonctionne\n");
value=read_temp();
output_low(YELLOW_LED);
delay_ms(1000);
output_high(YELLOW_LED);
delay_ms(1000);
printf("%u\r\n", value);
delay_ms(1000);
} while (TRUE);
}
and prototype.h:
#include "16f877A.h"
#device ICD=TRUE
#fuses HS,NOLVP,NOWDT,PUT
#use delay(clock=20000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8)
#define GREEN_LED PIN_A5
#define YELLOW_LED PIN_B4
#define RED_LED PIN_B5
#define PUSH_BUTTON PIN_A4 |
|
|
|