I have an Arduino Micro with a 10-dof and sd break out board attached. It does not seem to be working properly.
I have double checked the wiring and everything appears to be hooked up correctly.
When I load an example sketch for the SD card "CardInfo" I get the "Initializing SD Card..." "...initialization failed". Yes, I changed the CS from 4 to 10 and verified the pin was connected to D10 on the Micro, and yes I verified the card was installed.
If I load the "testr" sketch for the 10-dof (it's adafruit) I get no serial output in the serial monitor.
If I load the "Blink" sketch i do indeed get the LED on the micro to blink as it should.
Prior to hardwiring to the Micro the SD and 10-DoF boards were used with an UNO and breadboard and they did work just fine.
Any thoughts on what I might be doing wrong? Do I have a bad controller? Not sure if anyone can see anything obvious in the photo.
Thank you in advance for your help.
Arduino Micro with SD and 10-DoF Problem
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- lexical43
- Posts: 24
- Joined: Tue Jun 24, 2014 6:10 pm
Arduino Micro with SD and 10-DoF Problem
- Attachments
-
- photo-1.JPG (463.89 KiB) Viewed 336 times
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Arduino Micro with SD and 10-DoF Problem
Did you try each device seperately on the micro before connecting them together? Where does your clock pin go?
- lexical43
- Posts: 24
- Joined: Tue Jun 24, 2014 6:10 pm
Re: Arduino Micro with SD and 10-DoF Problem
I did not test each board first, but I did disconnect the power lead from the 10-DoF board and no change.
The following is a listing of the pins:
SD Board:
CD (n/A)
CS -> D10
DI -> D11
DO -> D12
CLK -> D13
GND -> GND
5V -> 5V
10-DoF
VIN -> 5V
GND -> 5V
SCL -> D2
SDA -> D3
(remainder pins not used)
5V and GND are combined on both boards to same pin on Micro. Before I take the system apart and test with another board wanted to rule out something silly.
The following is a listing of the pins:
SD Board:
CD (n/A)
CS -> D10
DI -> D11
DO -> D12
CLK -> D13
GND -> GND
5V -> 5V
10-DoF
VIN -> 5V
GND -> 5V
SCL -> D2
SDA -> D3
(remainder pins not used)
5V and GND are combined on both boards to same pin on Micro. Before I take the system apart and test with another board wanted to rule out something silly.
- Franklin97355
- Posts: 23910
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Arduino Micro with SD and 10-DoF Problem
Data is 2, clock is 3.SCL -> D2
SDA -> D3
Try that.
- lexical43
- Posts: 24
- Joined: Tue Jun 24, 2014 6:10 pm
Re: Arduino Micro with SD and 10-DoF Problem
Turns out I was using the wrong wiring schematic. Thank you for the helping out! Much appreciated.
- analuno
- Posts: 1
- Joined: Thu Jul 23, 2015 11:46 am
Re: Arduino Micro with SD and 10-DoF Problem
I know it has been posted a long time ago but is it ok for you to post the code of 10DOF plugged to the SD card?
Thank you in advance.
Thank you in advance.
- lexical43
- Posts: 24
- Joined: Tue Jun 24, 2014 6:10 pm
Re: Arduino Micro with SD and 10-DoF Problem
Code: Select all
/***
Loggs all variables from all sesnors on the 10-DoF board
***/
#include <SD.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LSM303_U.h>
#include <Adafruit_L3GD20_U.h>
#include <Adafruit_BMP085_U.h>
#include <Adafruit_10DOF.h>
Adafruit_LSM303_Accel_Unified accel = Adafruit_LSM303_Accel_Unified(30301);
Adafruit_LSM303_Mag_Unified mag = Adafruit_LSM303_Mag_Unified(30302);
Adafruit_L3GD20_Unified gyro = Adafruit_L3GD20_Unified(20);
Adafruit_BMP085_Unified bmp = Adafruit_BMP085_Unified(18001);
const int chipSelect = 4;
const int baudRate = 115200;
const int Hrtz = 100;
float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;
float temperature;
void initSensors()
{
!accel.begin();
!mag.begin();
!gyro.begin();
!bmp.begin();
}
void setup()
{
//Initialize SD Card
pinMode(10,OUTPUT);
SD.begin(chipSelect);
File dataFile = SD.open("datalog.csv", FILE_WRITE);
//Print CSV file headers
if (dataFile) {
dataFile.print("Accel_X,Accel_Y,Accel_Z,");
dataFile.print("Mag_X,Mag_Y,Mag_Z,");
dataFile.print("Gyro_X,Gyro_Y,Gyro_Z,");
dataFile.println("Altitude");
dataFile.close();
}
//Initialize Sensors
initSensors();
}
void loop()
{
//Get new sensor event
sensors_event_t accel_event;
sensors_event_t mag_event;
sensors_event_t gyro_event;
sensors_event_t bmp_event;
accel.getEvent(&accel_event);
mag.getEvent(&mag_event);
gyro.getEvent(&gyro_event);
bmp.getEvent(&bmp_event);
bmp.getTemperature(&temperature);
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) {
dataFile.print(accel_event.acceleration.x);
dataFile.print(",");
dataFile.print(accel_event.acceleration.y);
dataFile.print(",");
dataFile.print(accel_event.acceleration.z);
dataFile.print(",");
dataFile.print(mag_event.magnetic.x);
dataFile.print(",");
dataFile.print(mag_event.magnetic.y);
dataFile.print(",");
dataFile.print(mag_event.magnetic.z);
dataFile.print(",");
dataFile.print(gyro_event.gyro.x);
dataFile.print(",");
dataFile.print(gyro_event.gyro.y);
dataFile.print(",");
dataFile.print(gyro_event.gyro.z);
dataFile.print(",");
dataFile.print(bmp.pressureToAltitude(seaLevelPressure,
bmp_event.pressure,
temperature));
dataFile.println(",");
dataFile.close();
Serial.print(accel_event.acceleration.x);
Serial.print(",");
Serial.print(accel_event.acceleration.y);
Serial.print(",");
Serial.print(accel_event.acceleration.z);
Serial.print(",");
Serial.print(mag_event.magnetic.x);
Serial.print(",");
Serial.print(mag_event.magnetic.y);
Serial.print(",");
Serial.print(mag_event.magnetic.z);
Serial.print(",");
Serial.print(gyro_event.gyro.x);
Serial.print(",");
Serial.print(gyro_event.gyro.y);
Serial.print(",");
Serial.print(gyro_event.gyro.z);
Serial.print(",");
Serial.print(bmp.pressureToAltitude(seaLevelPressure,
bmp_event.pressure,
temperature));
Serial.println(",");
}
// if the file isn't open, pop up an error:
else {
}
delay(Hrtz);
}
Please be positive and constructive with your questions and comments.