Lab 01 Led 2025
Lab 01 Led 2025
“Getting Started” & “Help”: Some useful guides can be found here, but they tend to
be wordy and filled with jargon. It is advised to avoid them.
“Start” \ “Recent Projects”: Here you will find the projects that you opened last.
This section will be empty if you just installed Proteus.
“News”: This section will contain news about your current license, recent versions of
the software, and links to basic video tutorials that you might find helpful.
To create a new project, follow the steps below:
- Step 1: Click on “New Project” under the “Start” header in the home page:
Unless certain dimensions are required (for printing or otherwise), “DEFAULT” will suffice.
Click “Next”.
- Step 3: Select the PCB Layout:
Editing source code is beyond the scope of this guide, select “No Firmware Project” and click
“Next”.
- Summary page:
You should now see a summary of all your previous selections. If any mistakes were made,
you can click “Back” and correct them.
- Click “Finish” to open the Schematic Capture module and begin working on your project.
2. Interface:
Note: letter “M” before a number will indicate a button on the Module bar. Thus, M12 refers
to the “Copy” button on the Module bar.
Sidebar:
- Step 2: After the “Pick Devices” window has appeared, begin writing keywords for the
part you are looking for:
7. Introduction to arduino
7.1. What is Arduino
- Arduino is nothing but a simple microcontroller board which is normally used in
engineering projects where there’s a need to automate something.
- You can interface sensors with this board, can drive motors with this board, can
plug switches in it etc.
- In old ages ( not old enough 😛 ), people used simple switches for turning ON a
bulb so like you click the switch and the bulb is ON, it was quite a simple circuit,
after that relays are invented and then engineers used 555 timer circuits in order
to turn ON lights on some specific time. But the 555 timer circuits are quite big
IoT Labs Pages 7
in size, so finally engineers discovered Microcontrollers in which there are
simple OUTPUT and INPUT pins, so now if you want to turn on light at some
certain time then you just simply plug the blub on output pin of microcontroller
and then do some programming and add a timer to automatically turn on the
bulb.
- So, the benefit of microcontroller is the circuit is quite simple and small in
size.Moreover, its flexible, suppose you want to change the time of turning ON
bulb then what you need to do is simply change the coding and it will be
changed, but in 555 timer circuits you need to change the components in order
to do so.
- Now, we know the use of microcontroller and also their benefit but thing is what
is Arduino ??? In microcontrollers like PIC or Atmel, there’s a small drawback.
- Suppose you want to work on PIC then you have to first design its basic circuit
also need to design a power circuit to supply power to it and after that in order
to upload the code in it, you have to buy a programmer/ burner as well. So, first
of all you need to write the code for PIC Microcontroller and after that you need
to upload code in it using a programmer and then plce PIC microcontroller back
into the circuit and test, which is quite lengthy plus also got hectic when you are
working on some project because you have to test code again and again.
- By the way, now advance programmers like PICkit2 and PICkit3 can be plugged
on board but still you have to design the basic circuit so coming to bottom line,
in order to do project with PIC or Atmel microcontroller you have to do soldering
etc.
- But that’s not the case with Arduino Board, Arduino has built in programmer and
the basic circuit in it. So what you need to do is simply plug in Arduino with your
computer via usb cable, get its software and start uploading code and also start
testing.
- So, you don’t need to plug unplug or do anything, simply upload the code and
test. Moreover, it also has some very efficient tools using which you can test
your output as well quite easily. Arduino board also has the pins on which you
can simply plug your devices and can turn them ON or OFF. So, hats off to
Arduino team for providing us a simple board which has everything on it.
7.2. Types of Arduino Boards
-
- Along with this box, you will also have the USB cable, now take your Arduino
board out of this box and plug the cable in it, connect the Arduino with your
computer and you are ready to start working on it.
- In order to connect Arduino with your computer you have to install the Arduino
drivers in Windows.
- That’s all for today, hope I have conveyed some knowledge and you now know
the basics of Arduino i.e. what is Arduino ? and why to use Arduino.
• In the above figure, I have used the simple blink example and I am gonna generate
its hex file.
• Now when you click on the Preferences, a new window will pop up.
• In this new window, tick the compilation option as shown in below figure:
7.8. Terminology
7.9. Variables
- boolean (8 bit) – Chứa logic đơn giản là true/false
- byte (8 bit) – Chứa các số không dấu (chỉ chứa số dương không chứa số âm) từ 0-255
- char (8 bit) – Số có dấu từ -128 đến 127. IDE sẽ mặc định dùng biến này để chỉ ký tự
tương ứng trong bảng mã ASCII khi dùng các lệnh, hàm liên quan đến ký tự.
- unsigned char (8 bit) – Tương tự như Byte. Thông thường bạn nên sử dụng Byte để
tránh nhầm lẫn
- word (16 bit) – Số không dấu từ 0-65535
IoT Labs Pages 13
- unsigned int (16 bit)- Tương tự như Word. Bạn nên sử dụng Word để tránh nhầm lẫn.
Tuy nhiên, một số bạn vẫn tiện tay dùng.
- int (16 bit) – Số có dấu từ -32768 đến 32767. Đây là biến thông dụng
- unsigned long (32 bit) – Số không dấu từ 0-4,294,967,295. thường sử dụng để lưu giá
trị trong hàm millis(), đây là hàm trả về giá trị milli giây kể từ khi Arduino bắt đầu
hoạt động.
- long (32 bit) – Số có dấu từ -2,147,483,648 to 2,147,483,647
- float (32 bit) – Số có dấu từ -3.4028235E38 to 3.4028235E38. Dấu chấm động thường
ít được sự dụng trong Arduino vì trình biên dịch rất khó khăn để chuyển đổi thực thi
các lệnh liên quan. Nếu thật sự không quá cần thiết, bạn không nên sử dụng đến nó.
- String – Biến chứa một chuỗi các ký tự (char).
- Void – Chỉ sử dụng để khai báo hàm khi không cần phải trả về bất cứ giá trị nào.
7.10. Digital I/0
There will be one 2 check box near to ‘Show verbose output during’,
please check the first one.
Everything is ready to go! Run the Simulation now. You can see the
simulated output of the Arduino Program, watch the video for my
simulation output.
9. Traffic signal control
9.1. circuit in Proteus
Blink led nhấp nháy như trên mình trình bày và Verify
- Bạn sẽ thấy file .hex đã không còn ở thư mục temp khó tìm nữa mà vào
đúng thư mục mình mong muốn.
11.