Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Identify which sensor is connected

Status
Not open for further replies.

stelios26

Newbie level 1
Newbie level 1
Joined
Apr 24, 2013
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,292
Dear all,

First of all hello, this is my first post in these forums.

Straight to the point. I am developing a small robotic interface for a small toy (kind of like lego's NXT)
The interface has a small(ish) STM32 microcontroller that controls LEDs, servos, analog motors, IR and touch sensors.
It can accommodate any 4 of the above simultaneously at any of it's 4 RJ25 ports.

Now, I want to be able to identify which peripheral component is connected at which (of the 4 RJ25) ports automatically
(in order to program the device accordingly) without manually assigning each port according to what I've connected.
I'm not sure how I should proceed, my initial thought was to sense the resistance of a pin (by the use of a bridge and the
ADC of the microcontroller) in order to identify the peripheral but I don't know if this will work.

Any ideas? Has anyone came across something similar?

Thanks!
 

That's one way. Have a fixed resistor on the main board and use the peripheral resistor as a voltage divider and measure with an ADC. Make sure to leave a big enough gap between values to allow for tolerance stack up.

Another way, especially if you think you're going to have a fair number of different sensors, is to use a I2C port expander (such as a MCP23008) on each sensor board. It is an 8-bit I/O chip. Simply strap the 8 bits to a different address for each sensor and use the 2 I2C lines to read what is connected. This will allow up to 256 different sensors.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top