I'm currently building a circuit to control 10 servos using a wii nunchuk. I'm having some issues finding a level shifter that can read the analogue data from the nunchuk, as the rest of the circuit runs on 5v and the nunchuk 3.3v. Would I be able to just use both power and ground pins on the Arduino instead, completely bypassing the need for a shifter? I've included a diagram of my circuit, please feel free to ask any questions if extra context is needed.
For a very short time period this will work without a level shifter till the Uno sends a 5V signal to the 3.3V device. You should be able to get away with a simple resistor divider network as a level shifter.
I'm on about using the 3.3v pin for just the nunchuk sorry. In the diagram the 5v shouldn't even make contact with the nunchuk. I'm just asking if I can use both sets of power pins on the arduino at once to get around the issue.
Do you know if I can use both pins at once please? I'm finding little confirmation while researching, so would love to double check that it's safe to do so here.
Powering the nunchuk with 3.3V does not eliminate the need for a level shifter between the 5V logic level of the UNO and the 3.3V logic level of the nunchuk.
I purchased the official SparkFun level convertor but only realised it dealt with just digital signals once it was too late. Does your one work with analogue, or how could I tell? Thanks for the suggestion. I'm hoping to avoid purchasing another board if I can as I don't have much longer on the project, but I will if I need it to be safe.
I did also purchase and try to use this board, but I couldn't get any data to read from it. The code worked fine and I could see feedback without the shifter, but as soon as I tried to wire it in it just wouldn't work
The 3.3v pin on the Arduino is a power output pin, the nunchuck's 3.3V pin is a power input pin. Therefore, your connection wire from UNO 3.3V to nunchuck 3.3V looks good.
Its the SDA and SCL I2C signals that have issue from 5V levels at the UNO to 3.3V levels at the nunchuck. Therefore, a logic level converter is needed.
The I2C signals are digital. They are transmitting analog data that has already been converted digital logic levels. No analog voltages are used in the interface.
As I said above, I just can't seem to get it to function. I tried setting up the circuit repeatedly to make sure I wasn't placing wires in the wrong place but had no luck. Hence why I tried the sparkfun one, it was just my fault I didn't check it accepted analogue signals
Using the sparkfun board does return the data, but it comes back with the wrong data. It's still sending numbers, but they are a few times larger than what they should be, or seemingly random. For example, the joystick x value would read in the minuses or in the 2000s in its neutral state, but without the shifter it reads normally at about 130. Same for the two buttons, they randomly read as pushed when they haven't been.
I only found out this morning that the nunchuk uses an analogue joystick, sorry. As I'm not sure what else could be causing my issues, I thought it may have caused the problem. Several tutorials I've looked through use the data and clock pins but don't seem to run into the problem. Sorry if I've caused any confusion if I'm wrong, I'm new to the world of i2c compatibility