0

I am in a project where it makes set of 'modules(set of separate circuits that will work as a sensor when connected to the board' that would be connected to Arduino Mega.

Currently, I'm planning to connect 'modules' with the Mega board using RJ-45(also known as LAN cable) cables.

At first, using voltage divider circuit, I tried to identify these 'modules' by attaching a resistor to it, so that if the board sends 5V to the 'module', it gets the resistance of the resistor inside the module.

But, as soon as I tested, this way seemed a bit unstable, because the measured resistance of the resistor kept changing.

Now, is there any other way to 'label' the module? I'm a beginner in this thing, so I'll appreciate any help that is provided.

Thanks in advance.

Ps. the voltage divider circuit that I used can be found in here:

Ps2. the resistor in the module does not mean the total resistance of the circuit in the module. It's separate.

  • What kind of sensors / communication protocol / electrical signalling are you using? – Majenko May 24 '16 at 11:22
  • each modules have sensors like photo-interrupter in it, and through the RJ-45, are provided VCC,GND, 2 digital inputs, 2 analog inputs, a PWM, and 1 pin is left for the identification. – sewerx May 24 '16 at 11:26
  • That starts getting kind of tricky then... Let me put my thinking cap on for a while... – Majenko May 24 '16 at 11:50
  • 1
    the voltage divider circuit that I used can be found in here:; no link present. Raspberry hats use I2C EEPROM to identify the 'HAT'/shield. I've seen people using a DS18S20 temperature sensor, as those also include a 64-bit unique identifier. Though both of these will a relatively expensive options. It could be the long lengths of cable that mess with the resistance. So maybe you could add a constant current source on the modules; then add a 'terminating' resistor at the Arduino, and measure the voltage across it. – Gerben May 24 '16 at 12:49
  • Personally I would have made the modules purely digital. Add a small microcontroller to each one to interact directly with the sensor in the module, and then use a digital protocol (RS-485, RS-422, LVDS, etc) to communicate between the module and the main board. That way the protocol can include a "tell me what you are" request. Cable length then also doesn't affect analog readings. – Majenko May 24 '16 at 13:09
0

If you are unable / unwilling to change your interface into a purely digital system whereby a small microcontroller in the sensor module interfaces the sensor with a communication bus, the best method is probably to include a small 1-wire EEPROM with each module.

An ideal one would be the DS2431 which provides 1024 bits (128 bytes) of EEPROM storage using just 1 wire to both communicate and provide power.

Programming in a unique identifier for the module would be a simple enough task, and that unique ID can then be used to work out what the module is.

The DS2431 is pretty cheap too, available at prices around $1.50 and below (much less for bulk and surface mount).

You can also get bigger versions for storing more data should you want to.

| improve this answer | |
  • humm... if the digital storage is the only answer... then I shall follow. Thanks so much! – sewerx May 24 '16 at 17:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.