TinyCircuits Forum

TinyCircuits Products => TinyDuino Processors & TinyShields => Topic started by: lorddamax on March 13, 2016, 02:20:33 PM

Title: Issues interfacing the tiny accelerometer with an Arduino Pro Mini
Post by: lorddamax on March 13, 2016, 02:20:33 PM
Needed an accelerometer for a project, and the tiny circuits accelerometer was the best price at the local retail store that carries some of this stuff. Never used an I2C item before, so after a bit of a learning curve, I got it hooked up. The arduino hung on initializing the board (the accel.begin line) then I realized I probably needed pullup resistors.

I went out and got two 4.7k resistors today and added them between the SDC and SDA lines and the VCC line (which is actually pin 12 on my arduino, so I can power it on and off as necessary. Given the extremely low current draw of the tinycircuits accel, this didn't seem to be an issue) and now the sketch starts up and runs without hanging.

Problem is - the only X/Y/Z readings that come in are -1.

What am I missing? What else do I need to do to get this to work with a standard arduino? Did I wire it incorrectly? VCC to pin 12 (which is on), GND to GND, and SCL and SDA to pins 4 and 5 (or the other way around, its not in front of me, I just know 4 and 5 are the SCL and SDA pins on the arduino), 4.7k pullup resistors on the SDA and SCL lines leading back to pin 12 (the accel's VCC for all intents and purposes)
Title: Re: Issues interfacing the tiny accelerometer with an Arduino Pro Mini
Post by: Ben Rose on March 14, 2016, 06:16:51 PM
May just be a typo, but make sure you are using A4/A5 for SDA/SCL, not 4/5. A4/A5 are two of the 'offset' pins on a Pro Mini if I believe, not inline with the other pins.

Additionally if you have a ASD2511 Rev4, the silkscreen is incorrect, and the warning on our product page does not seem to be visible any more. GND marking is correct, but the correct order is GND, VCC, SDA, SCL. I'll try to fix this on our product page tonight. Really sorry if this is what wasted time for you- we'd like to make this up.

You should not need pullup resistors on the SCL/SDA lines because they're built into the level shifter on our board(the Arduino also has internal pullup resistors, but they're fairly high resistance for I2C).
Title: Re: Issues interfacing the tiny accelerometer with an Arduino Pro Mini
Post by: lorddamax on March 14, 2016, 06:34:47 PM
May just be a typo, but make sure you are using A4/A5 for SDA/SCL, not 4/5. A4/A5 are two of the 'offset' pins on a Pro Mini if I believe, not inline with the other pins.

Additionally if you have a ASD2511 Rev4, the silkscreen is incorrect, and the warning on our product page does not seem to be visible any more. GND marking is correct, but the correct order is GND, VCC, SDA, SCL. I'll try to fix this on our product page tonight. Really sorry if this is what wasted time for you- we'd like to make this up.

You should not need pullup resistors on the SCL/SDA lines because they're built into the level shifter on our board(the Arduino also has internal pullup resistors, but they're fairly high resistance for I2C).

The 4/5 A4/A5 was a typo, but although I'm at work and don't have the board in front of me, I can say for sure that the issue is the silkscreen. I remember thinking it odd that VCC and GND were on the outside, and the SCL and SDA were in the middle. Going to head home and re-solder it. Any chance I toasted the board by hooking it up wrong?
Title: Re: Issues interfacing the tiny accelerometer with an Arduino Pro Mini
Post by: Ben Rose on March 14, 2016, 06:59:32 PM
Very little, the level shifter shouldn't be damaged that way. Let me know.

Thanks,
Ben
Title: Re: Issues interfacing the tiny accelerometer with an Arduino Pro Mini
Post by: lorddamax on March 14, 2016, 09:04:35 PM
Very little, the level shifter shouldn't be damaged that way. Let me know.

Thanks,
Ben

That was exactly the issue. I desoldered everything but GND, then moved them all down one, and what do ya know? I'm getting readings. Thanks for the heads up. Does suck I lost a weekend on it, but you saved me a trip to the store to get another (I was assuming it was bad, or I fried it not using the pullups)