Wi-Fi
Wi-Fi is a wireless networking technology that allows electronic devices to communicate over a local wireless network. It is widely used in computers, smartphones, televisions, cameras, printers, IoT devices, microcontrollers and industrial equipment.
What Is Wi-Fi?
Wi-Fi is a family of wireless networking technologies based on the IEEE 802.11 standards.
It allows devices to exchange data using radio signals instead of physical Ethernet cables.
Typical Wi-Fi devices include:
- Smartphones
- Computers
- Tablets
- Smart TVs
- Printers
- Security cameras
- IoT devices
- Microcontrollers
- Wireless routers
- Access points
How Wi-Fi Works
A Wi-Fi device contains a radio transceiver and antenna. The radio converts digital data into wireless signals and receives radio signals from other devices.
Digital Data
│
▼
Wi-Fi Controller
│
▼
Radio Transceiver
│
▼
Antenna
│
│ Wireless signal
▼
Wi-Fi Access Point
│
▼
Network
Wi-Fi and the Internet
Wi-Fi itself is not the Internet. Wi-Fi provides the wireless connection between a device and a local network.
Phone │ │ Wi-Fi ▼ Router │ │ Ethernet / WAN ▼ Internet
A router or access point may provide the connection between the local Wi-Fi network and the Internet.
Wi-Fi Router
A wireless router commonly combines several functions in one device. These may include routing, switching, wireless access-point operation and network address services.
Internet
│
▼
Router
│
├── Ethernet
│
└── Wi-Fi
│
├── Phone
├── Laptop
├── TV
└── IoT device
Wi-Fi Access Point
A wireless access point provides Wi-Fi connectivity to devices on a network.
An access point can be connected to a wired Ethernet network and provide wireless access to computers, phones, sensors and other devices.
Ethernet Network
│
▼
Access Point
│
│ Wi-Fi
├── Smartphone
├── Laptop
└── IoT Device
Wi-Fi Standards
Wi-Fi has evolved through multiple generations of IEEE 802.11 standards. Common generations encountered in consumer electronics include:
- 802.11b
- 802.11g
- 802.11n
- 802.11ac
- 802.11ax
Newer generations generally provide improvements in throughput, efficiency, capacity and network management.
Wi-Fi 4
Wi-Fi 4 corresponds to IEEE 802.11n.
It introduced technologies that improved wireless performance compared with earlier Wi-Fi generations.
Wi-Fi 4 can operate in the 2.4 GHz and 5 GHz bands depending on the device implementation.
Wi-Fi 5
Wi-Fi 5 corresponds to IEEE 802.11ac.
It is primarily associated with the 5 GHz band and provides higher throughput than earlier Wi-Fi generations.
Wi-Fi 6
Wi-Fi 6 corresponds to IEEE 802.11ax.
It improves wireless network efficiency, particularly in environments where many devices are connected simultaneously.
Wi-Fi 6 can operate in the 2.4 GHz and 5 GHz bands.
2.4 GHz Wi-Fi
The 2.4 GHz Wi-Fi band provides relatively good range and penetration through common building materials, but it is also widely used by other wireless devices.
Possible sources of interference include:
- Other Wi-Fi networks
- Bluetooth devices
- Wireless peripherals
- Other 2.4 GHz equipment
5 GHz Wi-Fi
5 GHz Wi-Fi can provide higher performance and access to more channels than many 2.4 GHz configurations.
However, higher-frequency signals generally experience greater attenuation through walls and other obstacles.
2.4 GHz vs 5 GHz Wi-Fi
| Feature | 2.4 GHz | 5 GHz |
|---|---|---|
| Typical range | Generally longer | Generally shorter |
| Wall penetration | Generally better | Generally lower |
| Potential interference | Often higher | Often lower |
| Available throughput | Generally lower | Generally higher |
| IoT suitability | Very common | Depends on device |
Wi-Fi SSID
SSID stands for Service Set Identifier. It is the name used to identify a wireless network.
For example, a router may advertise a network with a name such as:
ExotElectronics-WiFi
A device uses the SSID to identify the wireless network it wants to connect to.
Wi-Fi Password
A Wi-Fi network can be protected using wireless security mechanisms. A password or passphrase is commonly used to authenticate users.
The actual security method depends on the router and client devices.
Wi-Fi Security
Modern Wi-Fi networks can use security technologies such as:
- WPA2
- WPA3
Older security methods such as WEP should not be used for modern secure networks.
WPA2
WPA2 is a widely deployed Wi-Fi security standard. It provides authentication and encryption for wireless communication.
The exact authentication method depends on the network configuration.
WPA3
WPA3 is a newer Wi-Fi security generation that provides improved security mechanisms compared with WPA2.
Support depends on the access point and client device.
Wi-Fi Authentication
Before a protected Wi-Fi client can communicate normally with a network, it must complete the appropriate authentication and security procedure.
Wi-Fi Network
│
▼
Network Discovery
│
▼
Authentication
│
▼
Secure Connection
│
▼
Data Transfer
Wi-Fi MAC Address
A Wi-Fi interface normally has a MAC address used for communication at the data-link layer.
The MAC address identifies the network interface within the local networking environment.
Modern operating systems may also use privacy-related MAC-address features when connecting to wireless networks.
Wi-Fi IP Address
After connecting to a network, a Wi-Fi device normally needs an IP address to communicate using IP networking.
Wi-Fi Adapter
│
▼
Wireless Network
│
▼
DHCP
│
▼
IP Address
A router commonly provides IP configuration through DHCP.
DHCP
DHCP stands for Dynamic Host Configuration Protocol. It allows a network device to obtain network configuration automatically.
This can include:
- IP address
- Subnet information
- Default gateway
- DNS server information
Wi-Fi Channels
Wi-Fi divides the available radio spectrum into channels.
Choosing an appropriate channel can help reduce interference from nearby networks.
The available channels depend on the frequency band and regulatory requirements.
Wi-Fi Interference
Wireless interference can reduce Wi-Fi performance.
Possible causes include:
- Nearby access points
- Bluetooth devices
- Microwave ovens
- Wireless peripherals
- Other radio transmitters
- Physical obstructions
Wi-Fi Signal Strength
Wi-Fi signal strength is commonly represented using RSSI or a related measurement.
Signal strength generally decreases as distance increases and as the signal passes through obstacles.
Access Point
│
│ Strong signal
▼
Device
Increasing distance
↓
Weaker signal
Wi-Fi Range
Actual Wi-Fi range depends on:
- Transmit power
- Antenna gain
- Frequency band
- Receiver sensitivity
- Building construction
- Interference
- Device orientation
The maximum range specified by a manufacturer should not be assumed to represent guaranteed performance in every environment.
Wi-Fi Antennas
The antenna converts electrical radio-frequency energy into electromagnetic radiation and receives radio signals from other devices.
Wi-Fi devices may use:
- PCB antennas
- Chip antennas
- Wire antennas
- External antennas
Wi-Fi Antenna Placement
Antenna placement can have a major effect on wireless performance.
Avoid placing the antenna immediately next to large metal objects or other structures that significantly affect the radio field.
Follow the module manufacturer's antenna-clearance recommendations.
Wi-Fi Modules
A Wi-Fi module integrates the radio and supporting electronics into a module that can be incorporated into an electronic product.
Modules may provide:
- Wi-Fi radio
- Processor
- Memory
- GPIO
- UART
- SPI
- I2C
- ADC
ESP32 Wi-Fi
ESP32 devices are widely used in embedded projects because supported variants provide Wi-Fi together with a microcontroller.
This allows an ESP32-based product to connect directly to a wireless network without requiring a separate external Wi-Fi module in many designs.
Typical applications include:
- IoT devices
- Internet radio
- Wireless sensors
- Home automation
- Web-controlled devices
- Remote monitoring
ESP32 Wi-Fi Connection
ESP32 │ │ Wi-Fi ▼ Router / Access Point │ ▼ Local Network │ ▼ Internet
The ESP32 can connect to a configured wireless network and exchange data with devices on the local network or with Internet services.
Wi-Fi and Microcontrollers
Wi-Fi allows a microcontroller to communicate with computers, phones, servers and cloud services.
Sensor │ ▼ Microcontroller │ ▼ Wi-Fi │ ▼ Router │ ▼ Server / Internet
Wi-Fi Web Server
A Wi-Fi-enabled microcontroller can operate as a small HTTP server.
A phone or computer connected to the same network can then access a web interface hosted by the microcontroller.
Phone │ │ HTTP ▼ ESP32 Web Server │ ├── Sensor data ├── Controls └── Settings
Wi-Fi Client Mode
In client or station mode, the device connects to an existing Wi-Fi network.
ESP32 │ │ Wi-Fi ▼ RouterThis is the most common mode when an IoT device needs access to an existing home or office network.
Wi-Fi Access Point Mode
In access-point mode, a supported device creates its own wireless network.
Phone │ │ Wi-Fi ▼ ESP32 Access Point │ ▼ Embedded Application
This can be useful for configuring a device before connecting it to a user's normal Wi-Fi network.
Wi-Fi Station and Access Point Mode
Some devices can operate with station and access-point functionality together.
This can allow a device to remain connected to an existing network while also providing a local configuration interface.
Wi-Fi Data Transfer
Wi-Fi transports network packets between devices.
Application │ ▼ TCP / UDP │ ▼ IP │ ▼ Wi-Fi │ ▼ Radio
Different applications can therefore use Wi-Fi for web communication, streaming, control, file transfer and other network services.
TCP and Wi-Fi
TCP provides reliable, ordered data transport over IP networks.
It is commonly used by applications such as:
- HTTP
- HTTPS
- FTP
- Many client-server applications
UDP and Wi-Fi
UDP provides a lightweight connectionless transport mechanism.
It is useful for applications where low overhead or low latency is more important than guaranteed delivery.
Examples can include certain streaming, discovery and real-time applications.
Wi-Fi and HTTP
HTTP can be used to communicate between a Wi-Fi-enabled device and a web server.
ESP32 │ │ HTTP request ▼ Web Server │ │ HTTP response ▼ ESP32
This makes HTTP useful for IoT devices that need to retrieve or send information over a network.
Wi-Fi and MQTT
MQTT is a lightweight messaging protocol commonly used in IoT systems.
A typical MQTT system uses a broker through which devices publish and subscribe to messages.
Sensor │ ▼ ESP32 │ │ MQTT ▼ MQTT Broker │ ├── Phone ├── Server └── Other IoT devices
Wi-Fi Power Consumption
Wi-Fi radios can consume significantly more power than very-low-power wireless technologies during active communication.
Battery-powered designs can reduce energy consumption by using:
- Sleep modes
- Short communication periods
- Efficient data transfer
- Appropriate transmit power
- Low-power system design
Wi-Fi Security for IoT
IoT devices connected to Wi-Fi should use appropriate network security.
Important considerations include:
- Strong Wi-Fi authentication
- Secure application protocols
- Firmware updates
- Protected credentials
- Secure network configuration
Wi-Fi Troubleshooting
When a Wi-Fi device cannot connect, check the problem systematically.
- Check the device power supply.
- Check whether Wi-Fi is enabled.
- Verify the SSID.
- Verify the password.
- Check signal strength.
- Check IP configuration.
- Check the router.
- Check for interference.
- Test with another Wi-Fi device.
Wi-Fi Device Cannot Find Network
Possible causes include:
- Wi-Fi disabled
- Network outside range
- Unsupported frequency band
- Hidden SSID
- Incorrect region or channel configuration
- Antenna problem
- Radio hardware fault
Wi-Fi Device Cannot Connect
If the network is visible but the device cannot connect, check:
- SSID
- Password
- Security mode
- IP configuration
- DHCP availability
- Signal strength
- Router configuration
Wi-Fi Connected but No Internet
A device can be connected successfully to Wi-Fi while still having no Internet access.
Device │ ▼ Wi-Fi │ ▼ Router │ X Internet connection
In this situation, check the router's WAN connection, DNS configuration, default gateway and Internet service.
Wi-Fi Speed Problems
Slow Wi-Fi can result from:
- Weak signal
- Interference
- Congested channels
- Distance
- Obstacles
- Older Wi-Fi hardware
- Network congestion
- Router limitations
Testing Wi-Fi Hardware
Basic hardware testing should include:
- Supply voltage
- Current consumption
- Reset signal
- Clock where applicable
- Antenna connection
- Network discovery
- Connection stability
For a microcontroller board, serial logs can also be useful for diagnosing initialization and connection problems.
Wi-Fi Module Replacement
When replacing a Wi-Fi module, check:
- Wi-Fi standard support
- Frequency bands
- Supply voltage
- Logic voltage
- Host interface
- Processor requirements
- Firmware compatibility
- Antenna configuration
- GPIO availability
- Operating temperature
- Physical dimensions
- Pinout
How to Select a Wi-Fi Module
- Determine the required Wi-Fi generation.
- Determine whether 2.4 GHz, 5 GHz or both are required.
- Determine the required communication range.
- Determine the host interface.
- Check processor and memory requirements.
- Check power consumption.
- Check antenna requirements.
- Check operating temperature.
- Check firmware support.
- Check security features.
- Check regulatory and certification requirements.
Wi-Fi Applications
- Internet of Things
- Home automation
- Wireless cameras
- Smart appliances
- Wireless printers
- Internet radio
- Remote monitoring
- Industrial control
- Wireless sensors
- Robotics
- Smart displays
- Embedded web servers
- Networked audio systems
Advantages of Wi-Fi
- Wireless network connectivity
- Widely supported by consumer devices
- High data rates are available
- Suitable for Internet-connected devices
- Can support local network communication
- ESP32 and other microcontrollers can integrate Wi-Fi
Limitations of Wi-Fi
- Power consumption can be relatively high for battery devices.
- Range depends strongly on the environment.
- 2.4 GHz networks can experience interference.
- 5 GHz signals generally have shorter practical range through walls.
- Network configuration can be more complex than simple point-to-point wireless communication.
- Security must be configured correctly.
Common Wi-Fi Design Mistakes
- Ignoring antenna placement
- Using an unsuitable frequency band
- Ignoring power-supply requirements
- Using weak network credentials
- Ignoring Wi-Fi signal strength
- Assuming Wi-Fi automatically provides Internet access
- Ignoring IP and DNS configuration
- Using excessive transmit power where it is not required
- Ignoring interference
- Failing to secure IoT devices
Key Points
- Wi-Fi is a wireless networking technology based on IEEE 802.11 standards.
- Wi-Fi operates primarily in the 2.4 GHz and 5 GHz bands depending on the device.
- Wi-Fi provides local wireless connectivity but is not itself the Internet.
- Routers and access points provide Wi-Fi network connectivity.
- 2.4 GHz generally provides better range while 5 GHz can provide higher performance with shorter range through obstacles.
- SSID identifies a wireless network.
- WPA2 and WPA3 provide modern Wi-Fi security mechanisms.
- ESP32 devices can provide Wi-Fi connectivity in embedded systems.
- Wi-Fi can be used with HTTP, MQTT, TCP, UDP and many other network protocols.
- Antenna placement and radio interference strongly affect Wi-Fi performance.
- Battery-powered Wi-Fi devices require careful power management.
- Always consider frequency band, range, antenna, power consumption, security and firmware support when selecting Wi-Fi hardware.