Monday, 27 February 2017

NODEMCU EXPERIMENTS

Arduino:

Arduino is an open source, computer hardware and software company, project, and user community that designs and manufactures microcontroller kits for building digital devices and interactive objects that can sense and control objects in the physical world. The project's products are distributed as open-source hardware and software, which are licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL), permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially in preassembled form.

Installing Arduino Software (IDE) on Windows 10 :

I followed this video to install Arduino 1.8.1 and set up with windows installer from in my Windows 10 from " https://www.arduino.cc/en/main/software ".


Post installation  Arduino 1.8.1,  ESP8266 package needs to be added form " http://arduino.esp8266.com/stable/package_esp8266com_index.json " in the Additional Board Manager URLs text field and  Port needs to be changed to15200 and CPU frequency to 80MHz.

I installed CH340G driver which was labelled on NODEMCU and followed the steps from " https://learn.adafruit.com/adafruit-arduino-ide-setup/windows-setup "

EXPERIMENTS:


I. Blinking Experiment:

 Blinking the light on the NODEMCU.

Software and Hardware Requirements:
  • NODEMCU
  • Breadboard
  • Arduino IDE
Procedure :
Here is the Video of the output 



II. LED blink on a different GPIO

Blinking a External LED Light bulb using NODEMCU.

Software and  Hardware Requirements

  •  Arduino 1.8.1.
  • NODEMCU.
  • LED Light Bulb.
  • 200 Ohms resistor.
  • Connecting wires.
  • Breadboard.
I uploaded the code in GITHUB repository. Here is the link to the code https://github.com/aneeshk263/internet-of-things/blob/master/NODEMCU%20%20LED%20blink%20on%20a%20different%20GPIO 

Here is the video output of the experiment :

III. Reading the DHT11 and writing back to the serial port

Read and display the temperature and Humidity in celsius on the serial monitor.

Software and Hardware Requirements:

  • DHT11 sensor
  • Connecting wires
  • Arduino IDE
  • NODEMCU
  • Breadboard
  • 10K Ohms resistor
connections for the experiment:
  • Connect a 10K Ohms resistor between VCC and DATA.
  • Connect the GND of the DHT11 sensor to GND of the NODEMCU.
  • Connect the DATA to the D3 (pin 0).
  • Connect the VCC to 3V.

Here is the video of output :

IV. Reading and Displaying Temperature from DHT11 and Displaying it on 5 LED scale.

Reading Temperature from DHT11 and Displaying it on 5 LED scale.
Requirements:
  • 5 LED’s
  • DHT11 sensor
  • Jumper wires
  • Arduino IDE
  • NODEMCU
  • Breadboard
  • 10K Ohms resistor
  • 1k Ohms resistor

Procedure:

Connect the positive end of 5 LED bulb of different colors and  Set a Scale for each LED bulb and connect one end of 1k Ohms resistor to the GND and the other end to negative end of 5 LED bulbs.





Monday, 20 February 2017

LED flashing experiment


Flashing GPIO using Raspberry PI:

The Objective of this experiment is to create a flashing led that turns off and on every two seconds using the GPIO of the PI.

Following is the circuit to enable flashing GPIO using:


Tuesday, 14 February 2017

Temperature and Humidity sensor Experiment from Arduino kit and Raspberry pi using python.

The basic Circuit Diagram of the experiment





.






















Code in python to get values from sensor:
import sys
import Adafruit_DHT
# Parse command line parameters.
sensor_args = { ’11’: Adafruit_DHT.DHT11,
’22’: Adafruit_DHT.DHT22,
‘2302’: Adafruit_DHT.AM2302 }
if len(sys.argv) == 3 and sys.argv[1] in sensor_args:
sensor = sensor_args[sys.argv[1]]
pin = sys.argv[2]
else:
print(‘usage: sudo ./Adafruit_DHT.py [11|22|2302] GPIOpin#’)
print(‘example: sudo ./Adafruit_DHT.py 2302 4 – Read from an AM2302 connected to GPIO #4’)
sys.exit(1)
# Try to grab a sensor reading. Use the read_retry method which will retry up
# to 15 times to get a sensor reading (waiting 2 seconds between each retry).
humidity, temperature = Adafruit_DHT.read_retry(sensor, pin)
# Un-comment the line below to convert the temperature to Fahrenheit.
# temperature = temperature * 9/5.0 + 32
# Note that sometimes you won’t get a reading and
# the results will be null (because Linux can’t
# guarantee the timing of calls to read the sensor).
# If this happens try again!
if humidity is not None and temperature is not None:
print(‘Temp={0:0.1f}* Humidity={1:0.1f}%’.format(temperature, humidity))
else:
print(‘Failed to get reading. Try again!’)
sys.exit(1)

sudo ./AdafruitDHT.py 2302 04


Here is the output of the experiment in a video:


Temperature and Humidity sensor Experiment

RELATIVE HUMIDITY?
The DHT11 humidity and temperature sensor measures relative humidity (RH) and temperature. Relative humidity is the ratio of water vapor in air vs. the saturation point of water vapor in the air. The saturation point of water vapor in air changes with temperature. Cold air can hold less water vapor before it is saturated, and hot air can hold more water vapor before it is saturated. The formula for relative humidity is as follows:
Relative Humidity = (density of water vapor / density of water vapor at saturation) x 100%
Basically, relative humidity is the amount of water in the air compared to the amount of water that air can hold before condensation occurs. It’s expressed as a percentage.  For example, at 100% RH condensation (or rain) occurs, and at 0% RH, the air is completely dry.
HOW THE DHT11 MEASURES HUMIDITY AND TEMPERATURE?
The DHT11 calculates relative humidity by measuring the electrical resistance between two electrodes. The humidity sensing component of the DHT11 is a moisture holding substrate (usually a salt or conductive plastic polymer) with the electrodes applied to the surface. When water vapor is absorbed by the substrate, ions are released by the substrate which increases the conductivity between the electrodes. The change in resistance between the two electrodes is proportional to the relative humidity. Higher relative humidity decreases the resistance between the electrodes while lower relative humidity increases the resistance between the electrodes. Inside the DHT11 you can see electrodes applied to a substrate on the front of the chip:

The DHT11 converts the resistance measurement to relative humidity on an IC mounted to the back of the unit and transmits the humidity and temperature readings directly to the Arduino. This IC also stores the calibration coefficients and controls the data signal transmission between the DHT11 and the Arduino:

The temperature readings from the DHT11 come from a surface mounted NTC temperature sensor (thermistor) built into the unit. To learn more about thermistors and how to use them on the Arduino, check out our Arduino Thermistor Temperature Sensor Tutorial.
The DHT11 uses one signal wire to transmit sensor readings to the Arduino digitally. The power comes from separate 5V and ground wires. A 5K – 10K Ohm pull-up resistor is connected from the signal line to 5V to make sure the signal level stays high by default (see the data sheet for specifics on how the signal is sent).

There are two different variations of the DHT11 sensor you might come across. One type has four pins, and the other type is mounted to a small PCB that has three pins. The PCB mounted version with three pins is nice since it includes a surface mounted 10K Ohm pull-up resistor for the signal line:
   

The circuit Looks like this:

Monday, 13 February 2017

Refernce links for the IoT investigation

Here are the Reference links that i think will be useful for my domain of interest :

1. "Smart Shelves":http://www.usatoday.com/story/money/nation-now/2015/10/04/kroger-tests-smart-shelf-technology/73320236/

2. http://ioeassessment.cisco.com/see/ioe-work-retail-0

3. https://www.ibm.com/internet-of-things/iot-zones/iot-retail-stores/

4. http://www.intel.com/content/www/us/en/internet-of-things/smart-retail-solutions.html

5. https://www.kaaproject.org/retail/

6. https://www.emarketer.com/Article/How-Internet-of-Things-Changing-Retail/1013799

7. https://blog.beaconstac.com/2015/10/4-innovative-internet-of-things-examples-in-retail/

8. http://www.zdnet.com/article/five-ways-retailers-iot-today/

9. http://www.sdcexec.com/article/12165982/three-ways-the-internet-of-things-will-change-retail

10. http://www.postscapes.com/internet-of-things-award/2014/connected-retail/

11. http://www.sdcexec.com/article/12165982/three-ways-the-internet-of-things-will-change-retail

There are more to come under this section but as of now, these are few website I think are useful for the research and investigation. I will update the links in future if any other website helps my research.

Domain of Research

Internet of Things in Retail Industry:
Internet availability and connectivity to electronic devices and sensors can make many things happen with least human intervention. Modern retail has seen something of a tech revolution in the past few years, with new innovations becoming available on a regular basis.
The pace of change is so great that today’s bright spark is next year’s standard requirement.
For example, the smart shelves launched by Mondelez International, in 2013 were marketed as state-of-art technology, but are now considered a simple modular solution (Dell, Panasonic – Smart Shelves). Such is the rapid evolution of technology. similarly, recent hot topics, such as cloud and big data, will soon no longer be considered cutting-edge technology. Indeed, the technology frontier and competitive edge will move towards the Internet of Things (IoT), and the shift has already started.
So, what is IoT? Gartner describes it as “the network of physical objects that contain embedded technology to communicate and sense or interact with their internal states or the external environment”. A recent Gartner survey has marked IoT as the fastest growing trend in technology and estimates that by 2020, the number of Internet-connected objects will increase by 30 times.

There are few more applications of IoT in the Retail industry that caught my attention:

1.     Predictive equipment maintenance is used for managing energy, predicting equipment failure or detecting other issues. For example, every grocery store has a lot of complex equipment – most people recognize refrigeration units. When these units are instrumented with sensors, we can predict maintenance issues that might affect power consumption for savings or monitor temperature fluctuations to ensure food safety.
2.     Moving merchandise more efficiently is one of the goals of smart transportation applications in retail, and IoT can come into play with the maintenance of transport, tracking and route optimization. We know many retailers have been using GPS to track and route trucks in the last couple of years. With IoT, we are able to understand to a much higher degree of accuracy how close a pallet of merchandise is to a given store.
3.     When it comes to demand-aware warehouse fulfillment, we’re talking about warehouse automation and robotics driven by online and in-store shopping demand. IoT allows us to monitor sales opportunities in real time and track missed in-store sales. It's important to remember that RFID is a well-tested part of IoT that can be used for inventory management and more accurate service-level optimization. Currently, a typical distribution center or warehouse is organized by aisles and shelves based on a fixed schematic. The warehouse of the future will be open space where automated pallets self-organize based on real-time demand.
4.     Increasingly, the connected consumer is having an impact on brick-and-mortar locations. Retailers understand that customers are able to check in-store pricing and local inventory levels from their mobile devices. Imagine if we could make a customized best price offer or provide location-based services right in the store. What if we could target our high-value, loyal customers with concierge services? In the past, it was accepted as the norm that we would send mass promotions to customers with the expectation that some acceptable percentage might be interested in that promotion. With IoT, we can now understand the context (the time and the place of the customer) to identify when we are certain the customer needs help or an incentive to purchase, and we can respond proactively.
5.     In a smart store, mall traffic can be analyzed across several retailers so we understand the entire shopping journey. In the past, we had to run expensive survey projects to understand if store associates were being responsive to customer service needs and then enact elaborate staff training programs. Now, within smart stores, we will be able to use video or Wi-Fi foot-traffic monitoring to see if customers dwell over a product area. Then, in real time, direct an associate to help that customer or analyze that information later to adjust store layouts for more efficient customer visits. In addition, by monitoring store traffic and customer demand in real time, we can customize the current in-store shopping experience. That gives us the opportunity to implement rich digital marketing inside the store or announce events to customers via their mobile devices.
With the rapid growth of online shopping, retailers are very keen to bring the frictionless customer experience of online shopping into the store wherever they can. They want access to the same type of rich data and high-performance analytics that retailers use to drive websites and mobile shopping trips. Their goal is to have that same limitless control to craft a customer experience and collect detailed data to help them predict how customers will shop.
The differentiation with IoT will come from a retailer’s ability to sense act and understand on IoT data with analytics. It won’t be in the technology, the devices or the IoT plumbing. To take advantage of this new promising area, retailers should focus on IoT applications that better serve customers and create value.





Outline and References of Retail Sector in Internet of Things

Here are the applications of IoT in the Retail sector:



Smart Shelf Technology:

Kroger is deep into experimenting with “smart shelf” technology at a Cincinnati-area store. Kroger has added shelf sensors and analytics technology to track grocery shoppers on their mobile devices, offer them tailored pricing on some products and call out products on their mobile shopping lists on display screens


References:

AmazonGO: 

Amazon has created a small Seattle grocery store that allows customers to just take what they want off the shelves and leave, without having to wait in line or check out with a cashier. In addition to traditional grocery items, Amazon Go will also feature meal kits with fresh ingredients to be prepared at home.

When you enter the store, you start up the Amazon Go app on your smartphone. The store then uses a lot of cameras and LIDAR sensors (lasers) to track everything you do once inside the store.




Costa Cofee Vending machines:

Intel's top-end Core i7 processor is being used in Costa Coffee's latest coffee machines - not to brew hot drinks, but for real-time facial analysis.When it detects a human is standing there, it will switch to the menus and you can start ordering your coffee. As you’re selecting through your coffee, you hear the sights and sounds of a barista in the background, the clinking of cups and the grinding of beans - and this is actually the grinding of your coffee - and then you get the smell of those beans from a little smell vent. And the touch is the touchscreen interaction, and the taste is of course the coffee you get at the end. 



References:












Tuesday, 7 February 2017

Remotely controlling the Raspberry Pi

The advantage of connecting the Pi is that it can supply the power for the Pi and it doesn’t require the keyboard, mouse or display attached to the Pi separately.
Step by step procedure is as follows:
You can enable/disable the serial console with either editing /boot/config.txt or raspi-config (which will edit /boot/config.txt for you)

Option 1. Enabling in /boot/config.txt

You can pop your SD card into a computer and edit config.txt with a text editor like SimpleText, WordPad or whatnot. You can also edit on a pi with sudo nano /boot/config.txt
At the bottom, last line, add enable_uart=1 on it's own line
learn_raspberry_pi_enableuart.png

Option 2. Enabling via Raspi-Config

Using a monitor and keyboard, log into the shell and run
sudo raspi-config
go down to Advanced Options
learn_raspberry_pi_advanced_options.png
Hit enter and then go down to Serial
learn_raspberry_pi_seria.png
Select Yes
learn_raspberry_pi_yes.png
It should now be enabled
learn_raspberry_pi_enab.png
Hit return then select Finish
When it asks you to reboot, go to Yes and hit return