markocoheat
Posts: 4
Joined: Thu Oct 16, 2014 8:48 pm
Location: Cambridge
Contact: Website

Powering on/off Sainsmart 7" screens

Tue Dec 23, 2014 12:08 am

Hi folks,


Sainsmart 7" screens and HMDI converter boards:

http://www.sainsmart.com/7-inch-tft-lcd ... 2av-1.html

In finest Chinese tat tradition they come with no instructions whatsoever, but they're only £30+VAT (in small volumes) and we need 'em now rather than whenever the official 7" screens come out.


Application: smart thermostat interface for a research project


We'd like to leave the "touch" element powered all the time, power down the screen when not in use, and have it wake up on touch. Failing that we'd like to keep the screen on but kill the backlight. Sending "black" is no good because the backlight remains powered and will illuminate half a room...


It's easy to drive a switch from a GPIO output to turn the lot on and off. Unfortunately, when you power on the screen, it displays the Pi output but also flashes up with the words "HDMI" in the top left corner for a couple of seconds. This would look a little naff if it happened every time you touched the thermostat.


Has anybody used one of these screens in anger, and found a way to either disable this message, or at least kill the backlight without killing the display driver part of the screen?


Thanks,

--
M

drice
Posts: 19
Joined: Fri Dec 19, 2014 3:07 am

Re: Powering on/off Sainsmart 7" screens

Tue Dec 23, 2014 8:53 pm

Looking at the data sheet for the controller, it appears that pin 3 of the inverter connection controls the backlight. Have you tried disconnecting pin 3 to confirm if this turns the backlight off, then if it does, you could switch that line to turn the backlight on and off.

markocoheat
Posts: 4
Joined: Thu Oct 16, 2014 8:48 pm
Location: Cambridge
Contact: Website

Re: Powering on/off Sainsmart 7" screens

Sun Dec 28, 2014 11:54 pm

Hi drice,

Great tip; thanks!

I can confirm that if you ground pin3 via a 1k resistor the backlight is extinguished without resetting the display. Will try via a GPIO pin in due course but forsee no problems. Here's pin3 for the record:

Image

Larger image:
https://lh5.googleusercontent.com/-wlfD ... 234818.jpg

Disclaimer: correct for SainSmart driver boards as delivered 12/14. YMMV etc.

--
M

JimbO_o
Posts: 2
Joined: Sat Jan 31, 2015 12:26 am

Re: Powering on/off Sainsmart 7" screens

Sat Jan 31, 2015 12:29 am

Hey, quick question...

i bought the 9" version of yours and played around/ changed the settings to mode2 or something. anyway, the display now turns bright when turning it on and i'm unable to see/change anything...is there a button combination or so to reset the ground settings?

fhon
Posts: 12
Joined: Fri Mar 27, 2015 11:45 pm

Re: Powering on/off Sainsmart 7" screens

Tue Mar 31, 2015 5:19 pm

markocoheat wrote:Hi drice,

Great tip; thanks!

I can confirm that if you ground pin3 via a 1k resistor the backlight is extinguished without resetting the display. Will try via a GPIO pin in due course but forsee no problems. Here's pin3 for the record:

Image

Larger image:
https://lh5.googleusercontent.com/-wlfD ... 234818.jpg

Disclaimer: correct for SainSmart driver boards as delivered 12/14. YMMV etc.

--
M
This is exactly what I was looking for. Unfortunately I don't know what you mean by pin 3 and I can't see this image. Which pin are you talking about?

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Powering on/off Sainsmart 7" screens

Wed Apr 01, 2015 10:18 am

fhon wrote: This is exactly what I was looking for. Unfortunately I don't know what you mean by pin 3 and I can't see this image. Which pin are you talking about?
Here is the manual, on page 3 of the manual is the list of connections.

Connecter 11 is the inverter.

Page 8 defines the connections, Pins 1 & 2 are +12v, Pins 5 & 6 are GND, Pin 3 is Backlight control and Pin 4 is NC (Not Connected). I can't definitively say which of the two center pins is Pin 3 but you should have enough information now to figure it out (if it isn't printed on the board).
Doug.
Building Management Systems Engineer.

jweob
Posts: 31
Joined: Sun Jul 15, 2012 1:56 pm

Re: Powering on/off Sainsmart 7" screens

Thu Apr 16, 2015 4:10 am

Here's a new image showing the correct pin

Image

I've tested this and on my Pi it works with the GPIO without any additional components

Connected the ground pin (6) of the screen to the GPIO ground pin of the Pi (also 6) and the backlight control pin of the screen (3) directly to Pi GPIO4 (pin 7). I decided this was safe after measuring the voltage on the backlight control pin with various resistors connecting it to ground and found that max voltage (open circuit) was 3V. I wasn't sure what current would flow from the Pi into the backlight control pin with a high output on the GPIO, so to be safe I control the screen by switching between a GPIO Output Low (grounds the pin and turns screen off) and a GPIO Input (pin is pulled back up to 3V, screen goes on).

markocoheat
Posts: 4
Joined: Thu Oct 16, 2014 8:48 pm
Location: Cambridge
Contact: Website

Re: Powering on/off Sainsmart 7" screens

Fri May 15, 2015 9:24 am

A note on the aspect ratio of these screens, for those scratching their heads as to why stuff looks wrong:

Screen resolution is 800 x 480 pixels
This visible area is 154 x 86 mm

The screen has a display aspect ratio of 154:86. The storage aspect ratio is 800:480. The Pixel Aspect Ratio is therefore 1.075:

http://en.wikipedia.org/wiki/Pixel_aspect_ratio

This is not a standard in any shape or form. They were probably aiming for PAL (Pixel Aspect Ratio 1.09) and failing, or otherwise too heavy on the rice wine when designing this.


Workflow:

3) Design as if our display was 154:86 in Illustrator. If we were displaying raster images you'd take this output and save it as an Illustrator EPS. Then you create a new image in Photoshop at 800 x 480 pixels and set the Pixel Aspect Ratio (View, Pixel Aspect Ration, Custom Pixel Aspect Ratio) as 1.075. Open the EPS, select it, copy it into the new 800x480 image, and you'll end up with an appropriately squished image that when shown on this strange Chinese display is the correct aspect ratio.

4) If not using rasterised images and the Pi isn't aware that it's driving a screen with rectangular pixels? We need to create an SVG that looks squished on a square pixel screen but blows up to an undistorted rectangle when displayed on the PiStat. To do this we should:

A) Design as if our display was 154:86 in Illustrator (C)
B) Resize the lot in the horizontal dimension to 93% of original (D)

Calculation for this 93% is: (86*800/480)/154

C) save as SVG. (E) Tell the innocent Pi to display it as if it were using square pixels. It comes out right.


Hope this helps somebody.

Return to “General discussion”