Go Down

Topic: ADIS16209 Interface on Arduino Uno (Read 4009 times) previous topic - next topic

Oskar92

Hi,

i got a problem on getting data of the accelerometer sensor ADIS16209 with my Arduino uno.

I just need the data to send it via uart seriell to my raspberry pi.


I searched for some examples but found just other sensors but didn't find the right one, which could help und transform the code for my project.

The sensor is more expensive and so the examples are very rare...:(


I have to connect the sensor to arduino via SPI. Tried some different codes. No one works correctly.

So i would really appreciate your help for connecting the accelero to the arduino and facing the data at the seriell display.

https://static5.arrow.com/pdfs/2017/12/6/6/51/48/931/adi_/manual/adis1620xpcb_1.jpg

Here i got the pins ..

the important ones are the DOUT, DIN, SCLK, Chip Select i don't need cause of just one sensor, Reset, GND and VDD..But how i have to connect it and how i have to write the code to get what i need. I'm helpless..:(


Help is really needed and apprecciated



pylon

Quote
I searched for some examples but found just other sensors but didn't find the right one, which could help und transform the code for my project.
Have you tried this code?

Quote
the important ones are the DOUT, DIN, SCLK, Chip Select i don't need cause of just one sensor, Reset, GND and VDD..But how i have to connect it and how i have to write the code to get what i need
Wrong, you need Chip Select even if you have just one chip. DOUT goes to MISO, DIN to MOSI, SCLK to SCLK and CS to any pin you like. RST to any pin, same for DR, GND to GND and VDD to 3V3.

Attention: if you have a 5V Arduino (you didn't mention the model, so we expect an UNO) you must use a level converter for all SPI signals, otherwise you might fry your chip (the datasheet doesn't explicitly specify this but in my experience this is a must).

The above example code use RST=4, DR=2, CS=7.

Oskar92

Thank you for your fast answer.

I got an UNO and a NANO. Both coming with 3,3v.

I tried that Code and got problems in reading data and facing it.
But i will try it again.

What is meant by DR? Searched for it when i tried the Code. But didnt find something expect "Dr. Arduino"..  :smiley-roll-blue:

pylon

Quote
I got an UNO and a NANO. Both coming with 3,3v.
Wrong, both are running on 5V. The fact that they have a pin providing 3V3 doesn't mean that the processor is using that voltage.

Quote
What is meant by DR?
The author of the library quotes this as a pin description. I guess it means data ready, it's connected to the DIO0 pin of the chip.

Oskar92

Control Registers
MSC_CTRL: 0
SENS_AVG: 0
SMPL_PRD: 0
PROD_ID: 0
STATUS: 0
 
Data Registers
XACCL: 0.00
YACCL: 0.00
 
XINCL: 0.00
YINCL: 0.00
ROT: 0.00
 
TEMP: 625.66
Supply: 0.00

now i get this output...what could be wrong? checked pins several times..

pylon

Quote
now i get this output...what could be wrong? checked pins several times..
Looks like a wiring problem. Did you use the exact example code (absolutely no modifications) of the linked library? Do you also use the development board from Analog Devices? If not, post schematics of your board and a wiring diagram.

Oskar92

#6
Jan 10, 2019, 07:10 pm Last Edit: Jan 10, 2019, 07:22 pm by Oskar92
I got that ADIS16209:
https://www.analog.com/en/products/adis16209.html#product-overview

Its an evaluation board.
I took the same wiring like he got on his pictures. and it fits with the datasheet pins i found in the internet.

Now i get this output:
Control Registers
MSC_CTRL: FF
SENS_AVG: FF
SMPL_PRD: FF
PROD_ID: -1
STATUS: FFFFFFFF
 
Data Registers
XACCL: 0.00
YACCL: 0.00
 
XINCL: 0.00
YINCL: 0.00
ROT: 0.00
 
TEMP: -1298.99
Supply: 5.00

edit. I use exactly the same code .. just changed the colours for better overview

I swear i use 3,3v ... dont know why it says 5v and i hope i doesnt destroyed it ..

edit2. tested it while using 3,3v pin of my nano with all other pins used by uno and it shows still 5v supply...

pylon

Quote
I swear i use 3,3v ... dont know why it says 5v and i hope i doesnt destroyed it ..
Because if the MCU reads only 1 bits, the result will be 5.0V. So your device is still not connected correctly or already damaged because you don't use a level converter. The UNO uses 5V for all it's pins (including the SPI interface).

Quote
Now i get this output:
What did you change that the output changed?

Oskar92

#8
Jan 10, 2019, 08:06 pm Last Edit: Jan 10, 2019, 08:11 pm by Oskar92
I ordered a Level converter. Shipped today so i will get it tomorrow ..

But the 3,3v pin .. if i use this i still got 5v???
Thats strangeā€¦


I tested the volts with my multimeter and got 3,24v ..

where gets the sensor the 5v? So if i have to use the level converter where i have to put it on?

I forget one pin on the second pinline on the sensor (J2) .. he took the 6th pin .. but i dont know why its needed .. in the datasheet its not declared what it can be used for..



pylon

Quote
But the 3,3v pin .. if i use this i still got 5v???
Thats strangeā€¦
No, read the datasheet and the code. If the chip is not responding correctly (signal MISO pulled high) the library will tell you the source voltage is 5V.

Quote
where gets the sensor the 5v? So if i have to use the level converter where i have to put it on?
No, that's not the reason, the reason is that the sensor runs on 3V3 and the processor runs on 5V.

Quote
I forget one pin on the second pinline on the sensor (J2) .. he took the 6th pin .. but i dont know why its needed .. in the datasheet its not declared what it can be used for..
No, he did not connect anything to pin 6, the only signal from J2 is DR and that connects to pin 2.

Oskar92

#10
Jan 11, 2019, 08:12 pm Last Edit: Jan 11, 2019, 08:40 pm by Oskar92
No, read the datasheet and the code. If the chip is not responding correctly (signal MISO pulled high) the library will tell you the source voltage is 5V.
Still got:
Control Registers
MSC_CTRL: FF
SENS_AVG: FF
SMPL_PRD: FF
PROD_ID: -1
STATUS: FFFFFFFF
 
Data Registers
XACCL: 0.00
YACCL: 0.00
 
XINCL: 0.00
YINCL: 0.00
ROT: 0.00
 
TEMP: -1298.99
Supply: 5.00


No, that's not the reason, the reason is that the sensor runs on 3V3 and the processor runs on 5V.
SO just for my Knowledge an extra levelshifter is integrated between processor and sensor?

No, he did not connect anything to pin 6, the only signal from J2 is DR and that connects to pin 2.
At the following picture of the original project you can see another cable at pin 6 of J2 DIO1. The orange cable is connected to pin 10 of the uno.

And know i dont know what i can still Change to get it work correctly..
I will draw my pin Connections with fritzing know and will check it again

Oskar92

That's what i got so far.
If i put J2 Pin 6 off nothing is changing.




Any ideas?  :(

Oskar92

Think i found the Problem now. youre Right. The Prozessor is running on 5v. few of the used Pins also usin 5v.

https://learn.adafruit.com/arduino-tips-tricks-and-techniques/3-3v-conversion

Thats a link of the guy who has written the example Code.
He is changing some parts to get 3,3v Overall.

I will Change my Project and will bring all Connections from sensor with a breadboard to the Arduino with a Level shifter. will see if it works.

pylon

Quote
At the following picture of the original project you can see another cable at pin 6 of J2 DIO1. The orange cable is connected to pin 10 of the uno.
Neither the documentation of the evaluation board nor the example source code mention this connection. I don't think it is necessary.

Quote
That's what i got so far.
If i put J2 Pin 6 off nothing is changing.
J2 the white wire is connected to signal 1 and not 12 as it should.

fire_on_line

#14
Jun 04, 2019, 04:52 pm Last Edit: Jun 04, 2019, 04:53 pm by fire_on_line
Hi
Did you have result?
I have some problem with adis16209

Go Up