Pages: [1]   Go Down
Author Topic: Mpr121 capacitative keypad w/ logic level converter  (Read 1301 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I've been trying to hook up a Mpr121 to my Arduino using a logic level converter and im having some problems. I'm quite new to this stuff so I apologize in advance. I can't seem to figure out which inputs I should send through the converter. If I'm using i2c, do I need to send the scl through the converter? Also I'm not sure how to deal with power and ground... do I use both the arduino's 5v and 3v3 outputs on both sides of the converter? And will they share the same ground? The code I'm using comes from this Bildr tutorial: http://bildr.org/?s=mpr121  , but my plan is to hook up other sensors to the system which is why I need to use the logic level converter... Thanks in advance, I've already fried 2 Mpr121's...   
Logged

Leeds, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was under the impression that i2c didn't require a voltage level converter as it is the pull-ups that provide the high voltage, and the SDA/SCL pins only connect the line to ground when required. Just use the 3v3 supply for the pull-ups, which I think are included on the board?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey thanks for the reply, yeah it works when I'm using 3v3 but the problem is I want to connect other sensors at the same time that require 5v.
Logged

Leeds, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Check page 43 of this PDF (i2c spec).

Does that help with the problem?

Link courtesy of this page.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes and no... I don't really know how to read schematics, but from the look of it I will need to separate power sources with separate ground? Can I use both 3v3 and 5v power from the arduino at the same time?
Logged

Leeds, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Always connect the grounds together, otherwise nothing will work properly.

To use this method, connect two appropriate MOSFETs (maybe a 2N7000?) in-line with the SDA and SCL lines, with their gate pins tied to 3v3. The source side should be towards the high voltage, the drain side to the 'high' 5v voltage.

As for using both 5v and 3v3 from the Arduino at the same time, yes you can, not a problem. A large breadboard which has the split power rails might be useful for this to help separate.

If you want to stick with the logic level converter, what's the part number?

Edit: If anyone can't be bothered to download the PDF, here is the circuit diagram. There is a textual description in the PDF which might be useful.


* dualvoltagei2c.jpg (29.3 KB, 677x348 - viewed 9 times.)
« Last Edit: September 17, 2011, 06:22:21 am by a.d » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I see, thanks. This is the logic level converter http://www.sparkfun.com/products/8745

I was pretty sure I did everything you said with the converter but I could be wrong. I'll buy another Mpr121 and hope for the best. Thanks for the help.



Logged

Leeds, UK
Offline Offline
Full Member
***
Karma: 0
Posts: 134
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

From the looks of the schematicon the SparkFun site you should use the two TX lines for the level conversion, and ignore the RX lines. Connect the 3v3 to the LV side, and the 5v to the HV side.

If this doesn't work, then there's something else wrong with the setup or the code.
Logged

Pages: [1]   Go Up
Jump to: