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...

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 ...

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...

REVERSING DIRECTION OF ROTATION OF UNIVERSAL MOTOR

The direction of rotation of a universal motor can be changed by either: (i) Reversing the field connection with respect to those of armature; or (ii) By using two field windings wound on the core in opposite directions so that the one connected in series with armature gives clockwise rotation, while the other in series with the armature gives counterclockwise rotation. The second method, i.e, the two field method is used in applications such as motor operated rheostats and servo systems. This method has somewhat simpler connections than the first method. For simple applications like portable drills etc. manual switches are frequently used for reversing the direction of rotation of the motor. Figure  1 (a and b) shows how a DPDT (Double Pole Double Throw) switch and a three position switch may be used for reversing the direction of rotation of single field and double field type of motors respectively. Figure 1 Reversing of a universal motor (a) Armature re...

Factors Affecting Corona in Overhead Transmission Lines

Factors Affecting Corona in Overhead Transmission Lines Author: Engr. Aneel Kumar Figure 1: Infographic illustrating the factors influencing corona discharge in transmission lines. Introduction The corona effect in overhead transmission lines is a phenomenon that occurs when the electric field intensity around conductors exceeds a critical value, causing ionization of the surrounding air. This ionization produces bluish light, hissing sound, power loss, and ozone gas. While corona may seem undesirable, it also has a few advantages such as reducing overvoltages by absorbing surges. Corona directly impacts power system efficiency, transmission losses, equipment life, and design cost . Therefore, engineers must understand the factors affecting corona in detail to ensure efficient and reliable design of high-voltage transmission systems. 1. Conductor Size (Diameter) ...

Control Strategies for TCSC: Techniques for Dynamic Power Flow Management

Introduction As power transmission networks grow more complex, real-time voltage and impedance control becomes essential for ensuring grid reliability. Thyristor Controlled Series Capacitors (TCSC) play a key role in dynamically adjusting transmission line reactance, but their effectiveness depends on advanced control strategies . Different control methodologies —ranging from open-loop and closed-loop systems to AI-driven predictive models —allow TCSC to optimize power flow, improve stability, and enhance energy efficiency . In this article, we will explore: ✅ Different types of TCSC control strategies ✅ The role of real-time monitoring in optimizing power flow ✅ How AI and machine learning improve TCSC performance Keywords:   AI-Based Power Flow Control,  TCSC Dynamic Impedance Regulation,  Real-Time Voltage Stabilization,  Smart Grid FACTS Controllers Understanding TCSC Control Strategies A TCSC regulates transmission line reactance by adjusting thyristor switch...