Community
cancel
Showing results for 
Search instead for 
Did you mean: 
RJidg
Novice
2,422 Views

Adxl 335 aceelerometer sensor connectivity with Sparkfun adc block.

Hello,

I working on a project that takes analog input from the accelerometer. I am using ADXL 335 accelerometer and Sparkfun ADC block to get values on Edison. I am not able to read accelerometer values or getting garbage. My circuit connection is followed:

pins on ADXL 335 sensor:

- Vcc pin to 3.3v from battery

- GND pin to ground of battery

- X pin to AIN0 on adc block

- Y pin to AIN1 on adc block

- Z pin to AIN2 on adc block

pins on Sparkfun adc block (pins from bottom to top):

- GND pin to GND from battery

- AIN0 pin to X pin on ADXL 335

- GND pin to GND from battery

- AIN1 pin to Y pin on ADXL 335

- GND pin to GND from battery

- AIN2 pin to Z pin on ADXL 335

- AIN3, GND pins are left floating.

I'm used library like:

1. https://github.com/sparkfun/SparkFun_ADC_Block_for_Edison_CPP_Library GitHub - sparkfun/SparkFun_ADC_Block_for_Edison_CPP_Library: C++ library and example for using SparkFun's ADC block for … 2

2. https://github.com/humberto-garza/SparkFunEdisonADC/tree/master/C%2B%2B SparkFunEdisonADC/C++ at master · humberto-garza/SparkFunEdisonADC · GitHub

First, library showing me the output result as -1 for function getRawResult(0); and second library pulling some random value which am I believing garbage.

I want help in to

1) correct my sensor to Sparkfun adc block connection, if wrong.

2) correct the code I'm following, if wrong.

3) any other references that help me to study correct myself what I am doing wrong.

Thanks in advance

Rahul

Tags (1)
0 Kudos
8 Replies
idata
Community Manager
92 Views

Hi Rahul,

 

 

I'm wondering if you've been able to make any other sensor work using this ADC block. Is this the case? If so, which sensor was it?

 

Also, make sure to use the latest Edison image. If you are already using the latest image, you can give a try a previous one, like this one: http://iotdk.intel.com/src/3.0/edison/iot-devkit-yp-poky-edison-20160315.zip http://iotdk.intel.com/src/3.0/edison/iot-devkit-yp-poky-edison-20160315.zip.

 

Where did you get the sensor? A similar sensor, ADXL 345 from Grove, is incompatible on the I2C bus of the Edison Arduino Expansion board and some other Breakout boards had also presented this issue, so I'm wondering if given that the ADC block connects to the Edison module using the I2C bus this might be causing the issue.

 

Take a look at this thread /thread/76438 https://communities.intel.com/thread/76438. It's a tutorial on how to use the ADC block with the Edison module (I believe you're using a library from this user also).

 

 

Regards,

 

-Pablo
RJidg
Novice
92 Views

Hello Pablo, thanks for the help.

I have to use the old Edison Linux image because of Also, I'm using http://cache.nxp.com/files/sensors/doc/data_sheet/FXLN83xxQ.pdf?pspll=1 http://cache.nxp.com/files/sensors/doc/data_sheet/FXLN83xxQ.pdf?pspll=1 accelerometer. Yesterday, I got few things worked out which are

1) I'm able to read analog voltages(x, y, z axis) at accelerometer output using multimeter.

2) I'm getting values using getRawResult(0) function.

So, currently, I'm verifying the values from accelerometer as I didn't know what that values are? How they are calibrated in the program? and how to measure their accuracy if values are correct?

I'm using below references:

http://www.ti.com.cn/cn/lit/ds/symlink/ads1015-q1.pdf http://www.ti.com.cn/cn/lit/ds/symlink/ads1015-q1.pdf

https://learn.sparkfun.com/tutorials/analog-to-digital-conversion Analog to Digital Conversion - learn.sparkfun.com

Please add any references if any, you know that will help me out to go further.

Thank you

Rahul

idata
Community Manager
92 Views

Hi Rahul,

 

 

Good to know that you were able to get values from the sensor. From my personal experience, one of the most challenging aspects when working with accelerometers or gyroscopes is to understand their values, and using the device itself is sometimes the best way to understand these readings, however, there are multiple guides or tutorials on the internet on how to use them.

 

I would suggest you to take a look at these links:

 

http://www.instructables.com/id/Accelerometer-Gyro-Tutorial/ http://www.instructables.com/id/Accelerometer-Gyro-Tutorial/

 

http://www.instructables.com/id/Accelerometer-Gyro-Tutorial/ http://www.instructables.com/id/Accelerometer-Gyro-Tutorial/

 

 

Regards,

 

-Pablo
idata
Community Manager
92 Views

Hi Rahul,

 

 

Do you have updates on this case?

 

 

Regards,

 

-Pablo
RJidg
Novice
92 Views

Hello Pablo,

Yeah, I got connectivity right and successfully getting values from sensor, thanks to your help and few friends here. Currently, I'm learning accelerometer and adc conversion theory to get accelerometer values right to my appilcation. Are their any references available to learn sampling of accelerometer values with given adc block? If you know any kind of material/references please post here.

Thanks you,

Rahul

RRobe17
New Contributor I
92 Views

I would be very interested in hearing what the issue was an dhow you resolved it. Seeing that you have it working you could provide others a big advantage if you post the solution to your question.

Thank you.

idata
Community Manager
92 Views

Hi Rahul,

 

 

I've been doing some research and didn't find documents or examples for sampling with the ADC block. I would suggest you to contact Sparkfun, they might have some sample code for this block.

 

Just as a reminder, you can also control the ADC block from the MCU, Jose has a tutorial for that too, /thread/76439 https://communities.intel.com/thread/76439.

 

 

Regards,

 

-Pablo
idata
Community Manager
92 Views

Hi Rahul,

 

 

Did you contact the Sparkfun Support team? What did they tell you?

 

 

Regards,

 

-Pablo
Reply