Voltage with level shifter ~1.2V


50 posts   Page 1 of 2   1, 2
by chrney » Thu Nov 01, 2012 7:16 am
Hi all,

I am trying to get a regular 16x2 LCD display to work. My first step was to identify the device with i2cdetect. But - the display (with "built-in" I2C-board) isn't even lightened. This is my setup so far:

RPi 3v3 -> LV-pin on level shifter. HV on level shifter to display's VCC
RPI GND -> GND on level shifter. GND on level shifter to display's GND
GPIO0 and 1 -> A1, A2 on level shifter. B1, B2 to SDA and SDB on display

If I use the RPI's 3v3 directly to the display's VCC, it lightens and can be found with i2cdetect, but is pretty unsteady as the display needs 5V to work fine. When I am meassuring the voltage on the HV on the level shifter, it's just about 1.2V (3.3 on the LV-side, which is ok). Should the HV-side not show 5V? What am I doing wrong here?

I use this one: http://www.adafruit.com/products/757

Cheers,

Christoph
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by malakai » Thu Nov 01, 2012 7:26 am
What display are you using?

Here's the tutorial for a normal adafruit 16x2 display.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)
User avatar
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
by Grumpy Mike » Thu Nov 01, 2012 5:11 pm
It is likely that the display needs pull up resistors on the I2C lines on the 5V side if you have that level shifter in place it will stop the lines being pulled high.

So add two 4K7 pull up resistors directly on the display's line.
User avatar
Posts: 783
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by chrney » Thu Nov 01, 2012 6:05 pm
Malakai, it's this: http://www.ebay.com/itm/IIC-I2C-TWI-160 ... 0930073676

Mike, sorry, I am quite a noob with this stuff. Can you explain in detail what to put where, and how? Sorry again, I just started with this stuff. As I mentioned, on the "other side" of the level shifter, I can only meassure about 1.2V. I thought this thing should work the other way round, that it should convert 3.3V to 5V.

Thanks!

Christoph
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by chrney » Thu Nov 01, 2012 7:24 pm
malakai wrote:Here's the tutorial for a normal adafruit 16x2 display.


What link were you refering to, raspians.com?
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by Grumpy Mike » Thu Nov 01, 2012 9:43 pm
The level shifter does not convert voltages, that is if you only have 3V3 to start with it will not generate 5V for you. The I2C is a pull down protocol, that is the device talking to it will either connect the signal to ground or not connect it to anything. When it is not connected to anything it needs to be at 5V on your display. So you have to help the display signal "see" a 5V level by using a resistor with one end to 5V and the other to your signal. This is called pulling up.

You have on your display two signals SCK and SDA, you are connecting these two signals to your level shifter. In addition to this take a 4k7 resistor and connect one end to the SCK on your display and the other end to the +5V you are powering your display with. Repeat this for the SDA signal.
User avatar
Posts: 783
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by chrney » Fri Nov 02, 2012 4:54 am
Thanks a lot Mike!

One last thing, on what side of the level shifter do I put the resistors? HV?

Cheers,

Christoph
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by Grumpy Mike » Fri Nov 02, 2012 7:54 am
The Pi side has its own built in pull up resistors so you need to put them on the display side.
User avatar
Posts: 783
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by chrney » Fri Nov 02, 2012 9:02 am
Alright. I tried that, but cannot detect the device with i2cdetect. Other i2c-device work well, so it's more the display. This is my setup until now:

From RPi 5v [pin 2] to: a) 4k7-resistor 1, b) 4k7-resistor 2, c) LCD's VCC
From RPi GND [pin 6] to: level shifter GND one side. From level shifter GND other side to LCD's GND.
From RPi SDA0 [pin 3] to: level shifter A1. From level shifter B1 to: a) LCD's SDA and b) 4k7-resistor 1.
From RPi SCL0 [pin 5] to: level shifter A2. From level shifter B2 to: a) LCD's SCL and b) 4k7-resistor 2.

What am I missing here?
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by techpaul » Fri Nov 02, 2012 10:55 am
chrney wrote:Alright. I tried that, but cannot detect the device with i2cdetect. Other i2c-device work well, so it's more the display. This is my setup until now:

From RPi 5v [pin 2] to: a) 4k7-resistor 1, b) 4k7-resistor 2, c) LCD's VCC
From RPi GND [pin 6] to: level shifter GND one side. From level shifter GND other side to LCD's GND.
From RPi SDA0 [pin 3] to: level shifter A1. From level shifter B1 to: a) LCD's SDA and b) 4k7-resistor 1.
From RPi SCL0 [pin 5] to: level shifter A2. From level shifter B2 to: a) LCD's SCL and b) 4k7-resistor 2.

What am I missing here?

At a rough guess
From RPi 3V3 to level shifter LV pin
From RPi 5V to level shifter HV pin

No power to its pull ups or gate drive of FETs means it is not swtching on.

First add those wires, then without sending anything check with meter that idle condition measured with respect to GND has following voltages on Level Shifter pins (the voltages should be close to these not necessarily exact)

LV - 3V3
HV - 5V
A1 and A2 - 3V3
B1 and B2 5V

Check LCD pins relative to GND/0V of LCD and Rpi GND to be all sitting at 5V

Then try doing i2cdetect
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by techpaul » Fri Nov 02, 2012 10:56 am
Also check all GND pins on Level shifter are connected to be on safe side.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by chrney » Fri Nov 02, 2012 12:57 pm
thanks, will give that a try. From level shifter HV pin to the LCD's VCC then?
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by techpaul » Fri Nov 02, 2012 1:15 pm
chrney wrote:thanks, will give that a try. From level shifter HV pin to the LCD's VCC then?

Yes +5V to HV and LCD VCC and pullup resistors

+3V3 must be connected to Level shifter LV or it will not work.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by chrney » Fri Nov 02, 2012 1:25 pm
Alright. Will head home and give it a try. Thanks, again.

http://www.doctormonk.com/2012/08/led-c ... ry-pi.html uses a similar approach I just saw.
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by chrney » Fri Nov 02, 2012 6:57 pm
I tried this, and all the three pins of the LCD (VCC, SDA, SCL) are ~4.5V. Nevertheless, I cannot find the device using i2cdetect (I can find other devices with this command, so there's no problem there, I'd assume).

This is my setup:

RPi 5v -> Level Shifter HV + Resistor 4k7 no. 1 + Resistor 4k7 no. 2
RPi 3v3 -> Level Shifter LV
RPi SDA -> Level Shifter A3
RPi SCL -> Level Shifter A4
Level Shifter B3 -> LCD SDA + Resistor 4k7 no. 1
Level Shifter B4 -> LCD SCL + Resistor 4k7 no. 2
RPi GND -> Level Shifter GND.
Level Shifter GND -> LCD's GND

Any ideas what's wrong here? I can't figure out what more I could try.
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by techpaul » Fri Nov 02, 2012 8:04 pm
chrney wrote:I tried this, and all the three pins of the LCD (VCC, SDA, SCL) are ~4.5V. Nevertheless, I cannot find the device using i2cdetect (I can find other devices with this command, so there's no problem there, I'd assume).

This is my setup:

RPi 5v -> Level Shifter HV + Resistor 4k7 no. 1 + Resistor 4k7 no. 2
RPi 3v3 -> Level Shifter LV
RPi SDA -> Level Shifter A3
RPi SCL -> Level Shifter A4
Level Shifter B3 -> LCD SDA + Resistor 4k7 no. 1
Level Shifter B4 -> LCD SCL + Resistor 4k7 no. 2
RPi GND -> Level Shifter GND.
Level Shifter GND -> LCD's GND

Any ideas what's wrong here? I can't figure out what more I could try.

Now you have done that is basic electrical setup appears to be right.

When you do i2cdetect what exact command do you use?

If Rev 1 it should be i2cdetect -y 0
(i2c 0)

If Rev 2 it should be i2cdetect -y 1
(i2c 1)

As between revisions they changed which i2c was connected to the GPIO connector
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by chrney » Sat Nov 03, 2012 9:36 am
I use ic2detect -y 0 (the other one always hangs my Pi).
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by chrney » Sat Nov 03, 2012 1:33 pm
So, in this case I use the two pins below 3v3, right? Pin 3 and 5, that is?
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by techpaul » Sat Nov 03, 2012 1:54 pm
chrney wrote:So, in this case I use the two pins below 3v3, right? Pin 3 and 5, that is?

GPIO header pin 3 = SDA
GPIO header pin 5 = SCL

If other I2C devioces can be detected on that connector and it is a Rev 1 board then this is i2c-0

I assume you have got i2c software setup correctly as earlier you said i2cdetect -y 1 crashes the system. I would not expect this unless you mean by crash brings up an error.

Check your software installation, check the cabling if necessary measure the resistance of all connections make sure you have no open circuits or shorts to other signals, also check SCL and SDA are not swapped anywhere along the way.

This sort of thing works and have several I2C peripherals working through level translaters already no problems.
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by chrney » Sat Nov 03, 2012 3:07 pm
Thanks again!

Could I give it a try without the level shifter, to connect the 5v, pin 3 & 5 and GND to the LCD and run i2cdetect? Or would that blow up the board?

Yes, the computer is stuck, only thing that helps is to pull the plug when checking with i2cdetect -y 1.
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by techpaul » Sat Nov 03, 2012 11:09 pm
chrney wrote:Thanks again!

Could I give it a try without the level shifter, to connect the 5v, pin 3 & 5 and GND to the LCD and run i2cdetect? Or would that blow up the board?

If the display has no pullup resistors on it and can recognise around 3V as a logic 1 then yes. Check the datasheet.
Yes, the computer is stuck, only thing that helps is to pull the plug when checking with i2cdetect -y 1.

Just double checked this you have another fault somewhere if i2cdetect -y 1 crahses system, check your board for debris (top and bottom), check your power rail (TP1 and TP2) something else is wrong.

Have you got a load of USB stuff connected and lots on GPIO connector?
Just another techie on the net - For GPIO boards see http:///www.facebook.com/pcservicesreading
or http://www.pcserviceselectronics.co.uk/pi/
Posts: 1509
Joined: Sat Jul 14, 2012 6:40 pm
Location: Reading, UK
by chrney » Sun Nov 04, 2012 11:52 am
Just double checked this you have another fault somewhere if i2cdetect -y 1 crahses system, check your board for debris (top and bottom), check your power rail (TP1 and TP2) something else is wrong.


Looks just fine to me, unplugged and reassabled the whole case. Still the same issue :(.

Have you got a load of USB stuff connected and lots on GPIO connector?


Not a single one, I have just the mini-USB connected, and an ethernet cable, run everything through Putty using a PC.

I noticed one thing. I made the same setup as this: http://www.doctormonk.com/2012/08/led-c ... ry-pi.html now, and if I run i2cdetect, it finds my display on 0x27, as expected. But, the display itself is flickering like the LED of a network router. It's not the cabling though. If I go the webinterface (webiopio), the display does not flicker anymore, but it's neither detectable with i2cdetect anymore. In that case, only a reboot helps.

Strange, isn't it?
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by Grumpy Mike » Sun Nov 04, 2012 3:41 pm
It looks like you have not got things set up like you are describing them.
Can you post a clear picture of what you have so we can see the wiring.
User avatar
Posts: 783
Joined: Sat Sep 10, 2011 7:49 pm
Location: Manchester (England England)
by chrney » Sun Nov 04, 2012 6:45 pm
I tried to get a picture, but's it's really difficult to make it clear. Instead, I used Fritzing, hope this is okay as well:

http://i.imgur.com/pYRZ5.png

The four connectors on the LCD are actually those from the I2C-"board", which is soldered to the display itself, as seen in the eBay-link above.

Best regards,

Christoph
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm
by chrney » Sun Nov 04, 2012 7:10 pm
A bit cleaned up view:

http://i.imgur.com/xEVXV.png
Posts: 30
Joined: Sun Sep 23, 2012 4:46 pm