Maker Pro
Maker Pro

Module Interfacing

Xenobius

May 15, 2012
125
Joined
May 15, 2012
Messages
125
Hi, I am building a small project which is made up of several modules. I will connect each module using a 4 pin connector which will be Power/Gnd and Data.

Some of the modules will have their own power however some others won't have.

I need to build the circuit in such a way that if I connect 2 modules which have their own power, won't interfere while if I connect 2 modules where only one has power, it will power the other module.

Attached is an image which shows just the MAJOR components whereby A shows a module which supplies his own power and B shows a module which requires power from the connector.

What happens if I connect:

A to A ?
A to B ?
B to B - This will never be the case since I need to have power from somewhere.

What about that diode? it will drop 0.7v making my precious 5v down to 4.3V

Do I need that Diode in the first place?

Thanks all :)
X
 

Attachments

  • connector.jpg
    connector.jpg
    77.7 KB · Views: 118
Last edited by a moderator:

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
1) The diode is not a good idea. It will reduce the voltage to the other module below the required 5V (which typically has +-5% tolerance only).

2) connecting the outputs of two regulators in parallel, as is the case when setting up an A-A connection, is also not a good idea. It probably will work most of the time, but the regulator wih the higher output voltage (tolerances!) will have to supply most of the current.

But, using the 4 pins as shown I see no other way than to do it as in 2).
If you had a free pin (or only one data pin), you could use that to signal whether a module is active with supply) or passive (without supply), e.g. by having a pull-up resistor on that pin and have a passive module pull the pin down to GND. You could use that signal to turn power to pin 1 on or off. A small relay where the coil is connected between 5V and this sense pin would suffice.
 

Xenobius

May 15, 2012
125
Joined
May 15, 2012
Messages
125
Hey Harald,

Thanks for your reply. When I really said 4 pins, I meant 4 pins but had no practical connector in mind. I am now thinking of using an RJ45 connector to have 8 pins.

But as I was thinking about this, I also thought about having ICSP in this connector as that would enable me to program my modules easily.

Something of this sort would do:

1. 5v - pair 1
2. gnd - pair 1

3. MOSI - pair 2
4. Reset - pair 3
5. SCK - pair 3

6. MISO - pair 2
7. SDA - pair 4
8. SCL -pair 4


The reset pin should have a pullup right? Can I use that? What about programming however? will it keep going up and down enable and disabling power?

Come to think of it, the programmer supplies its own power... how would you interface that to a uC?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
You couldn't use the reset pin as a low on this pin will reset the module.
Are you going to re-program the modules often? If not, it is a waste of pins putting the ICSP interface on the connector. Use a separate programming header on the module. This also reduces the risk of inadvertently programming or erasing the module.

Here is a schematic of my original idea, using a PMOS transistor instead of a relay:
attachment.php


Come to think of it, the programmer supplies its own power... how would you interface that to a uC?
That depends on the programmer and the µC. If the module has its own power supply, you do not connect the positive supply between programmer and board. If the board has no supply you do have to connect power from the programmer to the module - provided the programmer can supply the required power to the module.
In any case GND needs to be connected between programmer and module.
 

Attachments

  • power.jpg
    power.jpg
    62.3 KB · Views: 181

Xenobius

May 15, 2012
125
Joined
May 15, 2012
Messages
125
You have a good point. I think in this case its better to include it as it would be very convinient. Would you recommend using the shield for ground and free pin 2?

Thanks for the schematic
 

gorgon

Jun 6, 2011
603
Joined
Jun 6, 2011
Messages
603
I can't really see your problem regarding the power distribution. If you have an 'active' module, just add a 2 pin jumper to the power output, to disconnect distribution or load from another active unit. For the passive units there are no problem, since they always will be connected to the external power. The power distribution selection will only be done once, and a lot of automatic circuitry is a lot of wasted money.

Another thing is the idea about multiple modules. If you use the RJ45 connector you can't daisy chain the distribution, and will need 2 connectors on each module. If you use a ribbon cable/ header of 6 or 10 leads, you can daisy chain all modules on the same cable, just adding connectors.
 

Xenobius

May 15, 2012
125
Joined
May 15, 2012
Messages
125
Yes you're right but here's the picture. One of the active modules is a remote control which sends/receives commands over wireless. This remote will be used in various different projects and if for example I want to connect an LCD to display commands sent through wireless, the LCD module can be passive as it only requires a maximum of 300mA and a uC perhaps to convert I2C.

If on the other hand I connect say a controlling device which would have its own power, I would need the rj45 not to have power as both modules would be active. So by having ICSP available, I can change the software anytime iwthout opening it. I would also be able to connect anything to it without having to open it to change the jumper. Having said all this, I already have a circuit in place in side the remote which would enable the user to push a button to turn on a power transistor, power up the uC, and than the uC itself can shut down and turn off itself until someone presses the button again.

I will see what I can do. Perhaps if I read the ICSP specification, I can assume some signals and make use of them to know when a programmer is connected, and disable the power, and maybe when an active module is connected, It would send the same signals as a programmer and power is disabled just the same.

Sorry if you're confused :) I will figure out something.

Thanks Guys
 
Top