Skip to main content

ARDUINO BASED WIRELESS LED ACTIVATION

In this mini-project, you’ll create two identical assemblies, each consisting of an Arduino and XBee, along with a button and a LED. When you press the button on one assembly, the LED on the other one lights up, and vice versa.
Figure 1: Control LEDs with XBee-equipped Arduinos.

Parts Required:

You’ll be making two assemblies, so you need two of everything!
  1. Arduinos (x2)
  2. XBees (x2)
  3. Breakout boards (x2)
  4. Pushbuttons (x2)
  5. Breadboards (x2)
  6. LEDs (x2)
  7. Jumpers
Project Description:

Follow these steps to assemble the XBee test platform: 


1. Solder the breakout boards:

Solder up your XBee breakout boards if you haven’t already. Depending on your kit, this could mean simply soldering in some header pins. 
On other kits, however, you must solder in LEDs, capacitors, and so on. 


2. Connect the XBees to the breakout boards:

Attach the XBees to their respective breakout boards. This typically involves simply plugging in the XBees’ pins to the appropriate holes in the breakout board. Just follow the directions that accompany your kit. 


3. Attach to breadboards:

Plug the breakout boards and XBees into the breadboards. You can see where to place it in Figure 2.
Figure 2: This diagram shows you how to create these XBee test modules.

4. Attach the pushbuttons, LEDs, and jumpers:

Attach these items as follows (also shown in Figure 2): 

A. GND on the XBee goes to GND on the breadboard. Connect the GND bus of the breadboard to the GND port of the Arduino. 
B. +5V on the XBee goes to 5V on the Arduino. 
C. TX on the XBee goes to RX on the Arduino. 
D. RX on the XBee goes to TX on the Arduino. 
E. Connect a button to pin 8 on the Arduino; the other end connects to the GND bus. 

You should end up with two identical units, and if you upload the Arduino code to both of them, they should work identically. Even cooler, the way the networks are set up, you could actually create three or more of these assemblies and they’ll all work the way you would expect. Press the button on one, and the LEDs on all the others will light up! It’s not super practical, to be sure, but it shows how easily you can set up an XBee network.


Wireless LED Code:

Upload the following code to both Arduinos. Remember, both modules are identical, down to the software. 

#include <Wire.h> 
const int buttonPin = 8; 
const int ledPin = 13; 
int buttonState = 0; 
void setup() 
Serial.begin(9600); 
pinMode(ledPin, OUTPUT); 
pinMode(buttonPin, INPUT_PULLUP); 
void process_incoming_command(char cmd) 
int speed = 0; 
switch (cmd) 
case ‘1’: 
case 1: 
digitalWrite(ledPin, LOW); 
break; 
case ‘0’: 
case 0: 
digitalWrite(ledPin, HIGH); 
break; 
void loop() { 
if (Serial.available() >= 2) 
char start = Serial.read(); 
if (start != ‘*’) 
return; 
char cmd = Serial.read(); 
process_incoming_command(cmd); 
buttonState = digitalRead(buttonPin); 
if (buttonState == HIGH) { 
Serial.write(‘*’); 
Serial.write(1); 
else { 
Serial.write(‘*’); 
Serial.write(0); 
delay(50); //limit how fast we update 
}
Download Project Code Click Here

Comments

Popular posts from this blog

PRIMARY SECONDARY AND TERTIARY FREQUENCY CONTROL IN POWER SYSTEMS

Primary, Secondary and Tertiary Frequency Control in Power Systems Author: Engr. Aneel Kumar Keywords: frequency control, primary frequency control, automatic generation control (AGC), tertiary control, load-frequency control, grid stability. Frequency control keeps the power grid stable by balancing generation and load. When generation and demand drift apart, system frequency moves away from its nominal value (50 or 60 Hz). Grids rely on three hierarchical control layers — Primary , Secondary (AGC), and Tertiary — to arrest frequency deviation, restore the set-point and optimize generation dispatch. Related: Power System Stability — causes & mitigation Overview of primary, secondary and tertiary frequency control in power systems. ⚡ Primary Frequency Control (Droop Control) Primary control is a fast, local response implemented by generator governors (dro...

CASCADED TRANSFORMERS METHOD FOR GENERATING AC HIGH VOLTAGE

High-Frequency AC High Voltage Generation Using Cascaded Transformers Author: Engr. Aneel Kumar Figure 1: Infographic representation of cascaded transformers method for generating high AC voltages. Introduction In high voltage engineering , generating very high alternating current (AC) voltages is essential for testing equipment like insulators, circuit breakers, power cables, and other apparatus. One common and effective method for producing such voltages is the cascaded transformers method . This technique uses a series connection of specially designed test transformers , where the secondary of one transformer feeds the primary of the next. In this way, voltages are built up step by step, achieving levels in the range of hundreds of kilovolts (kV) or even megavolts (MV). Working Principle The principle of cascaded connection relies on the fact that each...

ADVANTAGES OF INTERCONNECTED GRID SYSTEM

Interconnected Grid System: Working, Advantages, Disadvantages, and Comparison with Isolated Grids Author: Engr. Aneel Kumar Figure 1: Infographic showing key advantages of an interconnected grid system. Introduction An interconnected grid system refers to a network of multiple power generation sources, transmission lines, substations, and distribution systems that are linked across regions, states, or even countries. Unlike an isolated grid (or islanded grid) which operates independently, an interconnected grid allows electricity to flow between interconnected nodes, enabling numerous benefits and some trade-offs. In today’s energy landscape—where demand, renewable generation, reliability, and cost pressure are all increasing—understanding how an interconnected grid works, what factors are essential, and what its advantages and disadvantages are is critical for utility planners, reg...

ADVANTAGES AND DISADVANTAGES OF CORONA EFFECT IN TRANSMISSION LINES | ELECTRICAL ENGINEERING GUIDE

Advantages and Disadvantages of Corona Effect in Power Systems In high-voltage overhead transmission lines , the corona effect plays a critical role in system performance. Corona occurs when the air around a conductor becomes ionized due to high electric stress. While often seen as a drawback because of power losses and interference , it also provides certain engineering benefits . This article explains the advantages and disadvantages of corona effect in detail, with examples relevant to modern electrical power systems. ✅ Advantages of Corona Effect Increase in Virtual Conductor Diameter Due to corona formation, the surrounding air becomes partially conductive, increasing the virtual diameter of the conductor. This reduces electrostatic stress between conductors and minimizes insulation breakdown risks. Related Reading: Electrostatic Fields in High Voltage Engineering Reduction of Transient Surges Corona acts like a natural cushion for sudden ...

Advantages of Per Unit System in Power System Analysis | Electrical Engineering

  Advantages of Per Unit System in Power System Analysis In electrical power engineering, the per unit (p.u.) system is one of the most widely used techniques for analyzing and modeling power systems. It is a method of expressing electrical quantities — such as voltage, current, power, and impedance — as fractions of chosen base values rather than their actual numerical magnitudes. This normalization technique provides a universal language for system calculations, minimizing errors, simplifying transformer modeling, and enabling consistency across multiple voltage levels. Because of these benefits, the per unit system is essential in fault analysis, load flow studies, transformer testing, and short-circuit calculations . ⚡ What is the Per Unit System? The per unit system is defined as: Q u a n t i t y ( p u ) = A c t u a l   V a l u e B a s e   V a l u e Quantity_{(pu)} = \dfrac{Actual \ Value}{Base \ Value} Q u an t i t y ( p u ) ​ = B a se   ...

FACTORS AFFECTING BATTERY PERFORMANCE

Batteries have limited life, usually showing a slow degradation of capacity until they reach 80 percent of their initial rating, followed by a comparatively rapid failure. Regardless of how or where a UPS is deployed, and what size it is, there are four primary factors that affect battery life: ambient temperature, battery chemistry, cycling and service. 1) AMBIENT TEMPERATURE The rated capacity of a battery is based on an ambient temperature of 25°C (77°F). It’s important to realize that any variation from this operating temperature can alter the battery’s performance and shorten its expected life. To help determine battery life in relation to temperature, remember that for every 8.3°C (15°F) average annual temperature above 25°C (77°F), the life of the battery is reduced by 50 percent. 2) BATTERY CHEMISTRY UPS batteries are electro-chemical devices whose ability to store and deliver power slowly decreases over time. Even if you follow all the guidelines for proper storage, us...

AC Transmission Line and Reactive Power Compensation: A Detailed Overview

  Introduction The efficient operation of modern power systems depends significantly on the management of AC transmission lines and reactive power. Reactive power compensation is a vital technique for maintaining voltage stability, improving power transfer capability, and reducing system losses. This article explores the principles of AC transmission lines, the need for reactive power compensation, and its benefits in power systems. Keywords: Reactive Power Compensation Benefits, STATCOM vs SVC Efficiency, Power Transmission Stability Solutions, Voltage Stability in Long-Distance Grids, Dynamic Reactive Power Compensation.      Fundamentals of AC Transmission Lines AC transmission lines are the backbone of modern power systems, connecting generation stations to distribution networks. They have distributed electrical parameters such as resistance ( R R R ), inductance ( L L ), capacitance ( C C ), and conductance ( G G ) along their length. These parameters influence ...