1-wire Temperature sensing
I got some samples from maxim DS18B20-PAR temperature sensors
wired up a PARASITIC circuit ss025 ,, however added 100 ohm as in
I put 4 sensors on my outside AC unit connected with about 50 feet
of cat 5 ,, fired up LogTemp [Mr Soft] works like a champ....
Sensor display is ss024
Red = Suction Line
Purple = Liquid Line
Dark Green = Ambient Air In
Lime Greem = Exhaust Air
No just what does this tell me ? Nothing except its running ....
I'm assuming there is good info there , I just don't under stand it all.
I was impressed by how easy it was to get this going.....
I initially tried Digitemp v17, which worked until I installed LogTemp..
Since LogTemp worked so well I didn't pursue the issue.
Now I need to use some 12f683 and try to get some slaves working to enable
various toys ,, that is if I can find some code,,I really don't want
to reinvent the wheel....
PC.----adapter----------outside --resister ----------sensor1
POWERING THE DS18B20
The DS18B20 can be powered by an external supply on the V
DD pin, or it can operate in “parasite power” mode, which allows the DS18B20 to function without a local external supply. Parasite power is very useful for applications that require remote temperature sensing or that are very space constrained.
Figure 1 shows the DS18B20’s parasite-power control circuitry, which “steals” power from the 1-Wire bus via the DQ pin when the bus is high. The stolen charge powers the DS18B20 while the bus is high,
and some of the charge is stored on the parasite power capacitor (CPP) to provide power when the bus is low. When the DS18B20 is used in parasite power mode, the VDD pin must be connected to ground.
In parasite power mode, the 1-Wire bus and CPP can provide sufficient current to the DS18B20 for most operations as long as the specified timing and voltage requirements are met (see the DC Electrical
Characteristics and AC Electrical Characteristics). However, when the DS18B20 is performing temperature conversions or copying data from the scratchpad memory to EEPROM, the operating current can be as high as 1.5mA. This current can cause an unacceptable voltage drop across the weak 1-Wire pullup resistor and is more current than can be supplied by CPP. To assure that the DS18B20 has sufficient supply current, it is necessary to provide a strong pullup on the 1-Wire bus whenever temperature conversions are taking place or data is being copied from the scratchpad to EEPROM. This can be accomplished by using a MOSFET to pull the bus directly to the rail as shown in Figure 4. The 1-Wire
bus must be switched to the strong pullup within 10μs (max) after a Convert T [44h] or Copy Scratchpad [48h] command is issued, and the bus must be held high by the pullup for the duration of the conversion
(tCONV) or data transfer (tWR = 10ms). No other activity can take place on the 1-Wire bus while the pullup is enabled.
The DS18B20 can also be powered by the conventional method of connecting an external power supply to the VDD pin, as shown in Figure 5. The advantage of this method is that the MOSFET pullup is not
required, and the 1-Wire bus is free to carry other traffic during the temperature conversion time. The use of parasite power is not recommended for temperatures above +100°C since the DS18B20 may
not be able to sustain communications due to the higher leakage currents that can exist at these temperatures. For applications in which such temperatures are likely, it is strongly recommended that the
DS18B20 be powered by an external power supply.
In some situations the bus master may not know whether the DS18B20s on the bus are parasite powered or powered by external supplies. The master needs this information to determine if the strong bus pullup
should be used during temperature conversions. To get this information, the master can issue a Skip ROM [CCh] command followed by a Read Power Supply [B4h] command followed by a “read time slot”.
During the read time slot, parasite powered DS18B20s will pull the bus low, and externally powered
DS18B20s will let the bus remain high. If the bus is pulled low, the master knows that it must supply the
strong pullup on the 1-Wire bus during temperature conversions.
If you are looking for some code ... have a look to MiKroBasic Forum ... BUT remember you won't be able to use the Genuine libs with PAR devices.
Use some custom libraries you will find on the site ... ( from Marcio Nassori , in the projects section )
BTW: if you use a display ... 2K might be a bit short with MkE compilers ...
function ReadTemp MasterRST PPulse OWout SkipRom OWout ConvertT #IFDEF Bus PARasitic Set Pullup On #ENDIF wait 1 s 'Need at least 750 ms for conversion? #IFDEF Bus PARasitic Set Pullup Off #ENDIF MasterRST PPulse OWout SkipRom OWout ReadScratch #IFDEF OWDevice ds18b20 OWin12 ReadTemp = RxData ;whole no. with sign bit #ENDIF #IFDEF OWDevice ds18s20 OWin ReadTemp = RxData/2 ;whole no. with NO sign bit #ENDIF end function
Timing values for what specifically? Sounds like you are looking for a particular member to answer?, relating to a PM or something, in which case I will butt out. Otherwise..... read on.
Use a software Usart routine. Poll for incoming start bit from master and read into an array, or set of variables, as they come in. Or am I still not getting it Surely mikrobasic has a software Usart library, if not then here is a RS232 tutorial.
When the 8 pin PIC16f1822 finally comes around, you could use a hardware Usart, or even the MSSP if the data is local in nature, and an interrupt routine.
I think " soft UART " could do it easily : your pic will respond on receiving a " Key string " and send back your value.
Those two links should help a lot ...
an eye here too :
Last edited by Acetronics; Sep 09, 2010 at 04:38 AM.
As far as I know no compiler has a library that supports SLAVE functions
As I understand the timing......
1> master pulls wire low for 480-960 us then releases wire which goes high thru pullup
1a> this was [reset sequence]
2> after ~ 20us slave pulls line low for 60-240 us then releases
2a> this is [presense pulse]
3> slave waits for high then low the waits ~35us samples line , put bit in byte [8 times]
3a> just recieved the command byte
4> master releases line, goes high thru pullup
5> some cmds are readrom skiprom searchrom matchrom and other possibilities
6a> slave waits for hi then waits for lo
6b> if tx1 releases line [waits~35us implied]
6c> if tx0 pulls line lo waits ~35us releases line
6d> repeat [6a] till 8 bits transmitted
6e> repeat  till 8 bytes transmitted
6f> ?? then go [wait for reset]
7a> recieve 1st byte from master [as in #3]
7b> compare byte
71> 1st byte family code
72> 2nd-7th byte SN
73> 8th byte crc
74 if any mismatch [wait for reset]
7c> repeat till 8 bytes rcv'd last byte = crc
7d> next rcv Funct cmd byte to do whatever
8a> rcv Funct cmd byte to do whatever
9a> slave will eventually xmit 64 bits [8 byte sn]
91> xmit bit actual
92> xmit actual complemented
93> rcv bit from master
94> if bit from master is same as last actual xmitted continue
with next bit [1-64] else [wait for reset]
9b> not sure ??? wait for Funct_cmd or [wait for reset]
9c> keep in mind that all slaves are responding and eventually [wait for reset]
9d> master performs magic and eventually logs all devices
I would like to get the timing vales set for the sweetpoint [ie] that will work with
most master drivers.....I don't want to tweak and retweak....
There is a overdrive mode that really speeds things up,,,I'll be happy to get the
low speed working reliably....
|Category||Thread||Thread Starter||Forum||Replies||Last Post|
|Discussion||Where to temperature test an outrunner?||ibange||Power Systems||7||Aug 15, 2010 09:42 PM|
|Wanted||WTB: Temperature-controlled soldering iron or 2-in-1 solder/rework station.||Cheesehead||Aircraft - General - Miscellaneous (FS/W)||1||Dec 25, 2009 06:06 PM|
|Question||How to control the temperature of a hot wire bow?||Barry P||Foamies (Scratchbuilt)||20||Sep 18, 2006 10:35 PM|
|Discussion||401 gyro sensing wire||Crewdogg998||Mini Helis||6||Jun 02, 2006 09:57 PM|
|temperature rise in wire due to power absorption?||astroboy||Modeling Science||6||Nov 08, 2002 05:58 PM|