Pages: [1]   Go Down
Author Topic: need to connect 5 adxl335's with leonardo  (Read 480 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i am new to arduino. i am presently doing a college project. for that i need to connect 5 adxl335's to my leonardo.is that possible? if yes then how?
also i need to compare the values obtained from my sensors to standard values saved in a database. how can i do that?
urgent help required.
thank you.
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That device has 3 analog outputs, so for 5 of them you need to read 15 different analog signals. The Leonardo has only 12 analog inputs, so you need another 3. The easiest approach is to add a CD4051 multiplexer, which lets you expand any one of those 12 inputs to 8 inputs.

Regarding standard values saved in a "database", if you want to do the comparison on the Arduino itself, then I suggest you store those standard values in EEPROM.

EDIT: it might be better to use ADXL345 instead, then you can read them all using the SPI bus. You'll need to use 15 of the 20 digital I/O pins for the CS signals. If this is too much you can use a demultplexer such as 74HC4515 to generate them from 4 pins instead
« Last Edit: February 09, 2013, 06:07:44 am by dc42 » Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a lot for the response. It was really helpful. The problem is that only 335 was readily available in the shops nearby and I needed them urgently. Secondly I don't want to do comparisons on arduino. I want to do them with the database values only. Can I do them by saving values in csv format?
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 220
Posts: 6587
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, just write the value to the serial port with commas between the values, and put a newline after each complete set of values. Then write a program for the PC that reads the data and compares it with the database.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Pages: [1]   Go Up
Jump to: