Hello,

It's my first time on this forum.

I want to connect an analog distance sensor for example the "OMT300-R200-IEP-IO-V1" to the XDK. I was wondering if i can do this with the adc pins (pin A10 and A11) on the extensionboard. I want to make a program that can measure the distance a few times per day and then save that information on the sd card or send it via wifi and temporary via kabel to the computer.

Is this possible and what do i need to make this connection? I do have a 24V sources aviable for the sensor but what more do i need to make the connection (resistors, kabels etc.)?

Thanks in advance!

0 (0 Stimmen)
RE: Sensor controlling with extensionboard
Antwort
15.10.18 07:12 als Antwort auf Jules van Horen.

Hello Jules,

I do some stuff with the ADC over Extensionboard, too. So i try to answer your questions.

So first of all i recommend to use the pin PD5 on extensionboard. This pin is channel 5 of ADC0. For fruther information about the pins i recommend the XDK110_ExtensionBus_Guide.

To programm some stuff with the ADC you have to use the EMLib library which is a really basic library. But at the moment there are no higher level API's available. A tutorial how to use the EMLib library can you find here : https://developer.appropos.de/ (you have to create an account first but its all free).

Then in the next step i see the sensor you want to use have an analog current output. So you have to messure the voltage over a resistence. Please notice the maximum voltage of the XDK pins are 2,5V. A higher voltage can destroy internal components.

On the apropos side (URL above) you can find some more tutorials e.g. how to store data on a SD card.

I hope that was a little bit helpfull.

Best regards

Christian

0 (0 Stimmen)
RE: Sensor controlling with extensionboard
Antwort
29.10.18 08:47 als Antwort auf Christian Köhler.
Hello Jules and Christian,

welcome to the XDK community, Jules!

Christian is right, due to your usage of an analog sensor, you should use the analog to digital converter (ADC0), which are PD5 and PD6 on the extension board.

The ADC guide, which can be found within the XDK knowledgebase after a click on Extension Bus and Analog to Digital Converter should help to solve your main ambition, to convert analog sensor data into digital values.

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)
RE: Sensor controlling with extensionboard
Antwort
26.10.18 13:33 als Antwort auf Franjo Stjepandic.

Thank you for your response!

I have a 24V power source for my sensor. I want to connect my sensor to a M12 splitter so that i connecit to both the 24V cable and the XDK. The max output of the Sensor is 20mA, so i want to connect the signal pin to a 125 ohm resistor so that the max voltage is equal to 2.5V. This connection can be seen in the inserted image. is this the right way to do it? 

And a second question, i read that the max current of the XDK is 100mA, so wouldn't it be a problem to connect a sensor to both ADC ports?

Thanks in advance!

With Kind regards,

Jules

0 (0 Stimmen)
RE: Sensor controlling with extensionboard
Antwort
29.10.18 16:04 als Antwort auf Jules van Horen.
Hello Jules,

Your construction regarding the XDK should be sufficient to get the full input voltage on the ADC with the current limit of 20 mA.

Regarding your second question, the maximal current of the XDK is 100 mA, if you are going to supply an externally attached device with power with one of the power supply pins.

The signal pins, such as the ADC pins, can only be used with maximum 20 mA per pins and in the sum of all signal pins on the extension bus 50 mA.

Furthermore, could you go more into detail about the sensor construction you are using to connect to the XDK? As far as I can observe, you are going directly with 24 V to the ADC pins of the XDK and to the external sensor. Should there not be data pins going from the external sensor to the ADC pins?

Please let me know if this was helpful and feel free to ask if you have further questions.

Kind regards,
Franjo
0 (0 Stimmen)