In the next following steps, you will make a DIY "TV" with code for a smart remote, and actually play videos and even possibly connect the smart remote to the actual motherboard.



Solid and not flimsy stabilizer

a ruler

TFT Display

Arduino board and LCD display

Back light-up

Tape/other adhesive

Hot glue gun

Card stock or hard paper of some kind

C environment for coding

Optional: Smart remote, and/or smartphone or Samsung

Step 1: Get a Programmable LCD Screen (made by 3 Fifth Graders)

I had found mine (that wasn't programmable) from a medicine commercial, never get these custom made LCD screens with boards, if you get a really good LCD or TFT display, there can be many other purposes for it. Get a used one or one that might be free or isn't used yet, although get one that at least has a color screen. If you have a custom made board (like me), then takeout the output plug and plug it into a programmable board.

Step 2: Starting Your Build (Step 1)

Look at the picture at the beginning of the step, this picture is basically telling what you are going to build in this step. Let's begin.

Your TFT display should have a glass piece that can be moved from the side at an angle, put it to a 90 degree angle, so that the back light up is perpendicular to the glass piece. Now that the Display is in place, you can find the length and width of the foil and cardboard piece that will be reflecting the light rays. (Use Pythagoras's theorem.) In the next couple of pictures, it shows me building the first part of the TV. You won't have the same exact measurements as me, so first measure the length and width and make the foil piece with some type of stabilizer. As you can see as the last picture above, I have the piece of foil cut out with scissors and is ready to be put on s stabilizer. For the stabilizer, I used card stock and taped it on, you could also staple it.

Step 3: Attaching the Mirror

Take your mirror and hot glue it to the TFT display and the back light-up at the angle shown in the last step on the drawing. Be careful with it because you won't want to hot glue the glass or cause it to deform, I suggest to put the hot glue on the tip of the mirror and then wait for a couple seconds and put it on to the TFT display at the right angle, then you can hot glue the bottom of the mirror to the Back light-up.

Step 4: Doing the Coding and Connecting the Smart Remote

The next step is technically the hardest, the coding. Don't read all of the code here, this code is in the code language C, get an environment to program a board with the Receiver that receives the waves from the smart remote, I have a smart remote form and Osepp kit and it is compatible with arduino. Copy this code on to your environment and program it to the arduino or board that is connected to the LCD screen/TV.


LCD-AVR-4d.c - Use an HD44780U based LCD with an Atmel ATmega processor Copyright (C) 2013 Donald Weiman (weimandn@alfredstate.edu) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /**************************************************************************** File: LCD-AVR-4d.c Date: September 16, 2013 Target: ATmega328 Compiler: avr-gcc (AVR Studio 6) Author: Donald Weiman Summary: 4-bit data interface, busy flag not implemented. Any LCD pin can be connected to any available I/O port. Includes a simple write string routine. */ /******************************* Program Notes ****************************** This program uses a 4-bit data interface but does not use the busy flag to determine when the LCD controller is ready. The LCD RW line (pin 5) is not connected to the uP and it must be connected to GND for the program to function. All time delays are longer than those specified in most datasheets in order to accommodate slower than normal LCD modules. This requirement is well documented but almost always ignored. The information is in a note at the bottom of the right hand (Execution Time) column of the instruction set. *************************************************************************** The four data lines as well as the two control lines may be implemented on any available I/O pin of any port. These are the connections used for this program: ----------- ---------- | ATmega328 | | LCD | | | | | | PD7|---------------->|D7 | | PD6|---------------->|D6 | | PD5|---------------->|D5 | | PD4|---------------->|D4 | | | |D3 | | | |D2 | | | |D1 | | | |D0 | | | | | | PB1|---------------->|E | | | GND --->|RW | | PB0|---------------->|RS | ----------- ---------- **************************************************************************/

#define F_CPU 16000000UL

#include #include

// LCD interface (should agree with the diagram above) // make sure that the LCD RW pin is connected to GND #define lcd_D7_port PORTD // lcd D7 connection #define lcd_D7_bit PORTD7 #define lcd_D7_ddr DDRD

#define lcd_D6_port PORTD // lcd D6 connection #define lcd_D6_bit PORTD6 #define lcd_D6_ddr DDRD

#define lcd_D5_port PORTD // lcd D5 connection #define lcd_D5_bit PORTD5 #define lcd_D5_ddr DDRD

#define lcd_D4_port PORTD // lcd D4 connection #define lcd_D4_bit PORTD4 #define lcd_D4_ddr DDRD

#define lcd_E_port PORTB // lcd Enable pin #define lcd_E_bit PORTB1 #define lcd_E_ddr DDRB

#define lcd_RS_port PORTB // lcd Register Select pin #define lcd_RS_bit PORTB0 #define lcd_RS_ddr DDRB

// LCD module information #define lcd_LineOne 0x00 // start of line 1 #define lcd_LineTwo 0x40 // start of line 2 //#define lcd_LineThree 0x14 // start of line 3 (20x4) //#define lcd_lineFour 0x54 // start of line 4 (20x4) //#define lcd_LineThree 0x10 // start of line 3 (16x4) //#define lcd_lineFour 0x50 // start of line 4 (16x4)

// LCD instructions #define lcd_Clear 0b00000001 // replace all characters with ASCII 'space' #define lcd_Home 0b00000010 // return cursor to first position on first line #define lcd_EntryMode 0b00000110 // shift cursor from left to right on read/write #define lcd_DisplayOff 0b00001000 // turn display off #define lcd_DisplayOn 0b00001100 // display on, cursor off, don't blink character #define lcd_FunctionReset 0b00110000 // reset the LCD #define lcd_FunctionSet4bit 0b00101000 // 4-bit data, 2-line display, 5 x 7 font #define lcd_SetCursor 0b10000000 // set cursor position

// Program ID uint8_t program_author[] = "Donald Weiman"; uint8_t program_version[] = "LCD-AVR-4d (gcc)"; uint8_t program_date[] = "Sep 16, 2013";

// Function Prototypes void lcd_write_4(uint8_t); void lcd_write_instruction_4d(uint8_t); void lcd_write_character_4d(uint8_t); void lcd_write_string_4d(uint8_t *); void lcd_init_4d(void);

/******************************* Main Program Code *************************/ int main(void) { // configure the microprocessor pins for the data lines lcd_D7_ddr |= (1<

// configure the microprocessor pins for the control lines lcd_E_ddr |= (1<

// initialize the LCD controller as determined by the defines (LCD instructions) lcd_init_4d(); // initialize the LCD display for a 4-bit interface

// display the first line of information lcd_write_string_4d(program_author);

// set cursor to start of second line lcd_write_instruction_4d(lcd_SetCursor | lcd_LineTwo); _delay_us(80); // 40 uS delay (min)

// display the second line of information lcd_write_string_4d(program_version);

// endless loop while(1); return 0; } /******************************* End of Main Program Code ******************

*============================== 4-bit LCD Functions ======================*/ /* Name: lcd_init_4d Purpose: initialize the LCD module for a 4-bit data interface Entry: equates (LCD instructions) set up for the desired operation Exit: no parameters Notes: uses time delays rather than checking the busy flag */ void lcd_init_4d(void) { // Power-up delay _delay_ms(100); // initial 40 mSec delay

// IMPORTANT - At this point the LCD module is in the 8-bit mode and it is expecting to receive // 8 bits of data, one bit on each of its 8 data lines, each time the 'E' line is pulsed. // // Since the LCD module is wired for the 4-bit mode, only the upper four data lines are connected to // the microprocessor and the lower four data lines are typically left open. Therefore, when // the 'E' line is pulsed, the LCD controller will read whatever data has been set up on the upper // four data lines and the lower four data lines will be high (due to internal pull-up circuitry). // // Fortunately the 'FunctionReset' instruction does not care about what is on the lower four bits so // this instruction can be sent on just the four available data lines and it will be interpreted // properly by the LCD controller. The 'lcd_write_4' subroutine will accomplish this if the // control lines have previously been configured properly.

// Set up the RS and E lines for the 'lcd_write_4' subroutine. lcd_RS_port &= ~(1<

// Reset the LCD controller lcd_write_4(lcd_FunctionReset); // first part of reset sequence _delay_ms(10); // 4.1 mS delay (min)

lcd_write_4(lcd_FunctionReset); // second part of reset sequence _delay_us(200); // 100uS delay (min)

lcd_write_4(lcd_FunctionReset); // third part of reset sequence _delay_us(200); // this delay is omitted in the data sheet

// Preliminary Function Set instruction - used only to set the 4-bit mode. // The number of lines or the font cannot be set at this time since the controller is still in the // 8-bit mode, but the data transfer mode can be changed since this parameter is determined by one // of the upper four bits of the instruction. lcd_write_4(lcd_FunctionSet4bit); // set 4-bit mode _delay_us(80); // 40uS delay (min)

// Function Set instruction lcd_write_instruction_4d(lcd_FunctionSet4bit); // set mode, lines, and font _delay_us(80); // 40uS delay (min)

// The next three instructions are specified in the data sheet as part of the initialization routine, // so it is a good idea (but probably not necessary) to do them just as specified and then redo them // later if the application requires a different configuration.

// Display On/Off Control instruction lcd_write_instruction_4d(lcd_DisplayOff); // turn display OFF _delay_us(80); // 40uS delay (min)

// Clear Display instruction lcd_write_instruction_4d(lcd_Clear); // clear display RAM _delay_ms(4); // 1.64 mS delay (min)

// ; Entry Mode Set instruction lcd_write_instruction_4d(lcd_EntryMode); // set desired shift characteristics _delay_us(80); // 40uS delay (min)

// This is the end of the LCD controller initialization as specified in the data sheet, but the display // has been left in the OFF condition. This is a good time to turn the display back ON. // Display On/Off Control instruction lcd_write_instruction_4d(lcd_DisplayOn); // turn the display ON _delay_us(80); // 40uS delay (min) }

/*........................................................................... Name: lcd_write_string_4d ; Purpose: display a string of characters on the LCD Entry: (theString) is the string to be displayed Exit: no parameters Notes: uses time delays rather than checking the busy flag */ void lcd_write_string_4d(uint8_t theString[]) { volatile int i = 0; // character counter*/ while (theString[i] != 0) { lcd_write_character_4d(theString[i]); i++; _delay_us(80); // 40 uS delay (min) } }

/*........................................................................... Name: lcd_write_character_4d Purpose: send a byte of information to the LCD data register Entry: (theData) is the information to be sent to the data register Exit: no parameters Notes: does not deal with RW (busy flag is not implemented) */

void lcd_write_character_4d(uint8_t theData) { lcd_RS_port |= (1<

/*........................................................................... Name: lcd_write_instruction_4d Purpose: send a byte of information to the LCD instruction register Entry: (theInstruction) is the information to be sent to the instruction register Exit: no parameters Notes: does not deal with RW (busy flag is not implemented) */ void lcd_write_instruction_4d(uint8_t theInstruction) { lcd_RS_port &= ~(1<

/*........................................................................... Name: lcd_write_4 Purpose: send a byte of information to the LCD module Entry: (theByte) is the information to be sent to the desired LCD register RS is configured for the desired LCD register E is low RW is low Exit: no parameters Notes: use either time delays or the busy flag */ void lcd_write_4(uint8_t theByte) { lcd_D7_port &= ~(1<

lcd_D6_port &= ~(1<

lcd_D5_port &= ~(1<

lcd_D4_port &= ~(1<

// write the data // 'Address set-up time' (40 nS) lcd_E_port |= (1<

The very next thing you could do is optional, you could connect your smart phone or Samsung to the arduino, this is pretty hard to do, but you could download an app and have this code from the IR remote control with the app and customize it.

Step 5: Finishing Your TV and Perfecting It

Now take your hard paper or card stock and take the measurements you had from step 1 and make the box that goes around the LCD screen, look at the picture if you are confused. Leave the buttons out, instead of a smart remote from the last step, you could control it with these buttons.


Now have fun and show off your new TV!!!!

<p>Nice. I like your programming for the arduino. Very precise, and easy to change. Definitely an amazing LCD TV.</p>

About This Instructable




More by kristopher168598:DIY TV LCD Screen With Arduino and Smart Remote 
Add instructable to: