How to interface 16x2 LCD with Raspberry Pi using GPIO & Python

Components Required:

Here you need following components to complete the task.
  • Raspberry pi
  • power supply adapter for Raspberry pi
  • 16x2 lcd display
  • potentiometer 10k
  • connecting wires
  • break board or any 16x2 display shield
  • Circuit connections
Connections are shown in this image. But its not mandatory to use this GPIO's. You can use any GPIO for connect the LCD. But you have to mention same GPIO's in Programming.

variable resistor is connected to adjust contrast of the display. Display is powered from Raspberry pi. R/W pin is connected to ground because i am not performing any read operation on display.



Working video:

  

Code:

I designed an display library namely lcd.py In this library i write some functions to which can be called by user. In order to drive lcd it is mandatory to include this library in your code. More details about library is available in library.
First of all you have to execute begin() function and pass the pins which you are going to use for interface display.
Here Print() function can print any value passed to this function.
This display isinterfaced in 4 bit mode so only 4 pins D4-D7 and RW,EN pins are connected to raspberry pin.

Here code is available for this instructable.

Disadvantage:


This won't be work properly if we put this script to run automatically at boot. This is because the Raspberry pi is not Real time controller. Need some more improvement in this code.


Real Time Clock(How to interface DS1307 RTC to AT89S52 microcontroller)

WELCOME BACK ,
 This is shubham Trivedi and today i am going to design Real Time Clock using At89s52 Microcontroller.  The AT89S52 Microcontroller is the heart of this project.  DS1307  IC is used  as RTC . This DS1307 IC required I2C interface , but 89s52 is not have any I2C port on board. That makes it typical to designed. So i designed a I2C bus in program and used it to fulfill the requirements. 

Construction 

fig.1

fig.2
fig.3

          The circuit is designed in two separate parts. Fig. 1 Shows the RTC DS 1307 IC connection. This connection is done by using zero PCB. The connection is same as shown in Fig. 2.
          I used AT89s52 Development Board which i designed few months ago using Screen print technique for pcb design. The SCL pin of RTC is connected to pin  P1.1 and SDA  pin is connected to pin P1.0 of 89s52 microcontroller. LCD 16x2 is interfaced in following way.

PIN OF LCD       PIN OF AT89s52
           D7          -    P3.7
           D6          -    P3.6
           D5          -    P3.5
           D4          -    P3.4
           RS          -   P1. 6
           RW         -   P1. 5
           E            -    P1.4

Working Video





Code

Program is designed in Keil uvision 5 software. Separate library files are used for each interface. please go through the readme file before proceed further. The description of each function is also available in this attachment

For any query please write at shubhamtrivedi95@gmail.com

Real Time Clock(How to interface DS1307 RTC to pic18f452 microcontroller)

Welcome to you .
         
              Here i am designed a Real Time Clock using  PIC18F452 microcontroller.
I will explain how to design Real Time Clock using PIC microcontroller.

RTC Using PIC18F452

PIC is advance microcontroller series. In PIC microcontroller I2C(Inter-Integrated Circuit) Bus is available on board. RTC used in this project is DS1307 which needed I2C interface to read and write data from and to RTC. Because I2C bus is on board in PIC microcontroller Interfacing  becomes easy.
There will no need to write separate code for I2C bus. 


Construction

Fig.1

Fig. 2
                                                                           
Fig. 3
The circuit is designed in two separate parts. Fig. 1 Shows the RTC DS 1307 IC connection. This connection is done by using zero PCB. The connection is same as shown in Fig. 3.
I used PIC18F452 Development Board which i designed few months ago using Screen print technique for pcb design. The SCL pin of RTC is connected to pin  18 and SDA  pin is connected to pin 23 of PIC microcontroller. LCD 16x2 is interfaced in following way.

PIN OF LCD       PIN OF PIC18F452

  • D7          -    RD7
  • D6          -    RD6
  • D5          -    RD5
  • D4          -    RD4
  • RS          -    RB5
  • RW         -    RB4
  • E            -    RB3



Working Video









Code

The code is written in MPLAB IDE and C18 compiler is used to to compiler the code. PICKIT 2 is used to burn the code on PIC18F452 IC.
Please read the README file which available in the attachment before proceed.
Click here to download this code.

For any query please write at shubhamtrivedi95@gmail.com

click here to like us on facebook



How to Build Electronics calculator using Arduino uno and TFT Display Shield

Electronics calculator using Arduino uno and TFT Display Shield

Hello  friends,

                     Today i have something new to show you. As earlier mention in the title i designed a ELECTRONIC  CALCULATOR  using Arduino uno and 2.4" TFT Lcd Display Shield.

Construction

                       The system is build around arduino uno r3 microcontroller and 2.4" tft lcd shield. The shield is designed in such way that no connection error will occur. Arduino uno can be powers by 9v or 12v adapted or USB cable. on board 3.3v regulator is available on LCD shield. LCD shield gets 5v supply from arduino and convert it into 3.3v using regulator ic 1117-3.3. further this supply is given to the LCD. LCD consist of 2.4" resistive touch pad which use as input device for the system.The LCD is interfaced to arduino with 8 bit data bus and 5 bit control bus. this control bus is connect to 5 analg pins of arduino and data bus is connected to digital i/o pins. Touch pad is also interface with  this bus . Alternatively the touch pad and lcd is accessed through microcontroller. Reset switch is available on tft lcd shield.


 

  

Working:

                The System wake up with message. and wait for user.
   
After that main calculator opens up as shown in the figure.

The system support most of mathematical operations and also it supports the logical operations also which further more helpful for programmer. it supports ADDITION,MULTIPLICATION,SUBTRACTION, and DIVISION.  However it is possible to perform Logical OR and Logical AND operation. All operations are perform on decimal number and results are also printed in decimal number except that the OR ,AND  operation produce the result in Binary. Apart from this  calculator can be used to obtain percentage and power of given number. It also calculate Modular of given number. Delete button is present there to delete the incorrect digit or sign pressed by the user.  The best feature which attract me towards this calculator is that it can produce, BINARY, HEX, OCTAL representation of given decimal number. Special buttons are given to select appropriate operator.
Some pictures of  working module is shown below.
   


Advantages:

  1. it consumes low power and less space.
  2. Its also gives negative answer.
  3. percentages is shown accurately up-to two digit after decimal point.
  4. No use of analog keys,used for input purpose ,which  saves the hardware .
  5. Each and every button animates after pressing it.
  6. It capable to print data to any serial device easily.


Working Video:


Limitations:

  1. It can perform operation on maximum 6 digit numbers individually.
  2. 32767 this is last number which can converted into its equivalent HEX,BINARY or OCTAL number.
  3. any answer which contents more than 10 digit will likely to be wrong.
  4. At a time only one operation can be perform.
  5. Its not possible to use brackets "()" in this calculator. 

Code:

  1. library
  2. code
(Note: The library is based on you lcd.I am not sure that same library will work on your project.)

USB AVR & AT89Sxx ISP Programmer (usbasp)








        Welcome to you, This is shubham and today ,I have something special for you. Yes as you can saw its a USBASP programmer a tool for all beginners of embedded system. This programmer is most commonly used to program micro-controller. This circuit is build around ATmega8a microcontroller. It can be use for both 89xxx series as well as AVR microcontrollers. A most important feature of this program is IN-SYSTEM PROGRAMMING(ISP). Yes as name implies it is used to program any controller on given system. There is no need to remove chip from system. FRC cable is used to connect target microcontroller to this programmer. For more detail about this programmer please download the following attachment.




Thank you  

samsung c3303 battery connector jumper solution

                              
All the three terminals are connected to pcb. so make the jumper as shown in above diagram. I am sure you will do this. Its very easy and this will also solve auto restart problem during start up.       

How to interface 16x2 LCD with Raspberry Pi using GPIO & Python

Components Required: Here you need following components to complete the task. Raspberry pi power supply adapter for Raspberry pi 1...