K8055 OutputAnalogChannel

I’m new to PC interfacing.
I haven’t yet purchased this module.

If I measured a voltage through the AD channel, I understand it will display a decimal number: 0 to 255.
How would I turn this number into the actual voltage measured, so my PC displayed the voltage at the analog input?

Thanks.

This is very easy conversion.
Here an example code in Visual Basic 2008:

Dim Data1 As Integer Dim Data2 As Integer ReadAllAnalog(Data1, Data2) Label8.Text = CStr(5 * Data1 / 255) + " V" Label9.Text = CStr(5 * Data2 / 255) + " V"

Measuring Higher Voltages

Ive read the max. voltage that can being read is 5V.

If I wanted to measure higher voltages, the simplest way I can think of is to use a potential divider to attenuate the voltage to less than 5V then write code so the PC would display actual measured voltage.

What are your/better solutions to measuring voltages greater than 5V.

Thank you.

Connect the voltage to the analog input via a series resistor. This resistor forms a voltage divider with the resistor R3 or R4 and trimmer potentiometer RV1 or RV2.
Using a 99k series resistor you can measure voltage up to 10V.
An alternative approach to achieve the same effect is to change the resistors R3 and R4 to 100k.
Please see the circuit diagram on p. 21 of the manual:
velleman.eu/downloads/0/illu … k_rev3.pdf

In the code example change ‘5’ to ‘10’:

Label8.Text = CStr(10 * Data1 / 255) + " V" Label9.Text = CStr(10 * Data2 / 255) + " V"

Thanks.

I think I understand.
Eg. If I were measuring 15V, I could change R3, R4 to 200k to get the +5V at non-inverting input?

[quote]Eg. If I were measuring 15V, I could change R3, R4 to 200k to get the +5V at non-inverting input?[/quote]Yes, this is true.

Display Resolution

5.0V / 255 = 19.6 mV ‘voltage steps’

Full-scale voltage output: 255 x 19.6 mV = 4.998V.

What is the max. display resolution after the translation code?

The displayed value is:
5.0V / 255 = 0.0196078431372549V ‘voltage steps’
Full-scale voltage output: 255 x 0.0196078431372549V = 5.0V

Hellow,

I would like to keep my actual P8055 board a lab-board. Is there a way to externalise the 15V adapter for testing and programming purposes ? I still don’t know if i will use this board or a 8061 for my application.

David.

Hello,

K8055 ADC 8-bit resolution.

Does this mean the best resolution would be 20 mV. (5V/255).

Would this mean a converted (ADC) voltage would be within +/- 20 mV of the actual meaursed voltage?

Thank you.

Hellow,

Yes, it is true. But in facts the precision is a bit less, depending on the resistors exact values (and precision, indeed).