[OpenTRV-dev] DS18B20 with Arduino

Damon Hart-Davis EMAIL ADDRESS HIDDEN
Thu Sep 19 21:21:25 BST 2013


Hi,

If using the DS part then circuit would be being run at 3V3.  (Can't go higher because of RFM23 limits.)  Happy to set output to float high (pulled up but no current drain with 4k7) if not in use, so don't worry about power, etc.  I can optimise later if I have something robust and is correct.

Rgds

Damon

On 19 Sep 2013, at 20:14, Kevin Wood wrote:

> Yes, forgot about the pullup. That would probably have to be driven only when required to enable low power consumption. The data sheet doesn't sanction anything else pulling the bus high. IME, though, you can get away without the 4k7 pullup and enable the AVRs internal pullup with a 5v supply, and 1 or 2 devices on the bus, at any rate. Would need to check for lower voltages.
> 
> Kevin
> 
> On 19/09/13 18:59, Damon Hart-Davis wrote:
>> Hi,
>> 
>> Thanks for suggestions!
>> 
>> As long as we connect it up plausibly, with a 4k7 pullup, then we can probably fudge it in code later.
>> 
>> I would check it at each reset, which would generally be at power-up.
>> 
>> Rgds
>> 
>> Damon
>> 
>> 
>> 
>> On 19 Sep 2013, at 13:12, Kevin Wood wrote:
>> 
>>>> its more to give Damon tips on how he could approach it.... i'm more the
>>>> hardware guy that do the pcb's
>>>> 
>>>> but yes tmp112 is a 2 wire.... sounds like a plan to me... ie not power up
>>>> tmp112 and poll data oin that DS is connected to... should be fairly quick
>>>> too
>>> 
>>> Yes. It would only have to be done once when a battery is inserted. After
>>> that the AVR can remember its' config. Could even save it to EEPROM so it
>>> never has to be done again, I suppose. Unless you only ever have a single
>>> device on the OneWire bus, you need to do this anyway, to learn the
>>> addresses of all connected devices.
>>> 
>>> I suppose I should acquaint myself with the current design. Been a bit out
>>> of the loop recently.
>>> 
>>>> 
>>>> as a SMALL ps... you or anyone else knows where to get hands on solder
>>>> dispensers ? will not mind a used one...
>>> 
>>> I'm afraid not.. I tend not to venture too far away from through-hole
>>> devices. I don't need such steady hands then. ;-)
>>> 
>>> Kevin
>>> 
>>>> /bo
>>>> 
>>>> 
>>>> 
>>>> -----Oprindelig meddelelse-----
>>>> From: Kevin Wood
>>>> Sent: Thursday, September 19, 2013 1:56 PM
>>>> To: Closed list for developer discussions
>>>> Subject: Re: [OpenTRV-dev] DS18B20 with Arduino
>>>> 
>>>> Hi Bo,
>>>> 
>>>> OK. Not that familiar with the tmp112 but I believe it has a 2 wire serial
>>>> interface? If you set the clock pin inactive initially at power-up and
>>>> polled the data pin using the dallas 1 wire protocol to see if any OneWire
>>>> devices respond, then fall back to the tmp112 protocol if not, I guess
>>>> that would probably work?
>>>> 
>>>> Kevin
>>>> 
>>>> 
>>>>> Hi
>>>>> 
>>>>> Damon might not have mentioned or i have not seen that he has
>>>>> 
>>>>> but we would like ideas on how to detect if we have a DS18B20 or TMP112
>>>>> fitted
>>>>> 
>>>>> the TMP is very low power and great res. but also a pain in the arse to
>>>>> fit
>>>>> even with manual pick and place..  thou i'm getting close... just need a
>>>>> solder dispenser and i'm good for it
>>>>> 
>>>>> /bo
>>>>> 
>>>>> -----Oprindelig meddelelse-----
>>>>> From: Kevin Wood
>>>>> Sent: Thursday, September 19, 2013 1:26 PM
>>>>> To: Closed list for developer discussions
>>>>> Subject: Re: [OpenTRV-dev] DS18B20 with Arduino
>>>>> 
>>>>> It seems that the code I used was derived from this:
>>>>> 
>>>>> http://www.siwawi.arubi.uni-kl.de/avr_projects/tempsensor/
>>>>> 
>>>>> There's no mention in the code or the web site of any license or
>>>>> permission under which it may be used, unfortunately. At the time, that
>>>>> didn't bother me, of course...
>>>>> 
>>>>> It's not that complex, and I have onewire devices, so I could attempt to
>>>>> "white room" myself and write something?
>>>>> 
>>>>> Kevin
>>>>> 
>>>>>> Thanks, that would be helpful!
>>>>>> 
>>>>>> Rgds
>>>>>> 
>>>>>> Damon
>>>>>> 
>>>>>> 
>>>>>> On 18 Sep 2013, at 19:25, Kevin Wood wrote:
>>>>>> 
>>>>>>> I've been using OneWire sensors with an AVR quite a bit. I'll have a
>>>>>>> look at where the code I used came from. Can't remember if it was
>>>>>>> home-made, pinched from somewhere or a combination thereof!
>>>>>>> 
>>>>>>> Kevin
>>>>>>> 
>>>>>>> On 18/09/13 18:09, Damon Hart-Davis wrote:
>>>>>>>> Hi,
>>>>>>>> 
>>>>>>>> Bo: following our earlier discussions
>>>>>>>> 
>>>>>>>> With a little research I think it should be possible to make the V0.2
>>>>>>>> work with DS (when running on 3.3V) or TMP, detected at run-time if
>>>>>>>> need be, though there are a number of trickinesses, especially with
>>>>>>>> timing because the DS is slow.
>>>>>>>> 
>>>>>>>> But I have not yet found a sensibly-licensed 1-Wire library for
>>>>>>>> Arduino/ATMega (ie *with* some sort of licence that isn't GPL and
>>>>>>>> pref
>>>>>>>> is BSD or Apache or MIT or similar), so might have to reverse
>>>>>>>> engineer
>>>>>>>> something.
>>>>>>>> 
>>>>>>>> In any case it's not a trivial bit of work, but not insurmountable
>>>>>>>> either.
>>>>>>>> 
>>>>>>>> Rgds
>>>>>>>> 
>>>>>>>> Damon
>>>>>>>> 
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> OpenTRV-dev mailing list
>>>>>>>> EMAIL ADDRESS HIDDEN
>>>>>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>>>>>> 
>>>>>>> _______________________________________________
>>>>>>> OpenTRV-dev mailing list
>>>>>>> EMAIL ADDRESS HIDDEN
>>>>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>>>>> 
>>>>>> 
>>>>>> _______________________________________________
>>>>>> OpenTRV-dev mailing list
>>>>>> EMAIL ADDRESS HIDDEN
>>>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>>>> 
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> OpenTRV-dev mailing list
>>>>> EMAIL ADDRESS HIDDEN
>>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>>> 
>>>>> _______________________________________________
>>>>> OpenTRV-dev mailing list
>>>>> EMAIL ADDRESS HIDDEN
>>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>>> 
>>>> 
>>>> 
>>>> _______________________________________________
>>>> OpenTRV-dev mailing list
>>>> EMAIL ADDRESS HIDDEN
>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>> 
>>>> _______________________________________________
>>>> OpenTRV-dev mailing list
>>>> EMAIL ADDRESS HIDDEN
>>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>>> 
>>> 
>>> 
>>> _______________________________________________
>>> OpenTRV-dev mailing list
>>> EMAIL ADDRESS HIDDEN
>>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>>> 
>> 
>> _______________________________________________
>> OpenTRV-dev mailing list
>> EMAIL ADDRESS HIDDEN
>> http://lists.opentrv.org.uk/listinfo/opentrv-dev
>> 
> _______________________________________________
> OpenTRV-dev mailing list
> EMAIL ADDRESS HIDDEN
> http://lists.opentrv.org.uk/listinfo/opentrv-dev
> 



More information about the OpenTRV-dev mailing list