Menu
Microbots
0
  • Learn
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • ProtoBot
    • Modules & Parts
    • Tools & Gears
    • Coming Soon
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Sign in
  • English
  • Your Cart is Empty
Microbots
  • Learn
    • Getting Started
    • Maker Builds
    • Education
  • Shop
    • ProtoBot
    • Modules & Parts
    • Tools & Gears
    • Coming Soon
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Language

  • 0 0

CodeCell: Getting Started with Wi-Fi

The CodeCell module, powered by the ESP32, has built-in Wi-Fi capabilities that allow it to connect to the internet, communicate with other devices, or even host a small web server. This means you can:

  • Control your CodeCell remotely from a smartphone or computer
  • Send and receive data over the internet
  • Host a small web page that other devices can access

Now, let's go step by step to connect CodeCell to Wi-Fi.

Connecting CodeCell to a Wi-Fi Network

To connect your CodeCell to a Wi-Fi network, you need to provide the network name (SSID) and password. Let's use the Arduino IDE to write a simple program that connects CodeCell to Wi-Fi.

#include <WiFi.h>
#include <CodeCell.h>

CodeCell myCodeCell;
const char* ssid = "your_SSID"; // Replace with your Wi-Fi name
const char* password = "your_PASSWORD"; // Replace with your Wi-Fi password

void setup() {
    Serial.begin(115200); // Start the Serial Monitor
    myCodeCell.Init(LIGHT); // Set up CodeCell's light sensor
    WiFi.begin(ssid, password); // Connect to Wi-Fi

    Serial.print("Connecting to Wi-Fi");
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print("."); // Print dots while connecting
    }
    
    Serial.println("\nConnected!");
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP()); // Print the assigned IP address
}

void loop() {
    // Run every 10Hz
    if (myCodeCell.Run(10)) {
        // Your main loop code here
    }
}

How It Works:

  • This code starts the Serial Monitor to track the Wi-Fi connection progress.
  • It connects to Wi-Fi using WiFi.begin(ssid, password);.
  • Once connected, it prints the assigned IP address.

Troubleshooting:

  • If it doesn’t connect, double-check your SSID and password.
  • Make sure your router is on and not blocking unknown devices.

Hosting a Simple Web Page on CodeCell

Once CodeCell is connected to Wi-Fi, we can make it act like a tiny web server! This means we can control it or display information using a web page.

#include <WiFi.h>
#include <WebServer.h>
#include <CodeCell.h>

CodeCell myCodeCell;
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";

WebServer server(80);

void handleRoot() {
    int proximityValue = myCodeCell.Light_ProximityRead(); // Read proximity sensor
    String response = "

Welcome to CodeCell Wi-Fi Server!

";
    response += "

Proximity Value: " + String(proximityValue) + "

";
    server.send(200, "text/html", response);  
}

void setup() {
    Serial.begin(115200);
    myCodeCell.Init(LIGHT); // Set up CodeCell's light sensor
    WiFi.begin(ssid, password);
    
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("\nConnected to Wi-Fi");
    Serial.print("IP Address: ");
    Serial.println(WiFi.localIP());
    
    server.on("/", handleRoot);
    server.begin();
    Serial.println("HTTP server started");
}

void loop() {
  if(myCodeCell.Run(10)){
    server.handleClient();
  }
}

How It Works:

  • This code sets up a simple web server that displays a message.
  • When you type the IP address (printed in Serial Monitor) into a browser, it will show a webpage saying "Welcome to CodeCell Wi-Fi Server!" and shows the current proximity value read by the CodeCell.

Try It Out!

  1. Upload the code to CodeCell.
  2. Open the Serial Monitor to find the IP Address.
  3. Type the IP address into a browser – you should see the message!
  4. Refresh the page to see the proximity value update

Sending Data to a Server (Basic IoT Example)

CodeCell can also send data to a web server, such as a cloud service that collects sensor readings.

#include <WiFi.h>
#include <HTTPClient.h>
#include <CodeCell.h>

CodeCell myCodeCell;
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
const char* serverName = "http://example.com/data"; // Replace with your server URL

void setup() {
    Serial.begin(115200);
    myCodeCell.Init(LIGHT); // Set up CodeCell's light sensor
    WiFi.begin(ssid, password);
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }
    Serial.println("Connected to Wi-Fi");
}

void loop() {
    if (myCodeCell.Run(10)) { // Run every 10hz
        HTTPClient http;
        http.begin(serverName);
        int httpResponseCode = http.GET();
        Serial.print("HTTP Response code: ");
        Serial.println(httpResponseCode);
        http.end();
    }
}

How It Works:

  • The CodeCell connects to Wi-Fi and sends a request to http://example.com/data.
  • The response is printed in the Serial Monitor.
  • You can use this method to send sensor data to a web service!

 

Conclusion

Wi-Fi makes CodeCell powerful for IoT projects! Start experimenting, and soon you’ll be building amazing projects!

  • Share:

Follow

Github

  • About
  • Software
  • Education
  • Contact
  • FAQs
  • Terms
  • Refund Policy
  • Privacy Policy

Join our Community ~ Be the first to know about new products and get exciting deals!

© 2026 Microbots.

★ Reviews

Let customers speak for us

73 reviews
Write a review
85%
(62)
5%
(4)
3%
(2)
3%
(2)
4%
(3)
67
21
G
ProtoBot
Gennadii

Got a Pro version, it's very easy to put together, and it works great.
Would be great to have brushless motors and more GPIO access through the plastic shell in ProtoBot v2

A
ProtoBot
Armand

It is a compact, very well designed RC-like robotic car with endless possibilities for those with active imaginations. Inspirational and creative in a small form factor. Innovate and enjoy!

User picture
J
ProtoBot
Javier

I Recieved yesterday my ProtoBot and the quality and details are awesome!

User picture
C
CodeCell C3
Cloke74

Great piece of kit, had just what i needed to complete the project i had in mind. Shame shipping to the UK is so expensive, but appreciate this isn’t necessarily in the hands of MicroBots

A
CodeCell C6
Anonymous

I had an issue, got a red light, I used too much flux. Support said clean it, then the one sensor worked fine. I got the help and answer same day I provided a foto.

123