Arduino Training Kit For Schools | Botshop
Wemos D1 review  Wifi development board

Wemos D1 review Wifi development board

ESP-12E WeMos D1 review

Wemos D1 review

This board has quickly become our board of choice when we do Wifi project development. It looks just like an Arduino Uno and many Arduino shields will work with this board. Se sell them here at Bot Shop too – https://www.botshop.co.za/product/esp-12e-wemos-d1-wifi-board/

The D1 microcontroller is a beast compared to the Arduino Uno

The WeMos D1 uses the ESP 8266 microcontroller that is 2 x faster than an Uno, has 160Kbs of Ram compared to the 2K of an Uno and a 100x  the amount of  Flash memory! And each I/O pin is interruptable!

Most importantly is that it has embedded Wi-Fi and the center point of this wemos d1 review.

Microcontroller specs

• A 32 bit RISC CPU running at 80MHz
• 64Kb of instruction RAM and 96Kb of data RAM
• 4MB flash memory
• Wi-Fi
• 16 GPIO pins
• I2C,SPI
• I2S
• 1 ADC

The only area the Arduino chip is better is that it has 6 ADC’s and the D1 just one, although that will very seldom a problem as you have both I2C and SPI on the chip, it is still worth taking note of this. If you need more ADC’s it is easy to add a multiplexer to increase the amount of ADC’s.

Use your Arduino IDE to program the chip.

The Arduino IDE can be used to program the D1. The Wemos D1 have a USB to TTL chip on board for direct uploading of programs via USB directly from your PC. The chip used is the CH340G chip and unfortunately, a driver needs to be installed for some versions of Windows that does not include this driver. If your Windows version does not recognise the board it can easily be downloaded and installed, doing a Google search on “CH340G driver” will show many download links.

In this Wemos D1 review we do not want to go to much into details regarding programming but I have good links to follow,

The next thing you will need to do is to add the Wemos D1 board to the list of boards already in the Arduino IDE. Here is an instructable on how to do that, it is pretty good http://www.instructables.com/id/Programming-the-WeMos-Using-Arduino-SoftwareIDE/

Oh, you will be able to upload to the board. To get the WiFi to work is not as difficult as I thought it will be, I used this instructable to do so: http://www.instructables.com/id/Programming-a-HTTP-Server-on-ESP-8266-12E/

Pin assignments

Something to note is that the pin assignment between the D1 and Uno is different. The Uno has the onboard led connected to pin 13 and the D1 to pin 14 as can be seen from the table below, If you, for example, upload the blink sketch to the D1 you will first need to change the sketch by replacing all calls to pin 13 to pin 14.

Wemos D1 pin assignments

Some things to be aware of.

  • As discussed the pinout differences, of cause the power pins are at the correct places.
  • Becuase of the pinouts some Arduino shields will not work out of the box, you will need to change the pin mappings. As an example, I had an LCD shield working in minutes without much effort.
  • The normal Arduino libraries will not always work, the LCD shield library worked with no problem though.

Wemos D1 review Summary.

Well, you can’t beat the price nor the ease of use. Microcontroller + Wifi for the same price as an Uno. I will always use my beloved Arduino Uno because of the amount of libraries and code available on the Internet but…. as soon as I need to use WiFi in my projects I will go for the Wemos D1. You can get yours from us here  https://www.botshop.co.za/product/esp-12e-wemos-d1-wifi-board/

Official Arduino Day 2017

Official Arduino Day 2017

Arduino day will be taking place on 1 April 2017, many haven’t even heard of it, so what is all the fuzz about.

What is Arduino Day?

Arduino Day is a worldwide birthday celebration of Arduino. It’s a 24 hour-long event – organized directly by the community, or by the Arduino founders – where people interested in Arduino get together, share their experiences, and learn more. whether you are newbies, makerspaces, hackerspaces, fablabs, associations, teachers, professionals, or any other user group Arduino day is for all who are fascinated by Arduino.

What will Arduino Day offer?

You can attend an event or organize one for your community. It doesn’t matter whether you are a Maker, an engineer, a designer, a developer or an educator: Arduino Day is open to anyone who wants to celebrate Arduino and all the amazing things that have been done (or can be done!) with the open-source platform. The events will offer different types of activities, tailored to local audiences all over the world.

Some projects from previous Arduino Days

What will we be doing for Arduino Day?

On Arduino Day we will be hosting an Arduino Beginner to Intermediate Training course for ages 10 and up! Have you subscribed to our newsletter? We will have an Arduino Day sale and will send details in our newsletter.

What you will learn on the training:

  • The internal working of Arduino.
  • Some key elements to programming.
  • Electronics around your program.
  • Four projects will be built excluding the bonus project.
  • Time will be given to chat to trainers in person.
  • trainers will be available if there is any confusion during the projects.

What you will need:

  • 5 LED’s
  • 5 resistors between 150E and 1k
  • 10k Potentiometer
  • Jumper cables
  • Arduino
  • Laptop

For those that do not have the components needed, we do have two options for you.

  1. When filling out the Registration form, select the number of small training kits.
  2. You could get our Monster Kit, also by selecting it on the registration form.

Please return filled out registration forms to kin@botshop.co.za

Simple Arduino esp8266 web server ESP-07 ESP-12

Simple Arduino esp8266 web server ESP-07 ESP-12

Arduino esp8266 web server

To be able to host your own simple web server is easy all you need is the ESP8266 Serial WIFI Module and FTDI232 downloader here is a short description of both and a link on where to find it, An Arduino is not required at all and the ESP8266 board can be a stand alone board and it can be programmed with an FTDIboard. This blog is called Arduino esp8266 web server because you can also connect the wifi module to an Arduino if you want.

The ESP8266-03 is a highly integrated chip designed for the needs of a new connected world. It offers a complete and self-contained Wi-Fi networking solution, allowing it to either host the application or to offload all Wi-Fi networking functions from another application processor.

The USB to TTL serial adapter is based on the high quality and very popular FTDI FT232RL chipset and is an excellent way to connect TTL serial devices to a PC through a USB port and to program your Arduino esp8266 web server.

Unlike most USB to TTL serial adapters, this adapter supports both 5V AND 3.3V operation! Simply set the jumper as required to choose between 5V and 3.3V as labelled on the board.

Part List
  • ESP-07/ESP-12
  • FTDI232
  • Jumper Wires
  • 10k Resistor
  • Pushbutton
  • Breadboard
  • Stripboard
  • 2x 8 pin headers male or female
STEP1: Easy Access

Grab your headers, ESP module and strip board. Cut the Stripboard down to size (8 columns 9 rows), if you are unsure of the size you could cut it afterwards, remember to break the tracks at the bottom. Next solder thin wire to the pads of the ESP module and put each wire in its own column and solder it to the stripboard, next solder in the headers.

This part is very important because the pitch of the module’s pads are 2mm and that of the breadboard are 2.54mm.

esp8226-bb-2

20161123_111632

STEP2: Wiring

Now we will look at the wiring of the module, something to keep in mind is that the module runs on 3.3V. The above mentioned Downloader(FTDI232) supports both 3.3V and 5V, switch the jumper to 3.3V if your downloader does not support 3.3v, you will have to add a voltage divider as shown below, below that is the wiring of the module.

untitled

esp8226-bb-1

 

STEP3: Setup

First things first, if you haven’t got the ESP8266 library yet see “Getting Started with NodeMCU with ESP8266 part 1” on how to install the library, next we have to select the type of board and programmer.

First select the Board Tools -> Board -> Generic ESP8266 Module

board

Next select the programmer Tools -> Programmer -> USBasp

programmer

Now you can connect your programmer and select the port. We’re using an example sketch for this tutorial. File -> Examples -> ESP8266WebServer -> Hello Server. Remember to add your SSID and password.

 

STEP4: Uploading

Now that the wiring is done and your Arduino IDE is set up, we can start the upload process.Uploading to the ESP module could become tricky if you don’t keep track so pay close attention.

Firstly  connect GPIO 0 to ground.

gpio0

If the ESP module is powered up already, press the reset button you installed on the breadboard (pushbutton), if not just power up the module via the USB cable to the downloader. This process boots the  module up in program mode. You can now upload you sketch to the module. Once upload is complete, disconnect GPIO 0 from ground and reset it again, this allows the module to operate as normal. and your upload is complete.

 

STEP5: Connecting To The Server

When you are done uploading and you have removed the wire from GPIO 0 you can open your “Serial Monitor”. It should display the connection status after it has connected to your WIFI-router it will display an IP-address, copy this IP and enter it into your browser’s search bar. It will display the words “Hello From ESP8266” in your browser window.

Arduino Simulator App Review

Arduino Simulator App Review

Arduino Simulator Review – Start Developing Without a Real Arduino Board

We had stumbled across this Arduino simulator, in which you can use both electronics and you Arduino skills to be able to test your circuit before buying the necessary component or just to prevent you having a fried Arduino.

This Arduino simulator is free and works really great, although it has one major downside, the sketches have to be saved in .hex files then imported into the simulator but other than that it’s a really great app to have. Once you get the hang of creating the hex files it is actually not too bad and it becomes quite effortless.

 

 

Below is a simple explanation on how to use the Simulide Arduino simulator.

First, you will have to download Simulide.zip and extract the entire archive to your desired folder. If you run the executable from within the archive some functions will not be available. After extraction process has completed you can run the executable (.exe).

Next, build your circuit, remember to adjust the resistor values, on the left click on Properties and double click on the resistance value.

 

 

After you have built your circuit you can compile your sketch into a HEX file. In your Arduino IDE make sure your sketch is saved then go to Sketch->Export compiled Binary, or press Ctrl->Alt->S.

Now it’s time to load your sketch into the simulator, Right-click on the Arduino and select “Load firmware” and load your HEX flie you just exported, there will be two HEX files “xx.ino.standard.hex” and “xx.ino.with_bootloader.standard.hex” you have to select the one without the bootloader.

You are all set now and you can click on the power button at the top.

Another great Feature

The probe is another great feature the app has. Put the probe on up to four of your output pins and right click on it and select add to plotter.

Please note that this might look like an oscilloscope but it is a logic analyzer and will not work with PWM signals, for PWM signals select “Add to Oscope” instead of “Add to plotter”

Arduino kits with Arduino course

Arduino kits with Arduino course

Wouldn't it be cool

if you can make awesome things from day one?

With our training, you can! We can teach you how to build amazing gadgets at your own pace in the comfort of your own home.

Arduino course info
online training

Welcome to the world of modern electronics and our Arduino course.

Do you also dream about building super cool gadgets, building something unique and become an electronics maker? Or how about starting a career or business building unique things?

How about putting that “spark” back you might have lost because of the mountains of books and nothing great to build in the near future? Where did the fun go?

We make learning electronics and robotics exciting, fun and super easy with our online Arduino course,

These kits are for the builders, those guys that got great ideas they want to change into reality and also for those guys that are very near giving up on their electronics dreams.

See the Monster Kit content list here.

We believe in crazy saving!

Right now you will get a complete kit, but also more than 50% off our Arduino course when buying a kit.

  • Arduino complete kit (3 to choose from)
  • Getting started manual, printed version
  • Projects manual
  • Live long members only forum with access to all our trainers.
  • Online training with certification (limited time offer, see training section below)

Kit content

  • Arduino Uno R3
  • USB Cable
  • 1 x breadboard
  • 1 x LCD screen
  • 1 x Joystick module
  • 1 x buzzer
  • 1 x relay
  • 1 x 8 segment LED
  • 20 x LED’s
  • 1 x 10 k potentiometer
  • 2 x push buttons
  • 1 x shift register IC
  • 1 x tilt sensor
  • 1 x light sensor (LDR)
  • 1 x temperature sensor
  • 10 x 1k resistors
  • 10 x 10k resistors
  • 10 x 560E resistors
  • 1 x motor
  • 1 x servo
  • 1 x 9V battery connector
  • 1 x rain sensor
  • 1 x Joy stick module
  • 1 x headers
  • 25 x jumper cables
  • 10 x du Pount cables

50% OFF ONLINE TRAINING HEEEE HAAAA

Yip. 50% Off, but for a limited period.

The training includes:

  • Training manuals
  • Training videos
  • Online quizzes
  • Members only forum access to trainers
  • Certification if you complete final online exam

Who Is This Kits For?

School Kids

Learn while building amazing products and understand your current studies even better. If you do have a hard time with electronics it is now the time to jump start your electronics training and put the fun back in learning. You will have so much fun and so many a-ha moments, you will forget it is training.

Inventors

Do you want to become a maker and develop your own gadgets or want to make products for money? Making a career out of modern electronic development is one of the most fulfilling and well paid jobs today.

Entrepreneurs

Do you have a great idea that you want to put in the market place or that you want to outsmart your competitors with? This is the place to start.
How to create a PCB From a Diagram

How to create a PCB From a Diagram

How to create a pcb

Converting a circuit diagram to a Printed Circuit Board (PCB) could prove to be a challenging task.

But luckily with technology today it is fairly simple to complete this task, so there’s no need to be stressed out. We will be doing an easy one for today. It is called an A-Stable Multi Vibrator.

First, I will explain the circuit and the working thereof. Imagine that R2 were absent from the circuit, and suppose Q1 started out being turned on. Then Q2 would have nothing to turn it on, and Q1 would be held on by current through R3, while the R4 and the LED would charge C2. The effect would be that LED1 would come on and stay on, while LED2 would never light.

Now add R2. This will cause C1 to charge to -0.7 volts, until Q2 turns on. Once that happens, the charge on C2 would cause the base of Q1 to go negative, turning it off. When that happens, current flowing through LED1  will start flowing through C1 and the base of Q2, turning it on even harder. Once Q2 has turned on, it will keep Q1 off until C2 charges to -0.7 volts.

Note that while the circuit would have a stable state with both transistors on and both capacitors reverse-biased by 0.7 volts, in practice the winky-blink circuit always starts oscillating rather than entering such a state.

 

We will now start with our process. First download your software HERE for Design Spark or HERE for EAGLE CAD, I use Design Spark most of the time.

 

STEP1: Layout
,,,hFirst we’re going to place all of the components in the correct place.

flip-flop-raw-schem

It can be a bit difficult to find the components, but design spark has a great function under view -> Model Source Bar where you could either look under categories or enter a RS Components stock ,number just select your country and search your components you need, enter the stock number and click use component the software will tell you in which library it save the component and you can go fetch it from there. Marked in red are the two ways to find the components you need.

finding-comps-flip-flop-schem

 

STEP2: Connecting
Next we will connect the components together as shown in the image above, note that instead of a battery I have have added a two pole header, when we have the final product we will have two holes where you can solder in the battery leads or you can put headers in those same holes.

flip-flop-schem

STEP3.1: Converting
From here you have a few options. First option is to simply click on translate to PCB.

translate-to-pcb

and follow the easy steps. Your PCB will look something like this

translated-to-pcb

This does not always come out like expected, in which case we will see how to fix this in Step 3.2

STEP3.2: Converting
If your results was not what you expected in Step 3.1, click on Tools -> Unroute Nets -> All Nets.

unroute

You will see that the tracks has disappeared and now there are thin yellow lines. These yellow lines are to show you how the components were connected.

If you chose not to follow the previous option you will have to insert the components manually again. If you did follow the previous option you now only move the components how you feel fit.

This is what mine looks like yours can be different.

option-12-layout

STEP4: Wiring Compnents
For option 1 go to Tools -> Auto Route Nets -> All Nets

auto-route

and follow the instructions.

For option 2 you have to add the track in manually as in the schematic.

Your end result may look different than mine, but in the end, we achieve the same product.

finale

Note: Using option two may result in errors making the PCB useless. Yes option one may have errors as well but only if your schematic was wrong. Some of these errors may prove to be fatal.

I hope this blog post gave you a starting point on how to create a pcb.

Control with the Arduino bluetooth module

Control with the Arduino bluetooth module

We found this incredible tutorial on how to use the HM-10 BLE Arduino Bluetooth module by Hammad Tariq

connections_hn10_arduinoIn this tutorial, you will learn about controlling a LED using HM-10 BLE Arduino bluetooth module, Arduino and Evothings Studio.

Last Summer, I wrote a tutorial about controlling the lights of your home using Arduino and HC-05 bluetooth module. While, HC-05, HC-06 and HC-09 are still famous and available everywhere, they are essentially based on Bluetooth 2.0 technology. On the other hand, many new smartphones support only BLE (Bluetooth Low Energy or Bluetooth 4.0) instead of Bluetooth 2.0 or Bluetooth 1.0. The iPhone is most prominent of those smartphones as it’s supporting BLE since iPhone 4S, which was released nearly 5 years ago!

As I sat down to explore what options we have for prototyping a BLE enabled IoT device, the HM-10 came up as a prominent module in this space as it’s inexpensive and available everywhere. The module is also based on already familiar TI’s CC2541 BLE SoC. The module also has a few clones; one is called BT-05, another is called AT09, yet another is known as the SPP-CA HC-05/HC-06 or BT06, yet some clones are based on ZS-040 breakout boards just like HC-05.

There is an excellent post by Martyn Currey if you want to identify the module you have or want to explore the differences between them. Essentially, if your module is based on CC2541, that is BLE and you should be able to use this tutorial with the exception of UUID of the module, that I will explain later in the tutorial. Also, HM-10 and all other clones use AT commands for configuration, you can read the datasheets for reference but this tutorial or mobile app does not need you to use any AT command.

In addition to the HM-10 and Arduino, I will be using Evothings Studio to develop our mobile app. Evothings Studio is ideal for developing IoT mobile apps as it’s easy to use, gets you started in minutes even if you have “some” knowledge of JavaScript and HTML. Also, it has useful pre-built libraries and plugins, such as, for this example, the Evothings Studio already has necessary libraries to work with BLE, all you need is to write down a few lines of code to connect and send commands to your BLE module.

Step1: What you will need.

 

 

 

1 x HM-10 or anyother similar Arduino bluetooth module
1 x Arduino Uno
1 x LED
1 x 220 ohm resistor

 

Step 2: Connect the circuit

 

 

Connect the Arduino and Bluetooth module pins as shown below.

  1. Connect 3.3V of Arduino to the VCC of HM-10
  2. Connect GND of Arduino to the GND of HM-10
  3. Connect D8 of Arduino to RX of HM-10
  4. Connect D7 of Arduino to TX of HM-10
  5. Connect D2 of Arduino to the long leg of LED along with a 220 ohm resistor
  6. Connect the short leg of LED with the GND of Arduino

 

HM-10 and Arduino Wiring Diagram

HM-10 AND ARDUINO WIRING DIAGRAM

 

 

 

Step 3: Upload the Arduino Sketch

 

 

Go to my Github repository and download/copy-paste the Arduino sketch to your Arduino IDE. Upload the sketch to your Arduino.

Step 4: Download the Evothings Studio

You can skip to next step if you already have Evothings Studio and are familiar with it’s working.

Follow these steps:

  1. Download and install Evothings Workbench on your computer. Generate an anonymous Cloud Key further down on the download page, paste it into the Workbench software.
  2. Download Evothings Viewer app from an appstore (iOS, Android)
  3. Open Evothings Workbench and click on “Get Key” button
  4. Open Evothings Viewer app, provide your connection key and tap the “connect” button
  5. Once the connection is successful, go to “Examples” tab and click the “Run” button for the “Hello World” example

You should see the “Hello World” app loaded into the Evothings Viewer; that is how the whole development suite works together, whatever changes you will make in your app code, the Evothings Workbench will reload it in the Evothings Viewer, allowing you to preview your changes in real time!

Step 5: Developing the Mobile App

On Evothings Workbench, click “Run” for “BLE Scan” example and note down the name of your BLE module.

Clone or download this Github repository on your computer. Open “hm10-arduino-ble” example, go to “app folder”, drag & drop the “index.html” to “My Apps” tab of Evothings Workbench.

Now open “index.html” in your favourite code editor, check “app.connect” function to confirm if your module has the same name as written in the code, else change it with your module’s name.

Now click the “Run” for your new project entry in “My Apps” tab, the app should load in Evothings Viewer, press the “Connect” button. Once connected, use the buttons to switch your LED On/Off.

Tip: If you experience any difficulty in connecting with your module, first identify which module do you have and then search for it’s UUID (universal unique identifier) online. Correct UUID should be given in the app.ledOn and app.ledOff functions of index.html.

Code Explanation

As explained earlier, the Evothings Studio comes bundled with all necessary libraries to connect and get you started with BLE. Our example is making use of arduinoble and easyble libraries which are located in app/libs/evothings directory. See this tutorial on more details about them. As, for now, we don’t need to go in detail of how these libraries are working, we can just focus on the code in the “index.html” file.

Following block of code is used to connect to the BLE module:


app.connect = function()
{
evothings.arduinoble.close();
evothings.arduinoble.connect(
'BT05', // Name of the module.
function(device)
{
app.device = device;
app.showMessage('Connected! Touch buttons to turn LED on/off.');
},
function(errorCode)
{
app.showMessage('Connect error: '   errorCode   '.');
});
};

In this block of code, we are providing the name of the module to the library function of evothings.arduinoble.connect, upon success, we show a success message.

Similarly, analyze following block of code:


// Turn on LED.
app.ledOn = function()
{
app.device && app.device.writeDataArray(new Uint8Array([1]), '0000ffe1-0000-1000-8000-00805f9b34fb');
}
// Turn off LED.
app.ledOff = function()
{
app.device && app.device.writeDataArray(new Uint8Array([0]), '0000ffe1-0000-1000-8000-00805f9b34fb');
}

In this block of code, we are calling library function app.device.writeDataArray to write 0 and 1 to the BLE module along with the UUID of HM-10 module.

In the Arduino sketch, analyze the following block of code:


void loop() {
int c;
if (mySerial.available()) {
c = mySerial.read();
Serial.println("Got input:");
if (c != 0)
{
// Non-zero input means "turn on LED".
Serial.println("  on");
digitalWrite(LED_PIN, HIGH);
}
else
{
// Input value zero means "turn off LED".
Serial.println("  off");
digitalWrite(LED_PIN, LOW);
}
}
}

In this block of code, we are reading the software serial of Arduino. We simply switch the LED on if we receive anything other than 0 on the software serial, similarly, if it’s 0, we turn the LED off.

You can also check the serial monitor of Arduino IDE to see what you are receiving on Arduino’s software serial.

IOT devices NodeMCU with ESP8266 part 2

IOT devices NodeMCU with ESP8266 part 2

IOT devices Part 2

Part 1 can be read here.
In this tutorial we will control electrical devices like fans, lights, etc., using esp8266 from a web browser.  To do that we need to get familiar with IOT devices. The Arduino sketch below shows how you can add HTML code (web page code) to the NodeMcu board so it will give you a web page when connecting to it. The web page the NodeMcu shows you will have buttons you can click on to control relays that in turn will control lights and so on.
What makes this cool is that you can connect to your NodeMcu from your wireless network from any device that got a web browser, including your phone.
Note: Make sure your browser enabled devices and the NodeMcu board is on the same wireless network. Depending on your networking knowledge you can take this a step further and configure your wireless router to do port forwarding and dynamic DNS to access your NodeMcu from anywhere on the Internet. Another good idea is to setup your router to always assign the same IP to your NodeMcu board in your router’s DHCP settings.
The components that you will need for completing this project are very simple, you need to have a NodeMcu module and a relay, make sure you buy a 5v relay, which are very easy to use with esp chips, it doesn’t require an external power supply.
We tested and sell this NodeMCU board.
You can also use this board with the easy and powerful LAU scripting language, more info can be found on the LAU website.

For this example project, I have used a 2 relay circuit. The actual program is written to connect four relays to IOT devices.

You can watch the above video on how it works and how to connect your browser to the IP address returned from esp, all the details are included in this video. The MCU IoT devices make it really easy these days.

Copy the below Arduino code and paste it into your Arduino IDE, then upload the program to your nodemcu or any other esp devices that you are using, make sure to choose the correct port and board. Also, don’t forget to change the SSID and password to your Wi-fi settings.
This program for the esp8266 also will return the status of the device, which will. in turn notify you when it’s connected to the specified network and it will also tell you what IP it received from the router.

#include <ESP8266WiFi.h>

const char* ssid = “Your Network Name”;
const char* password = “Your Password”;

; //
WiFiServer server(80);

void setup() {
Serial.begin(9600);
delay(10);
pinMode(5, OUTPUT);
pinMode(4, OUTPUT);
pinMode(0, OUTPUT);
pinMode(13, OUTPUT);
digitalWrite(5, LOW);
digitalWrite(4, LOW);
digitalWrite(0, LOW);
digitalWrite(13, LOW);

// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print(“Connecting to “);
Serial.println(ssid);

WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println(“”);
Serial.println(“WiFi connected”);

// Start the server
server.begin();
Serial.println(“Server started”);

// Print the IP address
Serial.print(“Use this URL to connect: “);
Serial.print(“http://”);
Serial.print(WiFi.localIP());
Serial.println(“/”);

}

void loop() {
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}

// Wait until the client sends some data
Serial.println(“new client”);
while(!client.available()){
delay(1);
}

// Read the first line of the request
String request = client.readStringUntil(‘\r’);
Serial.println(request);
client.flush();

// Match the request

if (request.indexOf(“/light1on”) > 0) {
digitalWrite(5, HIGH);

}
if (request.indexOf(“/light1off”) >0) {
digitalWrite(5, LOW);

}

if (request.indexOf(“/light2on”) > 0) {
digitalWrite(4, HIGH);

}
if (request.indexOf(“/light2off”) >0) {
digitalWrite(4, LOW);

}
if (request.indexOf(“/light3on”) >0) {
digitalWrite(0, HIGH);

}
if (request.indexOf(“/light3off”) > 0) {
digitalWrite(0, LOW);

}
if (request.indexOf(“/light4on”) > 0) {
digitalWrite(13, HIGH);

}
if (request.indexOf(“/light4off”) > 0) {
digitalWrite(13, LOW);

}
// Set ledPin according to the request
//digitalWrite(ledPin, value);

// Return the response
client.println(“HTTP/1.1 200 OK”);
client.println(“Content-Type: text/html”);
client.println(“”); // do not forget this one
client.println(“<!DOCTYPE HTML>”);
client.println(“<html>”);
client.println(“<head>”);
client.println(“<meta name=’apple-mobile-web-app-capable’ content=’yes’ />”);
client.println(“<meta name=’apple-mobile-web-app-status-bar-style’ content=’black-translucent’ />”);
client.println(“</head>”);
client.println(“<body bgcolor = \”#f7e6ec\”>”);
client.println(“<hr/><hr>”);
client.println(“<h4><center> Esp8266 Electrical Device Control </center></h4>”);
client.println(“<hr/><hr>”);
client.println(“<br><br>”);
client.println(“<br><br>”);
client.println(“<center>”);
client.println(“Device 1”);
client.println(“<a href=\”/light1on\”\”><button>Turn On </button></a>”);
client.println(“<a href=\”/light1off\”\”><button>Turn Off </button></a><br />”);
client.println(“</center>”);
client.println(“<br><br>”);
client.println(“<center>”);
client.println(“Device 2”);
client.println(“<a href=\”/light2on\”\”><button>Turn On </button></a>”);
client.println(“<a href=\”/light2off\”\”><button>Turn Off </button></a><br />”);
client.println(“</center>”);
client.println(“<br><br>”);
client.println(“<center>”);
client.println(“Device 3”);
client.println(“<a href=\”/light3on\”\”><button>Turn On </button></a>”);
client.println(“<a href=\”/light3off\”\”><button>Turn Off </button></a><br />”);
client.println(“</center>”);
client.println(“<br><br>”);
client.println(“<center>”);
client.println(“Device 4”);
client.println(“<a href=\”/light4on\”\”><button>Turn On </button></a>”);
client.println(“<a href=\”/light4off\”\”><button>Turn Off </button></a><br />”);
client.println(“</center>”);
client.println(“<br><br>”);
client.println(“<center>”);
client.println(“<table border=\”5\”>”);
client.println(“<tr>”);
if (digitalRead(5))
{
client.print(“<td>Light 1 is ON</td>”);

}
else
{
client.print(“<td>Light 1 is OFF</td>”);

}

client.println(“<br />”);

if (digitalRead(4))
{
client.print(“<td>Light 2 is ON</td>”);

}
else
{

client.print(“<td>Light 2 is OFF</td>”);

}
client.println(“</tr>”);
client.println(“<tr>”);

if (digitalRead(0))

{
client.print(“<td>Light 3 is ON</td>”);

}

else

{
client.print(“<td>Light 3 is OFF</td>”);
}
if (digitalRead(13))
{
client.print(“<td>Light 4 is ON</td>”);

}
else
{
client.print(“<td>Light 4 is OFF</td>”);
}

client.println(“</tr>”);
client.println(“</table>”);

client.println(“</center>”);
client.println(“</html>”);
delay(1);
Serial.println(“Client disonnected”);
Serial.println(“”);

}

IOT modules with NodeMCU with ESP8266 WiFI part 1

IOT modules with NodeMCU with ESP8266 WiFI part 1

The ESP8266 WiFi chip

The first thing you need to know is that the ESP8266 WiFi chip is much more than just a WiFi chip. It also includes its own microprocessor, 16 input/output pins, 64 KiB of instruction RAM and 96 KiB of data RAM.

The ESP8266 wifi chip can me run as a serial device from an Arduino but it can also be used as a stand-alone device!

You can use this chip on a breakout board with a couple of components to create a stand-alone Internet Of Things device. This is much more cost effective than an Arduino with a WiFi shield. IOT esp8266 WifI devices became very popular these days because of the amazing benefits included in the ESP chip.

Thanks to the guys who ported the Esp8266 into Arduino IDE and helping all the Arduino users to easily program the ESP8266.

Most of this NobeMCU part 1 post discusses how to install the Esp8266 support for the Arduino and then a short script on how to blink a LED (the hello world in the electronics).

Firstly open the Arduino IDE and then go to the file menu and click on the preference sub menu in the Arduino IDE

Copy the below link into the Additional boards Manager URLs

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Click OK to continue.

After completing the above steps , go to Tools -> board, and then select Boards Manager

Search for ESP8266 in the search bar and install “ESP8266 by ESP8266 Community”.

Once all the above are completed we are ready to program our esp8266 with Arduino IDE.

For this example I have used NodeMCU esp8266, if you are using any other vendor wifi chips or generic wifi module please check with the esp8266 Pin mapping which is very essential to make things works.

The reason why I used D7 pin for this example is , I uploaded the basic blink program that comes with the examples program in the arduino IDE which is connected with 13 pin of arduino. The 13th pin is mapped into D7 pin of NodeMCU.

Go to the tools menu and then the board sub menu and select the type of esp8266 you are using and select the correct COM port to run the program on your esp8266 device. For the Node MCU, select NodeMCU 1.0 (ESP-12E Module)

 

void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

Part 2 of this block post can be found here.

Arduino online training with 22 projects

Arduino online training with 22 projects

Arduino online training

Arduino online training

What is better than an Arduino training kit? …..

Arduino Online Training To Go With It, of cause.

We WANT you to become the next extraordinary electronics maker and we want that journey to be fast and fun.

No more having to search around for hours to try and find answers to your questions. And even more importantly – you have full access to the trainers to get you unstuck when running into problems.

Trainers

Direct access to the trainers to keep you moving along smoothly

Training material

Step by step PDF’s, videos, datasheets and resources all in one place.

Quizes

More than 150 quiz questions. Test your understanding and learn those things you missed

Forum

Forums are used to view questions and answers from fellow students and to ask your own.

22 Projects to build and explained in detail in the Arduino online training!

Building and experimenting with what you learn is crucial and it is also the fun part of your training. Each topic covered in the Arduino online training is accompanied by practical projects to make sure you can not just study but DO!

It’s simple, start from the top and work your way trough each of the 25 topics. Each topic consists of training materials, component datasheets, quizzes and a link to the forum section.

No guessing or searching for hours to find information, everything you need regarding a topic is available inside the topic.

Forums

Our forums will be one of the most important resources tor you. Here you will find questions and answers from other students and that is a learning experience as well.

You can also post your own questions and unlike other forums, you might have seen we will answer questions in detail. Each forum section is covering a specific training topic so that you can focus specifically on the topic.

Quizzes

Quizzes might not sound like a training resource but it is an important one.

It does not only test your understanding and help you find information, you might have missed but also gives you a great idea of what information is most important to know.

It makes you think more and look at things from different “angles”. It also gets you to re-study your training material so you go a second time over it.

It also helps you to practice for the final exam if you are interested in a Bot Shop Maker Certificate.