Go Down

Topic: First Time arduino/microcontroller user working with the LSM303C mag sensor (Read 13667 times) previous topic - next topic

GettingAlong

Also I have a another copy of the sensor I am using because eventually I want to be using them at the same time. Should I try and switch that out to see what happens?

Peter_n

I think it is safe to do so.
Use the usb connector to power the Arduino, and run the i2c scanner.

GettingAlong

#47
Aug 12, 2014, 09:24 pm Last Edit: Aug 12, 2014, 09:27 pm by GettingAlong Reason: 1
If this fails what do you think might be the issue? It would have to be nearly impossible to have two bad sensors unless the circuit is causing them the malfunction.


Peter_n

I'm sorry, but I don't know.
When I develop something, I try a few things to get some 'feeling' with it. So I buy often different things that do the same. When one thing is not working, I put it aside, and try something else with different hardware and software.

You do have a multimeter ? To measure that the level shifter has no 5V signals on the 3.3V side ?

GettingAlong

#49
Aug 12, 2014, 09:42 pm Last Edit: Aug 12, 2014, 10:27 pm by GettingAlong Reason: 1
I believe I have one laying around, if not I can run and pick one up. Sadly I am a student who had this project forced on him so I am basically having to learn to run before I learn to walk.

Also the I2C scanner sketch seems to be locked up because it got passed the first print statement and has not done anything else. Something tells me it shouldn't take 15 mins for this code to execute at least one full pass through. Added a few print statements and it starts the first iteration of the for loop but only makes 1 iteration and hangs.

This is where it hangs:

error = Wire.endTransmission();

Peter_n

When the i2c_scanner locks up, the SDA and SCL are shortcut to each other, or one of them is shortcut to ground.
Remove everything and run the i2c_scanner again. After that, connect the level shifter, run it again, and so on.

GettingAlong

So what you think is I have a short somewhere in my circuit?

GettingAlong

When I disconnect everything it runs fine, when I reconnect it hangs.


Hmmm for my SDA/SCL I have both plugged into the + rail on my breadboard. At the far end is where the LV of the level shifter is connected. The + rail is what I have everything plugged into that is related VDD.

Right after the SDA/SCL to VDD connections I connected wires to 2 horizontal rails and from there connected to the rail of the corresponding channel in the level shifter. I did that for both SDA and SCL. Each are seperate from each other so I don't think there are any shorts there.

Peter_n

I don't understand, can you make a photo of it ?
You should not connect SDA and SCL to the + rail of course.

GettingAlong

Yeah I get you a couple photos of the circuit I built. The SDA and SCL have to be tied to VDD_IO (through a resistor) according to the data sheet. VDD_IO and VDD are both connected to the + rail since that was the easiest.

GettingAlong

OK here is a picture(bad) I drew of my circuit on the breadboard. I only mapped out SCL/SDA for now since that is what is in question.


Peter_n

I'm sorry, but the drawing is confusing.
According to that drawing the chip VDD_IO is not connected, and SDA and SCL are connected to each other and both to 3.3V.

Do you have a multimeter ?

GettingAlong

#57
Aug 13, 2014, 02:50 am Last Edit: Aug 13, 2014, 02:57 am by GettingAlong Reason: 1
Oh wow that is totally wrong i apologize! I made SDA and SCL not connected to each other and VDD_IO is connected to 3.3V rail.
I now have a multimeter.

GettingAlong

#58
Aug 14, 2014, 05:55 pm Last Edit: Aug 14, 2014, 08:31 pm by GettingAlong Reason: 1
First off I'd like to thank you for all this help you've given me. Without it I'd probably still be staring at an empty breadboard.:D

Now I guess it is on to a little more interesting part of getting my code to work. But first like I said in the other thread you have any idea why the scanner would return device found at both 0x1D and 0x1E when 1E is the only device ?

Nevermind, it was just the accelerometer.

Go Up