Comunicating ADC+ Arduino DUE with the protocol 1-wire

Hi everyone, sorry if I don't express correctly. I've got an Arduino Due and I'd like to comunicate 10 ADCs with the Arduino DUE by the 1-wire protocol. I don't know if is possible cominicate the ADCs with the Arduino by this protocol (and I doubt if there are ADC that can use this comunication). Are there any Arduino library for this? I'm novel in this matter.

Thankkssss :) :)

I need help please :(

(and I doubt if there are ADC that can use this comunication)

I don't understand, do you have 1-wire ADCs or not? You are saying that you doubt they even exist, in which case the entire question is moot.


Rob

Graynomad:

(and I doubt if there are ADC that can use this comunication)

I don't understand, do you have 1-wire ADCs or not? You are saying that you doubt they even exist, in which case the entire question is moot.


Rob

Sorry... I don't express in english very well. I was researching about 1-wire ADC and now I have some information about it. This protocol is property of Dallas Semiconductor. Now, I need comunicate my Arduino Due with 10 ADC 1-wire. My idea is connect this 10 ADC in the same Bus that will be managed by the Arduino Due.

I need implement this protocol (1-wire) in the Arduino Due by software. This protocol too has a errors control (CRC8) that I need implement. I ask for examples about it and information links. Thanksss for your response :)

Did you try this?

http://www.pjrc.com/teensy/td_libs_OneWire.html

Works with the Due

This library is only for the sensor DS18S20 . I just read in other forum that MAXIM left make the 1-wire ADC. :( :( In this case, I won't be able use this protocol in the ADC-Arduino's comunication. I think that I will be able work with SPI protocol. If you know any library that implement SPI protocol tell me please.

And I have other question: Is possible program the Arduino Due with other language (I would like program timer interruptions and able/disable this interruption). Thanksss a lot!!! ;)

This library is only for the sensor DS18S20

Not really the OneWireLib (http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip) is for the OneWire Protokol, the Lib from Miles Burton is specialy for the DS18S20. You need only the Onewirelib for your use. If you tell us the name of you ADC may we can give you an hint to comunicate with it.

Btw. take a look at this http://code.google.com/p/gfb/source/browse/arduino/DS2450/?r=22

The ADC that I would like use is DS2450 but I just read in other forum that MAXIM left make the 1-wire ADC. Is truth that the MAXIM (Dallas Semiconductor) is the only property of 1-Wire protocol? Can I use other maker for use ADC with 1-wire protocol? Thankss

Now that you mention it I can only remember ever seeing MAXIM/DS chips with 1-wire, but that's not to say there aren't other manufacturers.

Can I use other maker for use ADC with 1-wire protocol?

Sure, if you can find one.

Why are you so fixed on 1-wire? There are a lot more options with I2C and it's only one more wire.


Rob

Graynomad: Now that you mention it I can only remember ever seeing MAXIM/DS chips with 1-wire, but that's not to say there aren't other manufacturers.

Can I use other maker for use ADC with 1-wire protocol?

Sure, if you can find one.

Why are you so fixed on 1-wire? There are a lot more options with I2C and it's only one more wire.


Rob

Yes Graynomad is right there are so many options, I2C, SPI, Serial and Parallel and I'm sure Graynomad knows some more. Btw. and faster as OneWire are they too.

Start at the beginning what do you want with an external ADC? The DUE has some inside itself 12bit if I'm right, goes from 0 to 3.3Volt.

The project that I need design is create 10 temperature sensors that will measure the temperature in 10 diferents positions . The distance from SENSORS+ADCS to Arduino Due is approximately 30m. (This distance is too big for use I2C or SPI).

I need design 10 temperature sensors. These sensors will be connect with one or more ADC (depend of the number of channels). These ADC will send the data to Arduino Due. Now, I need to think the protocol that will comunicate the ADC and the Arduino. I read yesterday that the MAXIM was the only manufacturer that would produced the ADC 1wire but now doesn’t (Is possible that I’m confuse).

If I decide comunicate the SENSORS+ADC with the Arduino by SERIAL protocol (RS232) I think that I need use a PIC for manage this Serial protocol in the connection SENSORS+ADC - ARDUINO yes?

The mesure of the temperatures must be sufficient precise and If I decide use a PIC that incorpores ADCS I could use them for the temperature sensors but I don’t know if this mesure will be precise…

I wait for your responses (Thanks and sorry if I don’t express correctly) :slight_smile:

Hmm, ok.

it would be make with DS18B20 the OneWireProtocol would work over this distance http://www.maximintegrated.com/app-notes/index.mvp/id/148

Range is -55 to +125 Degree.

But if you want realy big distances and high precision so do something like this.

Temp-Sensor->ADC->uC->live-zero-Signal(DIN IEC 60381-1) [4..20mA]->ADC(near DUE)->Some Protocol->DUE

The current Signal is really unaffected by distance and EM-fields in the near.

So you can use any Sensor you want and go to long distances as well but you need to set up an DAC and an OP-circuit, or an IC for the Signal.

Both I2C and SPI can do 30M but not in their standard form, you need drivers and slow(ish) speeds. Heck SPI could do 1.2k if you use RS-485 transceivers and still run at 1MHz.

I think that I need use a PIC for manage this Serial protocol

Yes a PIC would do, but so would an AVR and you'll get a lot more help here if you use an AVR.

Any CPU with a serial port, a line driver, and an external temp sensor could do this.

Are all 10 sensors at the same place that's 30M from the Due? Or are they all 30M away in different directions?

What is the rate you need to read them?


Rob

30 meters is a very long distance for 1-wire communication. If you get this to work, which is unlikely, it may not be very reliable.

(I am the current maintainer of the OneWire library, by the way...)

Usually such long distances are done with 4-20 mA analog current or RS-485 serial.

Hi everyone! sorry for my later reply.

Markus thanks for your response. I decided use a simple sensor temperature. If I can’t use 1wire because the manufacturer don’t make 1wire ADC I won’t use it. I thought to use 1wire protocol because the quantity of wire is small and with one pin of the Microcontroller I can manage all. But I won’t use it because I see that there are other most common protocols.

Graynomad, the 10 sensor will stay in differents positions. The distance between Arduino-10 sensors will be approximately 30m. The distance between sensors will be short (2m).

Paul, I thought yesterday that I can use RS485 because is differential and I can connect others PIC in the bus. This is the best and easy protocol that I could use.

I think that I can do the following idea: 10 sensors temperature (with its voltage-intensity converters) and connect them with a PIC for use its internal ADC. The pic should have 10 channels ADC for connect 10 sensors. The PIC will process the analogs signals. The pic will connect with the Arduino Due with a RS485 bus.
I will need to adapt the pic’s out RS232 for RS485. I think that I can use a MAX485 for adapt it. I think that I must use two MAX485 for adapt the signals between protocols. One of them in the out of the PIC and the other one in the entrance of the Arduino Due’s RS232. And I read that Arduino doesn’t use TTL voltages in the RS232 (0-3.3V in Arduino?)
if i use RS485 I will be able to connect more PICs in the future if I need use more Sensors (using MAX485). I don’t know if MAX485 adapts the TTL signals of the PIC (because the PICs use RS232 but with TTL signals).

New diagram:
[Sensors with I-V Converters} → PIC’s ADC → MAX485 → (BUS RS485) <— MAX485 <— Arduino Due ----------> DATAS

What do you opinion? Can I use MAX485 easily for adapt the RS232-RS485 and RS485-RS232 conversion?

Thanks a lot for yor responses!! :slight_smile: :slight_smile:

Your "diagram" looks correct but your terminology is not. A PIC (or any other CPU for that matter) does not have RS-232, it has a UART that talks async serial. RS-232 is a voltage level spec (as is RS-485) that has nothing to do with the format of the data or anything like that.

I think that I must use two MAX485 for adapt the signals between protocols. One of them in the out of the PIC and the other one in the entrance of the Arduino Due's RS232.

Yes for two devices you need two RS-485 transceivers, one at each end. Every extra device added needs another transceiver.

The MAX485 is a common choice and of course it works OK, but I don't think it's available in a 3v3 version which you need for the Due end. Check that out, if not try a LTC1480 or similar that does run at 3v3.

This is the best and easy protocol that I could use.

RS-485 is not a protocol, a protocol is code that implements a set of rules that determine the format of the data being transferred and optionally how to handle errors etc. You will have to write the protocol. That said yes I think RS-485 is the best method.

I can connect others PIC in the bus

Again, why a PIC? Not that there's anything wrong with PICs but you won't get much (or any) help here with them.


Rob

Thanks Graynomad! I am learning more in this forum :)

The part of the pics is solved (that part is not a big problem now). I will send from Pics to Arduino a value type Float. For example, the smaller value that I can obtain with the measure of the Pic's ADC(10bits) is 5V/1024 =0,00488V. The smaller value that Arduino will receive by serial port is that. Will the arduino's serial port receive packet of the 8bits? I will send to Arduino the value in string form by pic's serial port. If later I need send by arduino's serial port (to other platform, for example my laptop) that smaller value I can use a simple "print()" ?

I wish that you understand that explanation. Thanks for your responses.

Will the arduino's serial port receive packet of the 8bits?

It will receive whatever you send to it.

I will send to Arduino the value in string form by pic's serial port.

Then that's what it will receive (subject to faults in the line etc).

If later I need send by arduino's serial port (to other platform, for example my laptop) that smaller value I can use a simple "print()" ?

Yes, you can just echo the same data or change it as you see fit.

I won't ask again why you are using a PIC, I'll just assume there is a good reason.


Rob

Thanks a lot Grainomad and the other users with your help. I am continuing with this project and developing it. :) :)

I am using pics because the idea is comunicate the Arduino and the sensors with a only bus. I will use the pics' ADC to make the conversion (Analog to digital) and I will save problems (probably this isn't the best metod).

I am using pics because the idea is comunicate the Arduino and the sensors with a only bus.

That's a reason to use a processor of any kind and a reasonable decision. I'm just curious as to the choice of a PIC because you won't get much (any) help here with it. So if you are already proficient with PICs fair enough, but if you have to learn a processor anyway it might as well be an AVR.


Rob