Interface and Application Programming



Assignment
Group-Assigniment
  1. Compare as many tool options as possible.
  2. Document your work on the group work page and reflect on your individual page what you learned

Individual assignment

Write an application that interfaces a user with input and/or output device(s) on a board that you made.

Table of Content

PCB DESING

Here you can find the procedure i used to design my dev-b
schematic diagram of my development board
pcb diagram of my development board
3d view diagram of my development board

python programing definition: Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). This tutorial gives enough understanding on Python programming language.

installation of python

  1. Go to the official Python website at https://www.python.org/downloads/
  2. Click on the "Download Python" button for the latest stable version.
  3. Choose the appropriate installer for your operating system (Windows, macOS, or Linux).
  4. Once the download is complete, run the installer.
  5. then check the version in your terminal ar cmd

installation of pip

pip definition :PIP is a package manager for Python packages, or modules if you like

here i would like to use python as programing language to program interface which can help to control cold room remotely. my interest to use DHT11 sensor as in put and proting its real time deta on graph . this push is me to install some python modules or libraries like

 matplotlib,numpy and pandas

installation of python libraries

  1. installation of matplotlib
  2. installation of numpy and pands libraris
  3. challenge faced after installing the python libraries

    1. I tried to use vs-code as python ide but some code are runing and others are not runing


      Here i was complete to insatall all python libraries still the problem is the same.
    2. I tried to solve the problem with creating virtual environment where you can access all library globaly in pc
      Whenever i tried to create virtual environment in comnd promt (cmd). I feiled to create this environment. due to this i decide to shift to other aproach of controlling the sound of busser on my dev board.

    Interface and applicatioin with python tiknter

    tiknter :is the de facto way in Python to create Graphical User interfaces (GUIs) and is included in all standard Python Distributions. In fact, it's the only framework built into the Python standard library.

    bello this code i used to provide my interface to control the sound of busser on my board
    import serial
      import tkinter as tk
      
      serialPort = 'COM8' # change this to match your Arduino serial port
      serialBaud = 9600
      
      def sendChar(char):
          ser = serial.Serial(serialPort  serialBaud)
          ser.write(char.encode())
          ser.close()
      
      root = tk.Tk()
      root.title("CONTROL BUZZER WITH TKINTER UI AND ESP32")
      
      buttonOn = tk.Button(root, text="Turn On", command=lambda: sendChar('H'))
      buttonOn.pack()
      
      buttonOff = tk.Button(root, text="Turn Off", command=lambda: sendChar('L'))
      buttonOff.pack()
      
      root.mainloop()
      

    interface visiualiation

    Arduino code to read searial pot and send the code on my mcu esp32 for interation between my UI and development board

    const int buzzerPin  = 25;
      int incomingByte;      // a variable to read incoming serial data into
      
      void setup() {git 
        // initialize serial communication:
        Serial.begin(9600);
        // initialize the LED pin as an output:
        pinMode(buzzerPin , OUTPUT);
      }
      
      void loop() {
        // see if there's incoming serial data:
        if (Serial.available() > 0) {
          // read the oldest byte in the serial buffer:
          incomingByte = Serial.read();
          // if it's a capital H (ASCII 72), turn on the LED:
          if (incomingByte == 'H') {
             digitalWrite(buzzerPin, HIGH);
          }
          // if it's an L (ASCII 76) turn off the LED:
          if (incomingByte == 'L') {
              digitalWrite(buzzerPin, LOW);
          }
        }
      }