- Electric Circuits course project (Fall 2021)
- Perforated Board (1600 points)
- Square Battery
- Battery Clip Connector
- AVR Programmer
- Character LCD (2 X 16)
- (5.813K) Ohm Resistor
- (43.23K) Ohm Resistor
- Solder Wire
- Jumper Wire
- 2-Pin Male Connector
- 2-Pin Female Connector
- LM7805 Regulator
- 10µF 16V Radial Electrolytic Capacitor
- 100µF 16V Radial Electrolytic Capacitor
- 100nF Ceramic Capacitor
- ATmega32 Microcontroller
- 40 Pin IC Socket
- Female Pin Header
- Male Pin Header
- 6 Pin Push Button On/Off Switch
- 2 Pin Terminal Block
- (10K) Ohm Potentiometer
- Two Pieces of wire
This project will be divided into two hardware and software sections. Firstly we discuss the hardware section.
- We first sand the perforated board until its surface is shiny.
- Then, we need to solder the female and male pins to the LCD's 16th pin of the LCD (The purpose of this work is to use it on other projects because LCD is a relatively expensive part. Do not solder directly on the board; instead, use a male header pin. This LCD can be used in another circuit in the future)
- In the next step, we will solder the rest of the parts. (resistors, capacitors, connectors. 2-pin male connector, potentiometer, 1x40 female header pin, two-pin terminal, 6-pin switch Regulator, on/off)
- We solder the 40-pin IC socket on the board. A microcontroller is relatively expensive; don't solder it directly on the board. Instead, we use a 40-pin IC socket so that it can be connected to the microcontroller in the future using another circuit)
- we solder the parts on the board differently when We wanted to use a wire jumper to solder it. (Proper spacing)
- be careful how to connect the wire jumper and soldering carefully. We have done the simulation.
- we should be careful when soldering; we should mark the points with Solder carefully because otherwise, if we are not careful, a short circuit may occur and cause some parts to burn.
- In the end, we removed the 2-pin female telecommunication connector and two pieces of wire to the battery head. We connect a book and a book battery.
- Now, when we press the 6 Pin Push Button, if we have followed all the steps correctly, LCD turns on, but the LCD screen does not show us any information. Now We come to the software and programming part.
- We need an AVR programmer to write a program for its software part. A program is written in C language. Let me explain in summer what we should do. What we do for us in this code is first write a message for 2 seconds. Display the desired (my name is Matin), and then it shows the voltage when the circuit is connected to the power supply.
- It is a device that transfers the code file from the computer to the microcontroller.
- We use LCD to display the voltage read in the microcontroller.
- You get an input voltage from the regulator, which gives you a constant and stable output voltage (here, 5 volts).
- It is a tiny computer. It has some other parts like a real computer, with CPU and memory. We can put a program on it and its microcontroller to execute. For that, we use the C programming language because it is a compiler language and converts the code we write into machine language or the same 0 and 1, and the microcontroller can run it. There is a point, this is a part of the microcontroller, and it works to read the voltage. This part works when it is 1 in the microcontroller, and when it is 0, it does not give us the voltage read.
- From ADC0 to ADC7, they can read voltage.
- We specify in our code which pin of the microcontroller is going to be the voltage for us (We use PA0 or the same ADC0 here.) (In the code, this part We have determined that if we put 000, it will be adc0 and if 001, it will be adc1 and...))
- As shown in the picture above, we connect the points marked by wire jumpers.
- For example:
In appreciation of Reza Hessami