Let's Make Robots!

Arduino to RPi -- Optoisolated I2C

Optoisolator, i2c bridge, connects arduino and pi
AttachmentSize
ADUM1250ARZ_v.01.zip36.85 KB
Arduino_to_Pi_I2C_v2.zip1.07 KB

I've waited to finish incorporating my Raspberry Pi into my bot for an ample bit.  But since I know so little about electricity, I swore to myself I wouldn't add my Pi to my bot until I was absolutely sure I wouldn't fry it.  

Well, I'm still not "absolutely" sure, but I feel this little optoisolator has brought me a lot closer.  This builds on my post a week or so ago about making Eagle parts.

I plan to actually list out what tweaks a Wheezy image needs to get this optoisolator build to work.  It's actually pretty easy--but whatever you, don't be lured in by quick2wire.  Those buggers wasted most of my day :(

If anyone has questions let me know.

Oh, one note.  When I populated the board I used 4.7k resistors on the Arduino side, but I pulled off everything on the Raspberry Pi side.  It seems the Pi has built in pull-ups that do the job rather well.

 

Hope everyone is well :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I'm seriously thinking of using this chip now embedded on my controller board.

 

Thank you!!!

 

Well, if you're going to buy the chip it isn't worth it. I think the cheapest I found it was around $6 USD.  That on top of the $.85 for the board.

Badji has a really cheap solution he pointed out to me:

I2C Level Converter

I wanted galvanic isolation given how bad I am at prototyping.  I fry more boards than Hostess does genetically engineered starch.

Regarding your last part. The i2c lines on the P1 GPIO header do indeed have pullups already (I believe they are indeed 4.7k). The i2c lines on the P5 header (Model B revision 2 and Model A boards only) DO NOT have pullups. The same goes for the i2c on the CSI/DSI (I forget which it is that possesses a usable i2c bus, I think DSI but for now I'll refer to both).

The P5 i2c and the DSI i2c are actually the same bus, it is configurable which of the 2 connectors has i2c, if its routed to CSI/DSI then the i2c pins on P5 just become general GPIO. Route it to P5 and it becomes unusable via CSI/DSI.

 

The P5 gpio is unpopulated by default you need to solder headers on yourself, the numbering assumes headers coming from the bottom of the board not the top (where they would interfere with addon boards that sit directly on the P1 GPIO). But it is handy that it offers another i2c bus. 

I didn't know that about the second i2c header.  Thank you, sir.

I thought I had found the perfect chip but it weighs in at >$5 on DigiKey for singles so... that was that ;)

Did you get the chip as a sample from Analog Devices?

BTW: Technically it's not opto isolation, they're using little coils (much like in an isolation transformer with a 1:1 winding ratio) to isolate the lines. This makes the process easier and glitch free as the isolation transformers are bidirectional compared to opto couplers.

Regarding the "opto" isolation.  Trust me, I'm very intimate with this chip now.  She's my bitch lover. I know she runs on "magnetic isolation."  Oh, she's also hot-swappable, which is a lot less dirty than it sounds, but pretty nifty when it comes to prototyping.  

Even though "opto-isolator" is a misnomer it seems to be a common explanation of the chips function.  (Correct me if I'm wrong, but it seems like galvanic isolation seems less common.  Is it a tissue or a Kleenex, right?)

As for its price.  Sadly, yes, the chip is around $5 and $.81 for the board.  And again, yes, I got mine sampled.  Analog Devices is pretty good about responding to hobbyists' requests.  I believe they let you place two orders a month.  When I created this post I put "$.81-6.40" in the cost box, but it trimmed it down to ".81"  C'est la vie.

 

I didn't want to be a wise ass here, just for the record ;)

I gotta try and find another chip or sample this one, I want to create an isolated VGA/I2C adapter so I don't accidently fry my graphics card (especially in  a Laptop XD )

I don't have the need to optically isolate the various parts. I just use the I2C logic level converter as recommended by Philips (the I2C inventors). I have written a node about it: http://letsmakerobots.com/node/34444

I know you don't, Mr. Bajdi.  

I do. 

But, I think you might misunderstand the point of this board.  It wasn't logic conversion.  I wanted the board for two reasons.

1.  Rapid prototyping of RPi projects without fear my Pi will end up on this wall.

I know I'm not a professional; I'm a hack in the purest sense, learning through trials and errors.  I'm ok with it, but I don't want to wait 6-12 weeks for another Pi.  Or waste $35.  I like money.

2. Reduction of bulk.  One goal is to get everything as small as I can--unfortunately, the perfboard circuits are a little on the bulky side.  I realize I could recreate the circuit you describe with SMD components, but there is still the first goal to consider.

(3.  It was a component I sampled out of ignorance and was determined to keep from waste :)

I hope this reply is appears as respectful as I mean it.   Especially to you Mr. Bajdi, I'm still hacking my way through your expositions on using nrf24L01.  Good stuff.


Despite your warning I tried that for the TX/RX pins between Rpi & Bajduino and... well so far it worked, don't know if I'm going to regret it later, but for the time being.... ROCK ON \m/ :P