Menu
Microbots
0
  • Robots
    • ProtoBot
    • CubeBot
    • Robot Parts
  • Modules & Parts
    • CodeCell ESP32 Modules
    • Motors & Actuators
    • LiPo Batteries
  • Gear
    • Tools
    • Merch
  • Learn
    • User Guide & Tutorials
    • DIY Projects & Files
    • Education Discounts
  • About
    • Our Story
    • Reach Out
    • FAQs
  • Sign in
  • Your Cart is Empty
Microbots
  • Robots
    • ProtoBot
    • CubeBot
    • Robot Parts
  • Modules & Parts
    • CodeCell ESP32 Modules
    • Motors & Actuators
    • LiPo Batteries
  • Gear
    • Tools
    • Merch
  • Learn
    • User Guide & Tutorials
    • DIY Projects & Files
    • Education Discounts
  • About
    • Our Story
    • Reach Out
    • FAQs
  • 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

87 reviews
Write a review
87%
(76)
5%
(4)
2%
(2)
2%
(2)
3%
(3)
81
21
A
CodeCell C3
Anonymous

Perfect product!

A
ProtoBot
Anonymous

This is a great product for beginners who want hands-on experience with Arduino and 3D printing. The Protobot has a sleek, solid design, and the software is just as polished. I’ve bought several educational robotics kits, and this is the best one so far. Looking forward to more awesome products!

Thank you so much for your kind review! 😊

F
ProtoBot
Francis van Uyten

Really love this robot. I like that is simple to assemble and I like that you guys prepares it easy to start programming with examples and libraries. My opinion on what to improve is more like a add-on, can you guys develop a localisation sensor or function so it will know where the bot is. Expecting only great things coming from you guys. Succes

Thank you so much for your thoughtful review! Glad you’re enjoying ProtoBot 😊 A localisation sensor is a great suggestion! The I²C connection lets you add compatible sensors, so there’s room to explore this. Thanks for your support!

G
Experiment in Progress Mug
Gerald Kendrick

I am enjoying my Experiment in Progress coffee mug. It fits in well in the lab.

Hi Gerald, we’re so glad you’re enjoying it! Thanks for sharing your kind review.

K
12-in-1 Screwdriver (Pen-Size)
Klaas

Very useful fun little screwdriver for the all tiny stuff

Hi Klaas, thanks for the great review! We’re glad you’re enjoying your screwdriver!