Gemalto is now part of the Thales Group, find out more.

You are here

Thales IoT Developer Community

ConceptBoard: Java MultiADC

Tutorial, May 27, 2014 - 1:57pm, 7491 views

Concept Board: Java MultiADC
A quick example for using the Concept Board's ADC switch


The library and demo application were created by student workers at the Gemalto M2M Application Engineering department in Berlin - first of all Roman Wedemeier.



• Concept Board connected to a Windows 7 PC

• Jumper cable


• Eclipse Juno with MTJ installed

• Gemalto EHSx Software Development Kit


Getting Started

Create a new project and import and We will take a close look at the AdcTest class’s test routine:

	  * A simple test routine for the ADC and the ADC switch
	  * Iterates through the 4 ADC pins of the Concept Board and
	  * prints the values. 
	private void test() {
		int[] pins = {0,1,2,3};
		MultiADC multiAdc = null;
		try {
			multiAdc = new MultiADC("D2", pins);
		} catch (IllegalArgumentException e) {
			// TODO Auto-generated catch block
		} catch (IOException e) {
			// TODO Auto-generated catch block
		int currentVal;
		for (int i =0; i < pins.length;i++ ){
			currentVal = multiAdc.getValue(pins[i]);
			System.out.println("Pin: "+pins[i]+", Value: "+currentVal+"\n");
			try {
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
		try {
		} catch (IOException e) {
			// TODO Auto-generated catch block

First we generate an array of the pin numbers we want to use (in this case 0 to 3).                                                         

Afterwards we create MultiADC from the co-processor's I2C address byte “D2” and array of pins. It is used for switch between multiple external ADCPins defined in pins

The for-loop from iterates through the pins and prints out the measured value which has been read by multiAdc.getValue(index).

In each iteration the applications sleeps for 1 second.

At the end of the application the multiAdc is closed by multiAdc.release().

Start test application

To start the test application connect the ADC pins as follows.

A0 to GND

A1 to 5V

A2 to 3.3V

Then start the application .

Your output should look like this:

Registering ip address "" of remote debugging device...
Waiting for debug device registration of "IMP_NG_EHS5_REMOTE"...
Passing control to external device emulator...
Installing suite from:


Pin: 0, Value: 0

Pin: 1, Value: 1144

Pin: 2, Value: 793

Pin: 3, Value: 0


End of debug session. Emulator is closed!

Feel free to share your experience with the ADC and the test  Application :-)

Download File (zip | 3.59 KB)
Nice example! What in case the whole multiADC feature gets released? I can imagine that ADC is released, but is I2C selector also disabled so the control over ADC channels return to manual switch?
Hi, Via I2C you can release the ADC switch. So you can use the switches.

Very helpful.  Since we are using mutliple ADCs on the concept board, this is a great deal of help.  Except for my errors creating a new Midlet, it executed just as specified.



I want to know if there is any way to connect a current sensor to the EHS6T LAN modem. The current sensor gives an analog value and the thing that I wanna do is convert this value to digital value. 

Ones I finished the convertion, I want to send the digital value to a specific phone number.

Should I use AT commands or java ??

Thanks for the help.


Paul Mock's picture
Paul Mock