Asked — Edited

I2c Help, Please.

It was hard to get the compass installed because of the short length of wires. But, I finally did it. Now, the Compass works. But, when I change directions or if it is on for about 5 to 10 seconds , after giving me directions, it disconnects the wireless from the EZ board.

weird, do you think I need some pullup or down resistors? Is this what is happening. do you have these resistors built into the EZB or do we have to add them?

mel


ARC Pro

Upgrade to ARC Pro

Experience the transformation – subscribe to Synthiam ARC Pro and watch your robot evolve into a marvel of innovation and intelligence.

PRO
Synthiam
#1  

You do not need resistors. Your wires are either too long, or they are picking up signals from each other. Wires are the wrong way to use the compass module because i2c can be flaky. You'll want to mount on a breadboard like i had done - or wait for the ez-bit

#2  

they are about an inch to 2".

Also, when I hooked my ping up, the motor in the servo moved, but both 04's are showing 255 distance and won't pickup the distance.

I will experiment some more. how did you do your bread board. You had said it has to be short wires so that is why I wired them directly.

sorry to have so many questions.

Thanks,

Mel

PRO
Synthiam
#3  

2" may be too long. don't ever appologize for questions:)

#4  

thanks, I am going to go back and watch the tutorials.

#5  

OK, I have figured out the PING problem. I have wired several PING systems in the past and so I wired them for the Ping and put the extra wire as an echo. But I should've wired them for the HC_SR04. Silly Me.

The Ping is working now, but the problem still exist on the compass. I have to give it some more thought and read more posts and tutorials. Let me know if you think of something I can try.

As always, Thanks,

Mel

#6  

*** THIS IS ABOUT THE COMPASS PROBLEM. PING PROBLEM FIXED. ****

I have measured the wires and they are one inch long. The SURE people says that the wires can be upto 3" without a problem. What else can i do? Thanks,

Mel

United Kingdom
#7  

Pop the compass wires through ferrite beads

#8  

Have you done this before? I could probably do this. Thanks for the idea. Do you mean all four wires or just the two signal wires without hot and ground?

United Kingdom
#9  

Nope just the signal wires. Its just an idea if noise pick up is the problem I would like to add a compass module but not the Sure one I would prefer the HMC6352 based product which you can get with a breakout board and is readily available in the UK. They are both Honeywell chip sets but the Sure one looks a lot older with virtually no info to download about it on the Net.

#11  

Oh, BTW, I don't think the ferrite bead is conductive? I don't think so. I don't have to worry about it shorting out the EZB? I guess it is save to lay on top of the board's components if necessary. What do you think?

United Kingdom
#12  

I would put some insulating tape over the beads if you try it to be sure

Are you powering the compass from +5v with port D0 try using the 3.3v (check EZ-B diagram) instead its just an idea from what you describe it doesn't sound like an I2C fault if it works for a few seconds. How frustrating

#13  

I am using the I2C interface SDA,SCL,+5volts,Ground.

#14  

HERE is an Update on the Compass. I put a Tant cap from +5 to ground. It had no effect whatsoever on the bluetooth being unhooked after 5-10 secs.

Later on today if I can find a couple of ferrite beads, I will put them on the signal lines.

It works GREAT for 5-10 secs.

:-(

D.J. What do you think??

#15  

MORE: I tried the Local RadioShack and they did not even know what ferrite beads were. :-(

I guess my only other option is to go with a resistor from +5 to each signal line. If that don't fix the problem, I am Shunked!

:-(

PRO
Synthiam
#16  

I dunno, our EZ-Bit works great.:)

#17  

Good News!!! I placed a pullup resistor from signal to +5 on both signal lines. It has been working flawlessly for 30 minutes now. I am so happy because it is a neat program. Now, I was wondering about set and reset. I understand what the offset is.

PRO
Synthiam
#18  

Nice! What ohm resistors did you use?

#19  

The two 10K ohm resistors did the trick. it has worked for over 2 hours. And, it is pretty accurate on directions. It is Fun to play with.

:-)

Netherlands
#20  

Is it possible connect different devices to I2C? Lets say I want to connect a gyroscope and a compass, Can both be connected to the same I2C bus?

#21  

You are supposed to be able to connect many devices in parallel with two signal wires and supply them with vcc and ground.

United Kingdom
#22  

Isn't the limit 254 or something like that

Netherlands
#23  

Wow,thats quite a lot actually. Im not sure, Im going to just think out loud here for a bit..

I want my Robot to keep itself leveled. But I get confused about wether to use a tilt sensor, a gyroscope or accelerometer, theres even 9 dof inertial measurment units that include both gyro and accelerometers. I would also like to give it a sense of direction and have thought about trying to connect a compass, but I only have so many ports. Some compasses have built in accelerometers for tilt compensation for the compass. So the sky is basically the limit for how complex and advanced I want it to be...heck It may even be possible to use a GPS system just to give it bearing on north or south etc. but its not like its going to travel the world or even go beyond my garage, and still I only have so many ports.

In theory I could use the I2C header to connect on there whatever and however many I want to connect to it but I have no experience with I2C. Im sure I can make the appropriate connections between the header and the various devices but how am I going to control it? Espescially when theres several different devices hooked up to it. I can get my hands on amazing little sensors and things but if I have no idea how to work with and translate the data and values of these devices, should I even go there? I can understand analog connections but I only have 4 available analog ports, the other 4 are taken by pressure sensors under the feet.

So I can hook up a basic 2 or 3 axis analog gyroscope on ADC to keep it leveled. I can probably figure out how to use the signals from an analog device and use that within ARC to control the servo's in some way. And maybe the Z axis of a Gyroscope can function as a means of giving it direction, isnt that possible? If not then I will need a compass. I do not want to use the Serial I/O ports because the few I have left are reserved for ultrasonic ping sensors. But with I2C Im guessing its not like I can just open up an ADC window within ARC to see a range of values as the data that comes out. I have no clue what kind of data to expect, how to read let alone control it, or even what to do with it.

umm, Im just trying to get a realistic idea of the options that I have. The question I suppose Im wondering about is to what level will using I2C devices require coding experience? Will I need to have a general understanding of VB or C+ coding languages?

United Kingdom
#24  

DJ keeps hinting about something called EZBit its an addon and could be what you need but we don't know yet?

Netherlands
#25  

Yes I've noticed the mentioning of EZ-Bits and it sounds like a solution to a lot of things Ive been wondering about. Though Im not quite sure when to expect it to be available for purchase. When it is I will certainly be placing another order. :D

..though Im still curious about the I2C connection. I really only need a Compass and accelerometer to keep it leveled and a sense of direction. I can get a single compass with 3 axis accelerometer that allows reading the raw data of all these components and would in theory be all I need to both purposes. the only thing standing in my way is a lack of understanding of how to work with I2C devices.

I want to keep it as minimal as possible and wont be adding much more, other then possibly the wireless camera. So if I can keep it leveled and a sense of direction with 1 device on the I2C header, that would be ideal.

Is it possible to control and read I2C devices with ARC? I can probaby find example code on this device in VB or something and use the VB scriptwindow in ARC and maybe go from there. But if I am facing thousands of lines of advanced coding just to manually be setting the right slave and master adresses, then Im not sure how far I want to go with that. If it is too complicated for me than maybe I should infact wait for the EZ-Bit and stick with using just analog and serial devices that are somewhat easily accesible through ARC.

#26  

Ever I2C device has a byte address so 127 I2C devices can be attached to one bus. Each device has multiple registers where the data can be read or write to, not all registers can be write to. There are spliting in data registers that require 2 bytes instead of one in this case they are split into register high and register low where the user must read both registers and then combine the two using shifting and an or operator. I believe there should be a func onder scripting to allow for i2c(address,register) however their is a certain way in order to access each register based on whether reading or writing, this deals with the reading and writing bit that must be set when accessing the registers.

PRO
Synthiam
#27  

7-bit addressing for i2c (8th bit is for direction). You can read about it here: https://synthiam.com/Tutorials/Hardware.aspx and there is a link within that page for more information here: https://synthiam.com/Community/Questions/322

The first EZ-Bit (compass module) is sent to the printers for our prototype. I should have that in a few days, then it'll be mass produced within a week if all tests are GO.

I'm surprised you needed pull-up for the module because the ez-b has pull-up's on the i2c interface already. plus, the compass module datasheet says it has pull-ups. That's a lot of pull-up's:) It's almost an ultimate wedgy for i2c!:D

#28  

Hey Group, I too am working on a sure I2C compass. I did everything you all have suggested and no more than 10 seconds of compass readings and then the Ez-B Bluetooth starts blinking and then the Ez-B white led turns from solid lit to blinking and the board disconnects and the ARC locks up. I think it's my Mini ITX. I don't think it has the possessor power it needs. It most likely the same issue why I can't run 2 web cams as well. I will keep you all posted on my progress.

PRO
Synthiam
#29  

Sounds like the wires are too long. I2c is goofy. Some devices need short wires. Some need long. Some need the wires separated from positive and gnd. Others need additional resistors for pull-up.

First try shortening the wires. This thread will cove that if you read some of the posts I believe. If my memory works:)

#30  

Thanks DJ and all the others, Yeh I know and under stand from reading everybody's issues. My signal wires are 3/4" to 1" long with farite beads on them with 10k ohm pull up resistors from the I2C 5v to each of the signal wires. It might be an RF issue as well. My mini ITX ,the EZ-B, the wifi card, the compass module and the PC's bluetooth dongle are all on top of each other. I am going to try using my netbook to run the robot and see if that make a difference. My netbook has more power then the ITX I build for the robot thats onboard. I will let you all know on my findings. The easy thing to do now is to eliminate the onboard pc with an external one. I talked to you be for DJ about the dual web cam. My onboard ITX doesn't have the horsepower to run 2 web cams , but my netbook can. So my thinking is that it might the same for the the I2C compass module as well. Thanks again for all the help and DJ, your the greatest. Thank you

#31  

Hello all, This update on my progress. I disconnected the robots onboard pc and connected it to my external netbook. No change. The ARC and the EZ-B run fine until I insert any of the I2C controls. As soon as I do, 10 seconds of reading and the ARC locks up, The EZ-B Bluetooth stars flashing and the EZ-B whit light goes out completely. Then I have to ctrl/alt-del to close ARC. Remove the power to the EZ-B and restart everything and the same thing happens. Now I saw a post to put the 10K ohm resistors from signals to ground. Tried that too with the same outcome. I have also got power and ground from another location on the EZ-B. No change. I guess today I am going to Radio Shack to find a PC board to mount the compass module. As of now, I am using a proto board. That might be what is giving me the effects of longer wires. Any ways I will keep you all posted.