A DS18B20 would be handy, I could send it back when I have finished playing, any bits on your wish list you would like that I might have on the shelf.??
I will send one on monday, yours to keep mate. Just wish I had more bits you needed, I owe you much more than one tiny IC after all the things you have sent me and helped me with.
One bit of info on them though, there is a DS1820 and a DS18X20 and they are NOT compatible at all. I spent half a day once trying to get one to work only to discover the difference is not just a letter!
So now I look at them very carefully when I grab one from my box! hehehe
Al
On another tack, could I use the same sort of cap and zener setup as in the one that powers the OPAs to power the LEDs that show the rail is active. I realised when starting to implement the LEDs you suggested for the rail power that though the 5v one is simple enough, I would not be able to use the standard approach with the variable rails.
So if its viable what combination of Zener and cap would you recommend? I have them starting from 2v. I would only require a few mA for the LEDs, they don't need to be bright.
hi Al,
I found my error, I had decided to only sample the DS18B20 tempr at roughly 1 second intervals, so added a counter. I put the counter reset outside the loop... duh.
Try this hex,, I have also attached the Basic.
Ref the serial, I was going to suggest that you output the data on the PIC's UART to the PC, you could log your values.
The AN4 is [Pos4] on the Mode sw, I have set it for 1000 adc counts = +20.00V.
So you could use the spare LM358 as a buffer and voltage divider [20V to 4.888V] , in that way you could measure your project voltages.
When I get the DS18B20 I will tidy up the program.
Eric
That has it sorted mate! Works fine now on any setting.
I see the circuit is almost the same as the on for the neg volts measurement but this time not inverting.
As it happens the way I did it was to use both amp measurements on one OPA and the other has just the neg voltage measurement on one side so its ideal for what you planned.
The 18B20 is on its way mate, and by the way how did the fourth bridge go?
That has it sorted mate! Works fine now on any setting.
I see the circuit is almost the same as the on for the neg volts measurement but this time not inverting.
As it happens the way I did it was to use both amp measurements on one OPA and the other has just the neg voltage measurement on one side so its ideal for what you planned.
The 18B20 is on its way mate, and by the way how did the fourth bridge go?
If I have done my sums right, that Pos4 subr should work ok in your project when you add the LM358.
As a test you could put 0V to 4.888V directly on that AN4 input pin and select Mode4, it should display about 0V to 5V [ dont try over 5V with the divider]
Let you know when the DS arrives, still have not seen your components wish list.?
I don't have a wish list but rather a DOH I don't have one of those and Craplins don't have them - list. Did you know that they had opened a shop at Parkgate retail park? Though it only has the odd bad of resistors and caps, its mainly the ready built Chinese electrical junk that everyone sells. Hey, I just realised that the Chinese used to have junks - now they just have the singular and send it over here! hehehe
Rest assured mate I know that you would always help me if I didn't have a part and you did.
I was thinking,(don't say "that's dangerous!" ), but I wondered why have an OPA circuit at all for the probe?
All I have for reading the positive volts from the supply is a potential divider, wouldn't that be ok to read the probe or is there a reason for using the OPA? Is it a protective measure?
I was thinking,(don't say "that's dangerous!" ), but I wondered why have an OPA circuit at all for the probe?
All I have for reading the positive volts from the supply is a potential divider, wouldn't that be ok to read the probe or is there a reason for using the OPA? Is it a protective measure?
hi Al,
Consider a typical simple resistive divider of say a 5k and a 5k.
Say you used the divider to measure the Base voltage of a transistor, it would mean the Base would be loaded by 10K to 0V.
As an example say the transistor had base biassing of 100K from the +Vs rail and 47K to 0V, as soon as you probed the Base the 10K of the divider would be in parallel with the 47K, so the voltage being measured would be pulled down and the reading would be incorrect.
In the OPA version we can use high value resistors that will minimise the loaded of the circuit by the dividers 622k resistance.
The PIC's ADC requires a source impedance of less than 10K, so the 622K would be well out of spec.
The OPA output impedance is around 100R, the 1K in series with the output is there to limit the current into the PIC if the voltage input exceeds +5V
Ah I see, all clear now. Didn't realise that measuring something would have that effect. I should have really as recently I saw a program on quantum physics that showed that even looking at some things changes the way they are and behave.
Anyway one of the reasons I asked for was that I had built the circuit and for some reason I'm not getting anything out of it at all. I will go through it again with a fine toothed comb.
I have discovered that the problem lies with the Pic or program. I am getting a voltage difference from the4 OPA circuit but the AN4 setting on the PSU just shows around 7v regardless of the input from the OPA. It even shows this with it disconnected altogether.
From what I can glean from your code, which is quite different from PBP I think that the AN4 is still trying to access the 18B20? If so then it makes sense that the reading would be wrong?
BTW this is happening on both 16F872 pics that I have. I tried another as I thought that one might have a faulty pin.
Sorry mate, I bought 4 of them and thought they were all alike. Looking at them with the jewellers eyepiece I can see that another is an 18B20P and the last is an 18B22. Pure chance that we got them working at all. Saying that doesn't the actual IC work the same but just derives its power from the data line?
I am definately using pin 7 mate. I realised straight away when trying to figure out this project that the ANs have a gap for "tockI"! just like an IC maker to split up a set of pins like that! Why not put TockI on the next pin and have a row of 5 ADC pins? Planners eh! But the code below from yours seems to use AN4 for temperature if I read it right. Its from the latest build.
Anyway sorry about the 18 mate, I honestly didn't realise there were any different ones.
I will send you the 1822 mate, it works exactly the same as the 18B20. I know as I just swapped them around and it still shows exactly the same temp. Next time I buy from Ebay I will check more closely eh!
hi Al,
I will check the ADC addresses.
E
EDIT:
The AN5 address should be 61h not 69h
ADCON0 = 61h 'Set AN=4
Can you use Oshonsoft to change it.? and recompile, if not I will post a new hex.
E.
BTW: do you have +5V connected to the DS18B20 power pin.??
Checked my project board I am using a 16F877 PIC [dont have a 16F872] I had the AN4 wire in the next hole down!.
Thats why it worked for me at addr 69h.
I cannot get the DS18B20P working correctly, I can write and read to it, but the temperature is always the default power up value 85Cdeg
The d/s states that a strong pull up using a MOSFET is required during the conversion cycle because the parasite power is inadequate.
So without that I read the default tempr, anyway I will keep playing.