Nunchucky i2c logic level converting

by Rahatmaini on Wed Jan 02, 2013 3:15 pm

So the nunchucky is 3.3v. That's a problem because Arduino UNO is 5v. How do I use the 4-channel i2c safe bidirectional logic level converter? Adafruit has not given any instructions or tutorials on wiring it up with the nunchucky but rather just a data sheet that isn't very useful to me, because I am quite new to the arduino. Any help is appreciated. :D
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by Arctic_Eddie on Wed Jan 02, 2013 3:31 pm

If you're referring to item ID: 757 then this is how it's connected.

Both GND pins go to ground.

LV on the upper-left goes to the board 3.3V pin.

HV on the upper-right goes to the board 5V pin.

A 3.3V signal goes to any pin on the LV side.

A 5V signal goes to the corresponding pin on the HV side.

Therefore, whatever signal appears on one side will appear at the appropriate voltage on the other side.
Arctic_Eddie
 
Posts: 208
Joined: Tue Feb 28, 2012 5:01 pm
Location: St. Petersburg, FL

Re: Nunchucky i2c logic level converting

by Rahatmaini on Wed Jan 02, 2013 4:44 pm

I understand a little more but I am still confused about the A and B pins on either side. What connects to those. Also, after doing the right connections, do I need to worry about any additional software to regulate the voltage or will it just work out of the box and convert the voltages. Thanks again
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by Arctic_Eddie on Wed Jan 02, 2013 5:05 pm

The A pins can connect to four independent lines that expect or send a 3.3V logic signal. The B pins will connect to four lines that expect or send a 5V signal. You use only the pins you need to interface a 3.3V object to a 5V object. For example, B1 could connect to a processor's 5V SCL pin while the corresponding A1 could connect to an object expecting the same signal, SCL, but at a 3.3V level. You can use any of the four Ax/Bx pairs for any signal. The level conversion is electronic and entirely within the circuitry on the board. Your sketch does not have to do anything different. The board is the easiest way for a 5V object to talk to a 3.3V object in a bi-directional fashion. The software doesn't know it's happening.
Arctic_Eddie
 
Posts: 208
Joined: Tue Feb 28, 2012 5:01 pm
Location: St. Petersburg, FL

Re: Nunchucky i2c logic level converting

by Rahatmaini on Wed Jan 02, 2013 5:34 pm

Thanks so much! So just to be clear:

The HV connects to the Arduino Uno's 5V pin. The LV connects to the Arduino Uno's 3.3V pin (confused about that LV). Then A1 connects to 5V from the Arduino. And the B1 connects to the accessory's power pin that requires 3.3V. And the ground on the A side connects to the ground pin on the Arduino while the ground on the B side connects to the accessory's ground pin.

Sorry if I sound like a noob, but I did not even know what i2c was until a week or two ago. Thank you very much, you have been extremely helpful.
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by Rahatmaini on Wed Jan 02, 2013 5:35 pm

Sorry, replace A1 with B1 and vice versa on my last reply
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by Arctic_Eddie on Wed Jan 02, 2013 5:47 pm

The Ax/Bx pins are for signals only and are not intended to power an object. The HV pin goes to the Uno 5V pin and the LV pin goes to the Uno 3.3V pin. If you have an object that needs 3.3V at low current then it also goes to the Uno 3.3V pin. The onboard regulator can supply other objects but the current must be below 50mA. The Uno SCL and SDA pins, A5 and A4 respectively, would go to perhaps B1 and B2. The SCL and SDA pins of a 3.3V object would go to A1 and A2 respectively.
Arctic_Eddie
 
Posts: 208
Joined: Tue Feb 28, 2012 5:01 pm
Location: St. Petersburg, FL

Re: Nunchucky i2c logic level converting

by Rahatmaini on Wed Jan 02, 2013 6:43 pm

Is there a fritzing diagram or wiring picture for hooking this thing up?
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by Arctic_Eddie on Wed Jan 02, 2013 7:58 pm

Not that I know of. The Adafruit support team should be able to supply something. You will need to tell them exactly the two objects you want to connect via the level shifter board.
Arctic_Eddie
 
Posts: 208
Joined: Tue Feb 28, 2012 5:01 pm
Location: St. Petersburg, FL

Re: Nunchucky i2c logic level converting

by Rahatmaini on Wed Jan 02, 2013 9:07 pm

Do not know if Adafruit Support Team is reading this, but I need to connect the Nunchucky Breakout Board ( ID: 345 ) with the 4-Channel i2c Logic Level Converter ( ID: 757 ). How do I hook up this 3.3v logic board to the Arduino. Why can't I just use the 3.3v pin on the Uno? Confused about this topic, Arctic_Eddie you have been very helpful though, the forums could use a few more like you.
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by adafruit_support_bill on Thu Jan 03, 2013 6:07 am

This is a fairly simple device and Arctic Eddie has been providing you with good information. Assuming that you are powering the Nunchuck with the Arduino 3.3v supply:

5v supply (from the Arduino) -> Hv pin.
3.3v supply (from the Arduino) -> LV pin.
All grounds -> GND pin
Nunchucky Data -> A1
Arduino SDA -> B1
Nunchucky Clk -> A2
Arduino SCL -> B2
User avatar
adafruit_support_bill
 
Posts: 28909
Joined: Sat Feb 07, 2009 9:11 am

Re: Nunchucky i2c logic level converting

by Arctic_Eddie on Thu Jan 03, 2013 9:29 am

Maybe this will help. This was created this morning using KiCAD.
Attachments
Nunchucky.jpg
Uno/Nunchucky/LevelConvert
Nunchucky.jpg (158.48 KiB) Viewed 1180 times
Arctic_Eddie
 
Posts: 208
Joined: Tue Feb 28, 2012 5:01 pm
Location: St. Petersburg, FL

Re: Nunchucky i2c logic level converting

by Rahatmaini on Thu Jan 03, 2013 1:35 pm

Thanks so much Arctic_Eddie for that diagram. You have been extremely helpful, same with the Adafruit Support Team. Thanks!!
Rahatmaini
 
Posts: 165
Joined: Wed Aug 29, 2012 4:15 pm

Re: Nunchucky i2c logic level converting

by karl_34 on Thu Mar 28, 2013 7:24 am

Is it possible to power the nunchucky from a source other than the arduino's 3.3v or is it required to use the 5v and 3.3v from the arduino for i2c to work properly? (Using the same logic level converter above)
karl_34
 
Posts: 12
Joined: Wed Jan 16, 2013 1:19 pm

Re: Nunchucky i2c logic level converting

by adafruit_support_mike on Thu Mar 28, 2013 1:30 pm

You can power the nunchucky from a separate source. You just need to connect all the GND lines so all the devices can work from the same reference point.
When you void a product warranty, you give up your right to sue the manufacturer if something goes wrong and accept full responsibility for whatever happens next. And then you truly own the product.
User avatar
adafruit_support_mike
 
Posts: 9037
Joined: Thu Feb 11, 2010 1:51 pm