Nunchucky i2c logic level converting

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Nunchucky i2c logic level converting

Post by rahatmaini »

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

User avatar
arctic_eddie
 
Posts: 233
Joined: Tue Feb 28, 2012 6:01 pm

Re: Nunchucky i2c logic level converting

Post by arctic_eddie »

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.

User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Re: Nunchucky i2c logic level converting

Post by rahatmaini »

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

User avatar
arctic_eddie
 
Posts: 233
Joined: Tue Feb 28, 2012 6:01 pm

Re: Nunchucky i2c logic level converting

Post by arctic_eddie »

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.

User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Re: Nunchucky i2c logic level converting

Post by rahatmaini »

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.

User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Re: Nunchucky i2c logic level converting

Post by rahatmaini »

Sorry, replace A1 with B1 and vice versa on my last reply

User avatar
arctic_eddie
 
Posts: 233
Joined: Tue Feb 28, 2012 6:01 pm

Re: Nunchucky i2c logic level converting

Post by arctic_eddie »

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.

User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Re: Nunchucky i2c logic level converting

Post by rahatmaini »

Is there a fritzing diagram or wiring picture for hooking this thing up?

User avatar
arctic_eddie
 
Posts: 233
Joined: Tue Feb 28, 2012 6:01 pm

Re: Nunchucky i2c logic level converting

Post by arctic_eddie »

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.

User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Re: Nunchucky i2c logic level converting

Post by rahatmaini »

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.

User avatar
adafruit_support_bill
 
Posts: 88037
Joined: Sat Feb 07, 2009 10:11 am

Re: Nunchucky i2c logic level converting

Post by adafruit_support_bill »

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
arctic_eddie
 
Posts: 233
Joined: Tue Feb 28, 2012 6:01 pm

Re: Nunchucky i2c logic level converting

Post by arctic_eddie »

Maybe this will help. This was created this morning using KiCAD.
Attachments
Uno/Nunchucky/LevelConvert
Uno/Nunchucky/LevelConvert
Nunchucky.jpg (158.48 KiB) Viewed 1906 times

User avatar
rahatmaini
 
Posts: 176
Joined: Wed Aug 29, 2012 5:15 pm

Re: Nunchucky i2c logic level converting

Post by rahatmaini »

Thanks so much Arctic_Eddie for that diagram. You have been extremely helpful, same with the Adafruit Support Team. Thanks!!

User avatar
karl_nottkarl
 
Posts: 20
Joined: Wed Jan 16, 2013 2:19 pm

Re: Nunchucky i2c logic level converting

Post by karl_nottkarl »

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)

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Nunchucky i2c logic level converting

Post by adafruit_support_mike »

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.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”