# Cypress Developer CommunityTM

## Problem with getting acceleration

Summary: 4 Replies, Latest post by U2 on 21 Jun 2011 11:28 AM PDT
User
2 posts

Hello,

I`m working with a CY8Ckit-003.

How to interpretate the value gotten by the accelerometer? I`m using the ADC to convert the signal, but i need the value

in m/s for example. is there any way to get this value?

Cypress Employee
37 posts

You only can get delta m/s, since the value gotten by the accelerometer is nothing but a voltage singnal interpretated as acceleration-induced motion with a full-scale  range of /-2g (19.6 m/s/s). Datasheet of the accelerometer that the kit used:

http://www.kionix.com/Product-Specs/KXSC7-1050%20Specifications%20Rev%20...

Regards,

Roy

Cypress Employee
569 posts

The datasheet of the actual chip used, could be found here, http://www.kionix.com/Product-Specs/KXSC7-2050%20Specifications%20Rev%20.... The accelerometer gives out voltage proportional to the acceleration. Since it is a 3 axis accelerometer there are 3 voltages corresponding to each of these axes. The zero-g offset voltage is 1.65 volts when the chips is powered with 3.3 volts supply, which implies that the X and Y axes will measure 1.65 volts when the accelerometer is held howrizontal in the XY plane. The sensitivity of this accelerometer 660 mV/g, which effectively implies that when the accelerometer sees one g of acceleration the output voltage would be (1.65V 0.66V) or (1.65V - 0.66V). This voltage needs to be digitisded using the Delsig ADC on PSoC3. For a 12 bit configuration, single ended mode with VSSA-VDDA being the range, the smallest voltage that can be measure is 0.8 mV(1 count). If you measure a count of 2163 from ADC, then the measured voltage is (2163*8 mV =1.73 V).  Effectively the accelaration seen corresponds to the 0.08 Volt (1.73V -1.65V). The actual acceleration in g is now given by (80/660)g = 0.1212 g, which is equivalent to 1.187 m/s2. I hope this helps.

User
2 posts

Ok, i`m reading the ADC value in a uint16 variable. But the problem is that the function UART_PutChar have a uint8 parameter. This is my code:

uint16 accel;

uint8 *pointer;

pointer = &accel;

UART_PutArray(pointer,2);

But i think this isn`t working. Is that correct?

How can i send this value by uart component? Could you give me an example please?

Cypress Employee
569 posts
It would be helpful to debug the issue if you could throw some light on the following:
1. Is your UART working with PutChar function?
2. How are you seeing the UART output? Which kit are you using ?
3. Have you made sure that Global interrupt is enabled in your code
4. Have you used the API UART_Start() in the code before sending the data.