Engineering Blog

Learn it. Build it. Simulate it.

2,764 step-by-step tutorials and projects on Arduino, ESP32, Raspberry Pi and Proteus.

2764 articles found.

LED Blinking Project using PIC16F877a

PIC16F877A microcontroller, eight illuminated LEDs, external crystal circuit, Proteus simulation

Hello friends! In this tutorial, we will design an LED blinking project using the PIC16F877A microcontroller. It is a simple project, but it introduces several ideas that appear in almost every embedded system: configuring an I/O port, choosing an oscillator, building a reset circuit, calculating LED resistors, generating a time delay, compiling a program, and loading the resulting HEX file into Proteus. We will connect eight LEDs to PORTB and switch the complete port between logic low and logic high. Once this basic version works, you can change the output patterns and timing to create a running light, binary counter, or status display. The important objective is to understand why every connection and every program statement is present. The PIC16F877A is an 8-bit microcontroller from Microchip's PIC16F87XA family. It has a 14-bit instruction word, Flash program memory, RAM, data EEPROM, timers, an analog-to-digital converter, two Capture/Compare/PWM modules, a USART, and serial interfaces that can operate as SPI or I²C. For this first project, we only need its clock, reset, power, and PORTB digital-output functions. The 40-pin PDIP device provides eight PORTB pins named RB0 through RB7. The TRISB register controls their direction. A TRIS bit equal to 1 makes its corresponding pin an input; a bit equal to 0 makes it an output. Therefore, writing TRISB = 0x00 configures all eight PORTB pins as outputs. Microchip lists the PIC16F877A as an in-production device and provides the ...

XBee Arduino Interfacing

XBee radio module, wire antenna, blue circuit board, pin header connections

Hello friends! We have already covered the Introduction to XBee Module and Interfacing of XBee with Computer. In this tutorial, we will connect our configured radios to two Arduino UNO Rev3 boards and use a pushbutton on one board to control the built-in LED on the other. Libraries XBee Simulation Libraries Latest library: XBee Library for Proteus V1.0 (January 2016) Other RF modules: nRF24L01 · nRF24L01 PA LNA · CC1101 · RFM69HCW · HC-12 · 433MHz RF Helping Tools We will build the project in stages. First, we will establish the power and serial connections. Next, we will define the messages sent between the boards. Finally, we will write separate sender and receiver sketches and examine how they handle button bounce, incomplete messages, and a lost wireless connection. The example assumes two compatible radios already configured for transparent serial communication at 9600 baud. The address values carried forward from the previous lesson apply to classic S1 802.15.4 firmware. Radios using another supported protocol can carry the same application messages after you configure their network using the correct product instructions. Arduino A reads a pushbutton. When you hold the button down, it asks Arduino B to turn its built-in LED on. Releasing the button asks B to turn the LED off. The sender also repeats the current state once per second, allowing the receiver to recover when an individual message is missed. Arduino B accepts only two complete commands: LED,1 and LED,0, each ...

Interfacing of XBee with Computer

XBee radio module, wire antenna, blue circuit board, pin header connections

Hello friends! In the previous lesson, we discussed what an XBee module does and how it transfers serial data between devices. Now we will connect two modules to a computer, configure their addresses, and send messages in both directions. This gives us a working radio link before we introduce Arduino code. Libraries XBee Simulation Libraries Latest library: XBee Library for Proteus V1.0 (January 2016) Other RF modules: nRF24L01 · nRF24L01 PA LNA · CC1101 · RFM69HCW · HC-12 · 433MHz RF Helping Tools We will keep the original tutorial's simple addressing exercise: the first module uses address 1111, and the second uses 2222. The detailed command example is for classic XBee S1 modules running 802.15.4 firmware. If your module uses Zigbee or DigiMesh, identify it in XCTU and use that firmware's configuration procedure. Matching the case shape does not make these command settings interchangeable. By the end, you should understand the difference between a computer's serial port and a radio address, why the electrical adapter matters, and how to locate a problem when the modules do not communicate. We will then use the same working pair in XBee Arduino Interfacing. Two computers are convenient, but one computer with two adapters also works. Each adapter should appear as a separate serial port. One adapter is sufficient to configure the radios in turn, but a two-way computer demonstration needs serial access to both powered endpoints. Label the radios A and B before you begin. Record ...

Introduction to XBee Module

XBee radio module, wire antenna, blue circuit board, pin header connections

Hello friends! In this tutorial, we will learn how an XBee module carries data between electronic devices without a signal cable. We will begin with a simple wireless sensor example, identify the hardware and communication settings involved, and then work through the calculations that help us choose a power supply and estimate data capacity. Libraries XBee Simulation Libraries Latest library: XBee Library for Proteus V1.0 (January 2016) Other RF modules: nRF24L01 · nRF24L01 PA LNA · CC1101 · RFM69HCW · HC-12 · 433MHz RF Helping Tools This is the first lesson in our XBee series. After understanding the module, you can follow Interfacing of XBee with Computer to configure two radios, followed by XBee Arduino Interfacing to exchange commands between microcontrollers. The same basic reasoning applies to PIC, STM32, and other controllers with a compatible serial interface. XBee is a family of wireless communication modules manufactured by Digi International. A module combines a radio with firmware that handles communication functions. Your controller supplies application data, such as a temperature reading, and the radio sends it to another compatible device. For example, imagine a temperature sensor in a greenhouse and a display inside your house. The greenhouse controller reads the sensor and produces a short message. Its XBee transmits that message. A second XBee receives it and passes the data to the display controller, which interprets the value and updates the screen. The ...