Go Down

Topic: How to identify multiple sensors? (Read 881 times) previous topic - next topic


Nov 18, 2012, 12:50 pm Last Edit: Nov 18, 2012, 01:02 pm by ravensburger Reason: 1
Hello all,
am new to arduino and am trying to interface several sensors (dht11, pir, others) to a single board.
I would like to be able to identify each sensor ... or each sensors brick (I am creating bricks where possible).

I know I can banally point each sensor to an arduino pin, but I'd like to setup a bus like system with serial communication to reduce cabling and have only one cable reach arduino, so I need to identify devices to understand where the reading is coming from.
I would also like to ensure the address is preserved in case of power failure.

Finally (am demanding :) )I do not want to buy 1-wire/new sensors (there are models with address embedded) as have already most sensors.
Was thinking of employing I2C eeproms (24LC256) or similar... does anyone have better ideas or guidance?
Am not very knowledgeable in the components space therefore any suggestion is welcome.



Hi Marco

Since you won't let me tell you to buy all different sensors, you've set quite the challenge :)

The products you've bought so far presumably are all interfaced like the DHT11 you mentioned, with a single data line, power and GND, but no address capability.  Many devices which use that setup are not even digital, but will return an output voltage from 0V to VCC with a linear relationship to the value returned (eg LM35 / TMP36 types for temperature, or Allegro current sensors for two).

You could potentially add that functionality by dropping an ATtiny (say) at each sensor.  The sensor would talk to its local microcontroller directly, on its dedicated input pin, and that microcontroller could be addressed on a bus via I2C (say) from the Arduino.

I don't completely understand for all that added complexity (cost, headaches etc) what you'd be gaining though.  The direct attach is really nice and simple, if not as elegant as you'd prefer.

Was thinking of employing I2C eeproms (24LC256) or similar... does anyone have better ideas or guidance?
These EEPROMs are a great way of expanding the non-volatile storage on your Arduino, but on their own would not be useful for adding a bus capability to these sensors.  Reason being, they're just storage with no processing capability so they can read and write their own storage when instructed by the Arduino, but can't help you interfacing additional sensors on their bus.

Cheers ! Geoff
"There is no problem so bad you can't make it worse" - retired astronaut Chris Hadfield


Thanks Geoff,
yes as you say direct attach is the easiest (it is how I started)... and am not throwing it away, the challenge is wiring for connecting 30 sensors in a range of 25mtrs.
If I cannot find better I will direct connect, but your suggestion of using an attiny is not a bad one as well.

Thanks for now :)


Nov 18, 2012, 02:38 pm Last Edit: Nov 18, 2012, 02:51 pm by Graynomad Reason: 1
There is no way you'll be able to connect different sensors to a single bus, they have all manner of different interfaces.

The only way I can see is to do what Geoff says, have a processor at every node working as Bable fish to convert all the different formats to a single protocol you define.

If you're not in a hurry you can be a beta tester for my sensor network next year sometime. :)

Rob Gray aka the GRAYnomad www.robgray.com

Go Up