A Web Server to Control LED With Ameba

by daphwl in Circuits > Microcontrollers

37 Views, 0 Favorites, 0 Comments

A Web Server to Control LED With Ameba

Instructables.png

Ameba RTL8722DM is a low-power dual-band WLAN and BLE(Bluetooth Low Energy) SoC by Realtek. The RTL8722DM also include memory for Wi-Fi protocol functions and application making it simple for anyone to develop various kind of IoT applications. At the same time it has a wide range of peripheral interfaces. With all these interfaces, it can connect to most of the electronics components like LEDs, temperature and humidity sensors, and so on.

In this project, the RTL8722DM will be used to create a webs server that can be accessed with any devices that connect to the internet with the IP address.

Supplies

  • Ameba RTL8722DM/ RTL8722CSM x1
  • 1K ohms resistor x1
  • LED x1
  • Breadboard x1

Setting Up

led1-1.png

First, connect the breadboard to the Ameba.

Then, connect the LED and the resistor in as shown in the wiring diagram.

For the LED, the longer pin is the positive pole while the shorter pin is the negative pole. Therefore, connect the shorter pin to the GND and the longer pin to D13 on the Ameba. In addition, to limit the current through the LED and prevent it from damage, we have to connect a resistor to the positive pole.

Programming

ArduinoLogo.png
led1-2.png
led1-3.png

The programming can be done using Arduino IDE which makes it very easy to write code and upload to the Ameba board.

  • To open the sample code in the Arduino IDE, Open "File" -> "Example" -> "AmebaHttp" -> "SimpleHttpExample"
  • Next, in the sample code, modify the highlighted section to enter the information required (SSID, PASSWORD) of your network to connect to your Wi-Fi.
  • Lastly, verify and upload the code on the Arduino IDE and press the reset button the Ameba.

Final Result

led1-4.png
led1-5.png

Once the upload is completed, open the serial monitor in the Arduino IDE. When the connection is established, you will see the message "To see this page in action, open a browser to http://xxx.xxx.xxx.xxx" in the Arduino IDE, as shown in the picture.

Finallly, open the internet browser on a computer or a smartphone under the same Wi-Fi network as the Ameba, then enter the IP address of the Ameba.

And in the webpage you can turn on or turn off the LED.

Additional Resources?

If you need additional technical documents or the source code for this project. Please visit the official websites and join the Facebook group and forum.