How to Make Automatic LED using W5500 Ethernet Shield

/How to Make Automatic LED using W5500 Ethernet Shield
How to Make Automatic LED using W5500 Ethernet Shield2018-08-01T13:40:42+00:00

Project Description

Let’s make a LED to be turned on automatically whenever it detects motions.

Hardware

  • FRDM-KL25Z : mbed enabled platofrm (Pin compatible with Arduino)
  • W5500 Ethernet Shield
  • PIR Sensor
  • 1W Power LED
  • LED Driver
  • CDS Sensor

Below is the hardware schematic.

mbed-led-1

According to the schematic, mount and solder above parts on the breadboard.

mbed-led-2

Connect them with mbed platform as shown below image.

mbed-led-3

Firmware

Connect to https://developer.mbed.org/, and click “Compiler” button. If the web compiler is executed, click “New” button to create a new program.

mbed-led-4

Choose a platform that you are using and input any characters for Program Name. In this tutorial, we are using FRDM-KL25Z platform and input “Auto_led” for Program Name.

mbed-led-5

When the new program creation is done, create the new file. Input “main.cpp” for the file name and click O.K button.

mbed-led-6

When “main.cpp” file is created, click “import” button to import an mbed library.

mbed-led-7

If the loading is finished, you can see the mbed library. Please choose the mbed library and click “import” button.

mbed-led-8

Check “update all sub-libraries to the latest revision” and click “Import” button.

mbed-led-9

You can see the mbed libraries are added as below.

mbed-led-10

Let’s program the simple coding to main.cpp. This program will turn on the LED using CDS sensor and PIR sernsor. If the coding is completed, click “Compile” button. If there is not any problem in your coding, the compile is completed and a ‘bin’ file is downloaded.

auto_led_9

The downloaded ‘bin’ file can be programmed to the board just by copy and paste into the “MBED” disk.

mbed-led-11

 

Your code can be shared with other mbed users by clicking “Publish” button.

mbed-led-12

mbed-led-13

Below is the demonstration movie.

Ethernet Connection

We will add the Ethernet connection to the board by using W5500 Ethernet Shield.

mbed-led-ethernet-1

Create a program named “auto_LED_Ethernet” and main.cpp file. Import the mbed library and  WIZnet_Library. If you search with the key word “WIZnet”, you can find the WIZnet_Library.

mbed-led-ethernet-2

Check “Update all sub-libraries to the latest revision” and click “Import” button.

mbed-led-ethernet-3

You can see WIZnet_Library is added in the “auto_LED_Ethernet” program tree.

mbed-led-ethernet-4

We will make the code that client sends the data about LED Status, motion detection and illumination intensity to the server.

Below is the demo movie.

[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

0 20 0

Leave a Reply