loading

In this tutorial I am going to cover how this new open source board can be used to easily build a wireless sensor node network.

In the previous instructable here, I showed how to configure winkel board and also covered "getting started" by flashing a Blink example on it.

Winkel Board has everything you would require to create a sensor mesh network, because it has an onboard NRF24l01 radio transceiver module.

This example will show you how to configure a winkel board as a transmitter/receiver, how to sense information from a sensor, send that information over wireless network and what you can do with that sensor information.

Here are the things you will need for this example.

  1. 3 x Female connectors
  2. 2 x Winkel Board (actually just one. For transmitting you can use any arduino micro controller and interface NRF24l01 )
  3. 1 x PIR Motion Sensor
  4. Arduino IDE 1.6 or greater for flashing code WIRELESSLY :P

So let's get started

Step 1: Pin Connections and Setup for Wireless Programming

Before setting up Winkel for transmission and receiving, lets look at the Pin connections on the transmitter end and set up the boards for Wireless programming and wireless uploading of sketches.

Pin Connections

Winkel Board Motion Sensor

Pin2 -> Digital O/P Pin of sensor

Vcc (5v) -> Vcc (5v)

GND -> GND

Wireless Programming

I have attached all the source .INO files so you can upload them on winkel and get started with this example. After you are comfortable with it, you can expand its capability to add more sensor nodes in your network.

Before uploading the sketch, lets get started with configuring Winkel for Wireless Programming. This will be just one time configuration.

  1. Power ON Winkel Board
  2. Start Bluetooth on your Laptop/PC
  3. Go to Control Panel and Under "Hardware & Sound" Select "Add a device"
  4. This will take you to a screen where you will see scanned devices and will see "HC-05" that is on Winkel Board.
  5. Connect to this device. Use pairing code "1234" and you should be connected to Winkel Board
  6. Now Go To "Control Panel -> Hardware and Sound -> Devices and Printers" and you should see "HC-05" somewhere in the list. Right Click on it and go to "Properties"
  7. Go To "Services" tab and make a note of the Serial COM port. This port will show up in Arduino IDE.

These steps are rather very easy to configure on Windows machine. However on Linux, pairing a stock HC-05 is itself buggy as in it sometimes work sometimes doesn't. I will be documenting the steps later on as the work is still in progress on Linux end. But Pro Makers would already know that the COM port in linux will usually be /dev/rfcomm0

This will configure the main controller ATmega128 on the winkel board to be wirelessly programmed over Bluetooth serial. But there is an onboard ESP8266 ESP12E that we also wish to configure for wireless programming over your WiFi. Let see how we can do that.

  1. Go To your wireless network connection on PC/Laptop and look for an access point called "AutoConnectAp". Connect to this access point using password "password"
  2. Open Browser and navigate to 192.168.4.1
  3. This will take you to a page where you can tell Winkel Board's wifi module to always connect to your home/work wireless network when it is powered ON. Select "Configure WiFi" and select your network to connect.
  4. Enter password of the selected network and you will get a prompt "Credentials Saved". At this point of time wait a few seconds for the ESP8266 to restart and connect to your configured network.

Now your PC/Laptop and winkel board will be on the same network and you are ready to wirelessly program ESP12 module over WiFi


PS: I will do a detailed instructable on wireless programming using Arduino IDE as well as AVRdude. I am also having a detailed Github page ready for support and documentation.

The above steps are just one time configuration that you will need to perform and you will be good to go with wireless programming anytime. If wireless programming is not your thing, then until you get comfy with it, you can perform normal wired programming.

Step 2: Winkel As a Transmitter

Uploading the sketch

  1. Open the sketch "sketch_winkel_motionSensor.ino" in Arduino IDE.
  2. Go to "Tools -> Board" and select Winkel Board.
  3. Go To "Ports" and select the Bluetooth COM Port. This is the Bluetooth port to which the HC-05 on the Winkel Board is connected to your PC/Laptop as mentioned in the previous step.
  4. Hit Upload on the arduino IDE and see how the code magically flashes on the Winkel Board without wires :D

The sketch is pretty basic and it tells the winkel board to see if there is any input on its Pin2 and if there is, send a packet to receiver over a pipe using radio.write() a famous method included in RF24.h library. In addition it tells winkel board to blink its onboard LED (led 13) just as an indicator that Motion was sensed.

Step 3: Winkel As a Receiver

Uploading the sketch

  1. Open the sketch "sketch_winkel_motionSensor_rx.ino" in Arduino IDE.
  2. Go to "Tools -> Board" and select Winkel Board.
  3. Go To "Ports" and select the Bluetooth COM Port. This is the Bluetooth port to which the HC-05 on the Winkel Board is connected to your PC/Laptop as mentioned in the previous step.
  4. Hit Upload on the arduino IDE and see how the code magically flashes on the Winkel Board without wires :D
  5. The sketch is pretty basic and it tells the winkel board to check to continuously send read if any data packets are being received over radio.

If at all any data packet is received, then what needs to be done with that data?? To show this, I am providing a simple use case in this example. I am running a webpage on winkels onboard ESP12E module. This page displays if Motion was detected or not.

So the entire scenario works this way

  • Motion sensed by winkel board as a transmitter.
  • Motion Detected alert relayed/transmitted to winkel board as a receiver.
  • This alert that is received, is displayed on a Webpage that is being served by the on board Wifi Module ESP8266-12E on the receiver winkel board.

Before we see the packet received on the webpage we need to set it up. Lets see how to do that.

  1. Open the sketch "sketch_winkel_esp12e_OTA_bootloader.ino" in Arduino IDE.
  2. Go to "Tools -> Board" and select "NodeMCU ESP12E Module". If you are not seeing this, it means you have not performed an installation for ESP8266 board and library. See how you can do that here
  3. Go To "Ports" and Under "Winkel OTA" you will see IP address of your ESP12E module. Select that and Hit Upload button on the IDE.
  4. Again, watch the magic of wireless programming over WiFi.
  5. After the code is successfully uploaded, Open your browser and navigate to the IP address of the ESP12E module and you should see a basic Web Page as shown in the image.

This page will show you real time "Motion Detected" alerts that was received from the transmitter.

Step 4: Video Demonstration

Power up both the Winkel Boards. You can move your hand in front of the motion sensor on the winkel board as transmitter. This will blink an LED on the transmitter and will send a packet to the receiver.

If the packet is successfully received, you will see "Motion Detected" alert in RED on the web page that is beign served by the receiver.

Watch the video to see the entire demonstration.

Basically you can do all kind of crazy things with the sensor information that was transmitted.

  • You can upload that information over cloud.
  • You can provide push notifications via Email or SMS gateways.
  • You can use the On board RTC and log the time of the information received and then use it as a parameter to plot graphs and charts.
  • Toggle a light using a relay. Or trigger an Alarm.
  • You can relay the information to other nodes in the network. Or relay it to some Bluetooth enabled device.

Endless possibilities !!!

So if you see the over all example and build (leaving apart the one time configuration for wireless programming) with just 3 wires you can get started with creating a Wireless Sensor Node Network using the Winkel Board.

The launch date is very near and we will be going live with our crowdfunding campaign here where you can sign up for early rewards. Would love to answer your queries in the comment section. Thank You. :)

About This Instructable

567views

13favorites

License:

Bio: I am a Software Engineer with a keen interest and passion in electronics, open source hardware and software.
More by RishiH:Wireless Senor Network Using the Winkel Board The Winkel Board 
Add instructable to: