How to use the GPlug and reading voltage data from external component

Hi all,
I have a FEZ spider and the following modules (USB Client DP, LED7C, Button amongst others) and I want to create an electronic scale.

You put something on the scale, I take the measurement (in the form of voltage that is converted to weight) and then I push it to the USB where another application reading the data will use it to plot the graph (there is a lot I do not know about this but I’ll keep it to one question per post :slight_smile: )

My questions are

  1. How do I connect/setup the GPlug? I have two wires coming from the electronic scale.
  2. When the GPlug connection is done, how do I read the data? I already have the function to convert the voltage to weight so the question is on how to (within the code), read the voltage data that comes from the device and use this value with my converter to get the weight which will be transmitted via USB.

Thanks in advance.

I would suggest you start by looking at this

https://www.ghielectronics.com/docs/8/analog-inputs

1 Like

Hi Sprigo, that looks like exactly what I’m looking for. I’m test it and get back to you.

How does one connect external cables from a separate setup that detect voltage changes unto a GPlug then unto the main board. I will then use the link provided to read the analog input and display the voltages on the LCD.

https://www.ghielectronics.com/catalog/product/485

Take a look in the Catalog section.

well, you start by wiring up the external device to the plug, by matching the Gadgeteer socket type with the external device, and making sure the signals used match. Then you write code to talk to the device appropriately.

It will probably help to get you a more targeted answer if you tell us what device you’re talking about connecting.

The device I’m working on is an electronic weighing scale. When an object is placed on the scale, I get the signal as voltage. What I want to do is to connect the device to the FEZ Hydra board and then read the data so that I can display the weight and also save it when a button is pressed. I’m not really sure as to what to do since I’m very new to all this. I’m fine with the programming though.

ok, so you are really only now talking about the physical connection. The G-Plug have what is called a 0.1" pitch header, and you can either solder direct wires onto those (works, not easy to adjust if you get it wrong) or you can solder headers (either male or female, you choose) onto that and find a way to attach the opposite header onto your wires from the scale. I personally use male headers with female cables; I often cut a standard female-female jumper wire in half so I get two little stubs that I can solder onto loose wires and connect to the male header.

Either way you look at it, soldering will be required (for GPlugs, breakout modules, or extender modules). The screw-down connections on the module listed a few posts ago means all you need is a screwdriver.

Voltages. What output voltage does the scale output at maximum load ? You MUST not exceed 3.3v on an analog input pin otherwise you’ll damage the input pin.

1 Like

This will be a nice addition to the book I am working on. Give me few days :slight_smile:

Added something (book is still a draft in progress)
https://www.ghielectronics.com/downloads/Gadgeteer/NET_Gadgeteer_for_beginners.pdf

but I would like to details this more

Hi Gus, I just went through and it is looking good. If only I had this book before I started. Anyway, with the new windows 10 for raspberry pi 2 and gadgeteer, will the same code apply?
I’m planning on getting one when it come and will very much like to get more info from a book like yours before I start.

I am planning another book for windows 10. All comes when time is right :slight_smile: