Main Site Documentation

Making socket type A from another Socket on Mountaineer board


#1

Hi guys,

I am wondering is there a way to make some of the other sockets into an A or I socket? I have purchased one sensor with socket type I and one with A and I am using Mountaineer Ethernet board. Unfortunately I haven’t seen that both A and I are actually on the same connector. So if someone find a way to make one of the others sockets into A or I it will be very helpful.

Thanks!


#2

Thanks for the fast reply :slight_smile:

I have one moisture sensor which is socket type A. And one Temperature and barometer sensor - type I. I need to have both of them attached and get their readings.


#3

Given that there is some overlap in pins, you might need to modify the drivers for the modules in question, but you should have enough pins to work successfully.

https://www.ghielectronics.com/docs/120/gadgeteer-sockets

What are your actual modules, the GHI ones? If pins 3, 4, 5 are not used by the I2C device, you should be fine. Connect up three breakout modules and you’re done - or some custom wiring :slight_smile:


#4

Hi Brett,

My modules are by Seeed studio.

Barometer and temperature module - http://www.seeedstudio.com/depot/barometer-module-net-gadgeteer-compatible-p-974.html?cPath=73

and Moisture sensor - http://www.seeedstudio.com/depot/moisture-module-net-gadgeteer-compatible-p-973.html?cPath=73

I was thinking that it might be possible by some modification of the module driver to attach it to X or Y or I need to make the rewiring or use the breakout module?


#5

You should be able to modify driver and use Software I2C FOR I module on any Y socket. Take a look at the module’s code on codeplex.


#6

No the pins are unlikely to be exposed on any of the other sockets. You will need to use the I/A port and split it. As Andre says, I2C and Analog In are very specific pins, whereas X sockets are usually just GPIOs that can be substituted among many other sockets. You could try software I2c but I don’t know how effective it’ll be for you

The simple answer here is that the modules in question use many pins and it’ll be a little complex. It will also require you to approach two aspects - the electrics/wiring, and then modifying the drivers.

I realise you’re new here, so I wanted to say, if this is starting to freak you out let us know :slight_smile:

From the Seeed hardware files in the Gadgeteer source, I have checked the pin usage of each module.

Barometer (I socket) uses pins 1, 3, 8, 9, and 10.
Moisture (A socket) uses pins 1, 3, 5, 6, and 10.

From https://www.ghielectronics.com/docs/120/gadgeteer-sockets

Barometer therefore uses 3v3, !GPIO, SDA and SCL, and GND
Moisture uses 3v3, AIN(!G), AIN, GPIO and GND.

So to start with, the pin 3 will potentially be hard to unravel. You would need to leave moisture on pin 3 in case it’s using it for Analog In; I’ve checked the code for the Barometer and it is NOT using this as an interrupt pin so we can find another non-conflict GPIO pin for that, woo hoo.

Pin 5 is an Analog In pin as well; there’s no conflict here so you should be ok here.

Pin 6 is a GPIO so it could be moved to anywhere if needed, but it currently doesn’t conflict so again it’s ok to stay where it is.

Pin 8 and 9 are the I2C pins so you can leave them where they are.

Pin 10 is GND - whatever you do make sure these pins are connected on both modules.

So here’s the plan.

Take a breakout module. Plug it into the Socket A/I. This is "Breakout1"
Take two more breakout modules, plug each one into a module.
Connect pins 1, 2, and 10 on all three breakouts together. This gives you power and ground sorted.
On the Barometer’s breakout, connect the following:
Pin 8 --> Breakout1-8 (ie pin 8 on breakout1)
Pin 9 --> Breakout1-9
Pin 3 --> Breakout1-4
On the Moisture probe’s breakout, connect the following:
Pin 3 --> Breakout1-3
Pin 5 --> Breakout1-5
Pin 6 --> Breakout1-6

Then, you have to get the drivers sorted ! This is where I’m going to point you to the reference https://www.ghielectronics.com/docs/122/gadgeteer-driver-modification

At a minimum, you need to include the two drivers for these two modules, and you’ll need to share a socket so you can’t reserve the socket in both drivers, and you need to change the Barometer module’s pin definition to reflect that we’re using pin4:
Was:

            this.XCLR = new GTI.DigitalOutput(socket, Socket.Pin.Three, false, this);

Change to:

            this.XCLR = new GTI.DigitalOutput(socket, Socket.Pin.Four, false, this);

Good luck !

(oh PS: you could always look at a second mainboard that has these on two different sockets, especially if that freaked you out :slight_smile: and Welcome to the forum !!! :slight_smile: :slight_smile: )


#7

Hi Brett, Architect,

Yes I am new to the forum and the Gadgeteer, but already a fan :slight_smile: Thanks for the engaged answers and looking at my issue seriously. Also freaking out is not the way of the developer :):slight_smile:
So no worries about that.

I think I will stick with this board for a while at least. So I need to figure this out with that board.

Sadly I am from Bulgaria and any delivery takes lot of time so I will try first with the Software I2C on the Y socket. I took the Barometer driver source code and I hope I will be able to spot where the changes needs to be done.
Architect, if you could give me more leads on that I will be very grateful!

Brett, thanks for the complete description!

If I don’t succeed with that I will go through your method. I just didn’t want to add any more hardware or wait too long and pay more for delivery than the modules price :slight_smile:

Anyway I will keep you informed on the progress.


#8

@ vgenev - You are welcome!

Take a look at the following driver from GHI for their ColorSense module. The sensor on that module uses I2C. GHI uses SoftwareI2C to communicate with the sensor:

That should be a good example to follow.


#9

@ Architect thank you!


#10

You are welcome! Make sure to share your SoftwareI2C version of the driver, when you are done with it. :smiley:


#11

Outch! I am using .NET MF 4.2 and softwareI2C seems to be missing there… Or I am missing something?


#12

I think I did - Gadgeteer.Interfaces.
But when I change the .NET MF version SoftwareI2C is not present there.


#13

It should be there. Here it is on codeplex:

http://gadgeteer.codeplex.com/SourceControl/latest#Main/GadgeteerCore/Libraries/Core/DaisyLink42/SoftwareI2C.cs


#14

You need to add reference for the following assembly:

C:\Program Files (x86)\Microsoft .NET Gadgeteer\Core\Assemblies.NET Micro Framework 4.2\Gadgeteer.DaisyLink.dll

Just a using statement is not enough.


#15

Thanks!

Adding DaisyLink as Reference did it :slight_smile:
Now digging deeper.


#16

Great! Good luck! :slight_smile:


#17

YES! Its working! :):):slight_smile:
Where should I upload this :):slight_smile:


#18

Codeshare:

https://www.ghielectronics.com/community/codeshare


#19

And its done :slight_smile:
https://www.ghielectronics.com/community/codeshare/entry/802


#20

All is left is for you, is to update your profile. :wink: