Raspberry Pi – How it Could Help in Successful Implementation of Smart Cities Project in India

DOI : 10.17577/IJERTCONV4IS29003

Download Full-Text PDF Cite this Publication

Text Only Version

Raspberry Pi – How it Could Help in Successful Implementation of Smart Cities Project in India

Amartyo Banerjee, Cheruveleth Pathala Valsaraj and Suki Venkatesan1

TNQ Software

Vikram Sarabhai Instronic Estate, Phase II, Thiruvanmiyur, Chennai – 600041, India

AbstractAlthough advanced theoretical developments at the commercial cloud level are growing rapidly in the field of Internet of Things, elementary practice has been lagging far behind at the fundamental level. In order to address this, in this paper we report some simple studies by the first author using Raspberry Pi that will be useful to kick start the material practice of internet of things as part of a simple backyard science project for beginners.

KeywordsRaspberry Pi; Internet of Things; Smart City; Wi- Fi; Smart UPS

  1. INTRODUCTION

    Some time back India was at the crossroads, wondering how to absorb technology and make use of it in maximizing benefits to its citizens. There have been, in the recent past, a few demonstrations across world cities on how this could be done. Apart from huge funds, the other requirements are resources such as computer hardware, reliable connectivity; manpower for software development, tech savvy and competent citizenry; and Internet of Things.

    The Government of India took a brave step and announced the development of 100 smart cities across the length and breadth of India. As a first step towards this, following Round 1 of challenge, 20 cities were chosen through a rigorous process of evaluation by a panel of experts for development as smart cities in Round 1 of the Smart City Programme. These 20 cities have been selected for funding in the financial year, 20152016. States and Union territories whose cities are not covered in the list of 20 has been given an opportunity to upgrade their proposals to become eligible for funding on accelerated basis in 20162017.

    Round 2 of the Challenge will see the remaining 54 cities compete with their revised proposals. It is expected that up to 40 cities in Round 2 will be announced.

    Components1 such as Centralised command and control

    centre, Transit operations system (maintenance and tracking), Smart parking system, Common card (payment and operations), Area based traffic control, Platform for citizen engagement and all citizen services; city dash board, Traffic mobile app, Smart metering (water), CCTV surveillance,

    1 For a complete list please see url http://smartcities.gov.in/writereaddata/Smart_Solutions_Components.pdf

    Emergency response, Public Information system, Public transit and traffic operations and management centre, Wi-Fi- IT connectivity, LED street lighting, Traffic analysis or roads and video surveillance inside bus using CCTV surveillance, Fleet management system, Automatic fare collection system (transport), Variable message sign boards, Optical fibre enabled communication, Pedestrian infra, Smart bulk metering at WTPs, 24×7 water supply, Smart Bus stops, Smart meters for electricity, e-challans for traffic violations and many more have been chosen by States towards contributing to Smart Solutions.

    Smart solutions are those that make use of systems that contain computers and information processors that coupled with enabling technologies improve the conditions of people living in that city. Application of Smart Solutions will enable cities to use technology, information and data to improve infrastructure and services. Comprehensive development in this way will improve quality of life, create employment and enhance incomes for all, especially the poor and the disadvantaged, leading to inclusive Cities.

    The development of Smart Cities is expected to be a long- drawn affair running up to 30 to 40 years. We strongly feel that by encouraging youngsters to evince interest in Internet of Things (IoT) we would be better placed to maximize benefits from the concept of Smart Cities. Moreover the time required to develop the Smart Cities will come down drastically if the IoT is in place. Towards this end, we would like to put forth a proposal to the Govt. of India aimed at development of Human Resources necessary for the success of Smart Cities Project.

  2. INTERNET OF THINGS — INNOVATION AND GROWTH

    According to Wikipedia, the IoT is the network of physical objectsdevices, vehicles, buildings and other items embedded with electronics, software, sensors, and network connectivity that enables these objects to collect and exchange data. The IoT allows objects to be sensed and controlled remotely across existing network infrastructure, creating opportunities for more direct integration of the physical world into computer-based systems, and resulting in improved efficiency, accuracy and economic benefit.

    The IoT is likely to grow exponentially in the coming years. For IoT to be successful, key issues such as identification, privacy and security and semantic interoperability

    have to be addressed. Another layer seeming to have serious impact over IoT is Cloud technologies, Future internet, Robotics and Semantic technologies. Moreover, there is a great need for

    vast increase in number of people with significant competence or exposure to work with smart devises and networked applications. To meet this specific requirement, we would like to propose the Raspberry Pi, which is a low-cost device suitable to be promoted in a country like ours.

  3. THE RASPBERRY PI

    In this Section we would like to introduce the Raspberry Pi and the various ways in which you could use it. Emphasis is placed on hands-on experience of the first author with the Raspberry Pi so readers will get first hand information of the same.

    The Raspberry Pi is a credit card sized computer (Fig. 1) designed to teach children the fundamentals of computer hardware [1]. It has computing power and RAM roughly equivalent to a PC of the 1990's or 2000's. Being equipped with 2 or more USB ports, depending on the model, an ethernet port, again depending on the model, an HDMI output, a stereo audio output and a composite video output, the Raspberry Pi is suitable for a variety of projects which can benefit from a credit card sized computer. An internet search for projects created using the Raspberry Pi turns up lots of results [2], including links with titles something along the lines of "10 projects to accomplish with the Raspberry Pi" etc [3], [4]. People have used the Raspberry Pi to build their own digital picture frames with the help of an LCD monitor [5][7], often by

    cannibalizing an outdated laptop. Others have created networked music players [8], [9], a security camera system [10][12] and a system to monitor the various parameters of plants, including soil moisture content and ambient sunlight, which automatically waters the plants when needed and logs all data and sends messages to the owner of the plants [13], [14].

    We implemented something much simpler by following a recipe on one of the above mentioned websites turned up by an internet search, as mentioned above [15]. What we have implemented is a media centre, where we can play our music and video files, either stored locally or on other devices at home. This media centre is simultaneously a client, a server and a media player. So we can play media stored locally, media stored on our phone/tablet/laptop, and also use these devices to play media stored on the Raspberry Pi. We have also attached what might be called a smart UPS, i.e. one which has a CPU and is capable of communicating its status,

    i.e. whether it is running on mains or battery, and while running on battery what percetage of charge is left [16]. Using certain software designed to interface with and control the UPS [17], we can check whether the Raspberry Pi is running on mains or battery, and if and when the battery runs below a certain level the Raspberry Pi can shut down cleanly, and then start up again when the power returns.

    This was done because the power supply in our apartment is erratic, with random power cuts, voltage fluctuations and sometimes one phase of the power in the apartment going off, while others remain. In this situation it wasn't possible to leave the Raspberry Pi on all the time, for fear that the power had

    Fig. 1. Raspberry Pi enclosed in a clear plastic case with the SD card on the left.

    gone and come back while we were away from the apartment. This might not be a problem in one sense, since if the power went off the Raspberry Pi would turn off and not turn on again when the power returned. But it did mean that anytime one saw the Raspberry Pi was off, one would have to detach the SD card and pen drive from the Raspberry Pi, run a file system check on them on one's laptop/PC, then reattach them and manually start up the Raspberry Pi. With the smart UPS now attached and software to interact and control the UPS installed on the Raspberry Pi, these problems are solved. The software to control the UPS automatically logs various events, such as the transition from mains to battery power and vice-versa, and the shutdown and startup of the Raspberry Pi on account of battery power falling below a certain threshold and mains power returning, respectively.

    There is a software module which provides additional functionality, using these logs to build graphs [18], [19]. We have not enabled this module, but have the capability, if we choose, to use the Raspberry Pi to monitor how often and for how long power cuts take place in our apartment and study the long-term trends of power availability, i.e. what time of the day it tends to happen more often, for how long on an average a power cut lasts and what if any seasonal variability there is in these power cuts [20].

    If we were to connect a second Raspberry Pi to a plug point which is connected to a different phase in our apartment, we would be able to tell when power has gone as a whole versus when only a phase has lost power. This assumes of course that the second Raspberry Pi is also connected to a smart UPS and running software to control the UPS. We could also set up the Raspberry Pi to send email or some other form of message whenever the power goes out. Somebody has already implemented such a system whereby they receive notification whenever a power cut occurs, because they wish to be able to take action as soon as possible, e.g., for fear that a freezer box they own containing choice cuts of meat bought on sale will cease functioning and cause their food to spoil [21].

    Our media system is not perfect. The Raspberry Pi is connected to a USB Wi-Fi dongle via a powered USB hub. Through this it is connected to the Wi-Fi network inside our apartment. The laptop, smartphone and tablet are also connected to this network, and usually they can all interact with each other just fine. We can SSH [22] into the Raspberry Pi from the laptop or tablet and administer it remotely. By this method we can upgrade or install new software on the Raspberry Pi, upload any media files we wish to store on the Raspberry Pi, start or restart or shutdown the media centre software called Kodi [23], or reboot or shutdown the Raspberry Pi, if necessary.

    However, there are times when it is not possible to connect over Wi-Fi to the Raspberry Pi. Pinging it is unsuccessful, even though our other devices show on their user interface that they are connected to the network, and the status light on the Raspberry Pi Wi-Fi dongle also shows that it is connected to the network. For this reason we keep a keyboard and mouse connected to the Raspberry Pi. This allows us to navigate Kodi and check what it shows about network connectivity of the Raspberry Pi. If it remains impossible to connect to the

    Raspberry Pi over the network, we use the keyboard and mouse to manually shut down Kodi, restart the network connection using the Raspberry Pi console, and restart Kodi. After that we can resume connecting remotely to the Raspberry Pi.

    We have not figured out yet why this happens. We suspect it has something to do with the DHCP service running on our Modem/Router, and the expiry and renewal of leases for IP addresses handed out to various devices. Perhaps it is a bug in the implementation of the DHCP server on the Modem/Router, because this connectivity problem arises when our phone or tablet have been in sleep mode for a long time. When we start them up again, they reconnect to the Wi-Fi network, and can ping each other but not the Raspberry Pi. If the laptop was running all through the time these other devices were asleep, often it can continue to ping the Raspberry Pi, but not these devices. So perhaps if a device falls asleep and effectively leases an IP address anew, it cannot ping a device with an older lease.

    In cases where we cannot ping the Raspberry Pi from other devices but can from the laptop, we remotely restart the Wi-Fi connection of the Raspberry Pi, and then pinging works. As mentioned above, for those cases where that is not possible, we use the keyboard and mouse connected to the Raspberry Pi.

    To save the time and effort needed in such cases we have written a script to restart the Wi-Fi connection, and tweaked some configuration files used by Kodi such that a combination of keystrokes causes that script to be run. Technically, it is a Bash script, called in turn by a Python script, which is invoked by pressing the combination Ctrl+Alt+W. As an alternative, we have installed a module for Kodi, which brings up a menu, from which we can invoke the Python script just mentioned.

    However, there are times when the keyboard does not work. Sometimes unplugging and replugging the keyboard is enough, but there are other times when that doesn't help. We have not been able to figure out why that is the case. In those instances, when we cannot connect to the Raspberry Pi over Wi-Fi, cannot restart the network connection on the Raspberry Pi with the keyboard, and unplugging and replugging the keyboard does not work, we have no choice but to power the Raspberry Pi off by shutting down the UPS using it's power button, and powering it on again. Once the Raspberry Pi is up again, we login remotely, shut it down cleanly, disconnect the SD card and pen drive, do a file system check by connecting them to the laptop, and then reconnect these peripherals (Fig. 2) to the Raspberry Pi and start it once again.

    Fortunately, this is a worst case scenario and happens rarely enough that it doesn't cause too much inconvenience. Between the smart UPS, the script to reconnect the network and the keystroke combination bound to that script, our media centre works well enough most of the time. If we cared enough, we would dig into why those networking problems arise, and what can be done to ensure they never happen.

    Since the time we bought the Raspberry Pi, a version 2

    [24] and version 3 [25] have been released, each time with considerable upgrades in the CPU and RAM. We have been thinking of purchasing one of them, and using that as a media centre, and repurposing the current one. We could use that to

    Fig. 2. Picture showing Raspberry Pi attached to smart UPS, and via a USB hub to a pen drive, Wi-Fi dongle, keyboard, mouse and TV (TV not shown).

    teach ourselves low level programming, connecting circuits with bulbs, resistors etc. to the GPIO pins, making lights flash on and off in response to whatever our program does. There are examples of such exercises given on the official website of the Raspberry Pi [26]. Learning how to program the GPIO pins would also be a good exercise in learning how to interface with sensors.

    We have been thinking of trying to implement the plant monitoring project mentioned above. Another idea we have recently had is to see if we can connect the Raspberry Pi with air quality sensors the term is Particulate Matter sensors

    to measure the air quality in and around our apartment. Some of these ideas are easier to carry out compared to others. We imagine connecting circuits to the GPIO pins is the easiest to start with, and probably a prerequisite for the other ideas just listed. Connecting to air quality sensors is probably next, and the plant monitoring system is next, because in the latter one is not only monitoring sensors, but operating pumps and other machinery in response.

    The most ambitious idea that has occurred to us is finding a way to control lights and fans with the Raspberry Pi, using

    some hardware to interface with them which has been developed by CSIR [27]. Doing so would require opening up the various electrical panels inside our apartment with the help of an electrician and risk disrupting an already working setup. So this will only be done, if ever, if and when a complete overhaul of the electrical system is done for some other purpose, like the wiring reaching the end of its life.

    The first author has often been asked why he bought the Raspberry Pi and done the things with it that he has done, and why he has the ideas about what to do with it next. We suppose it is because it pleases him to do so. As a child one plays with Lego [28][30] and Meccano [31], [32] like sets, building things with Lego bricks and using a plastic spanner to turn plastic nuts and bolts to hold together plastic beams to build models of buildings, assembling rudimentary circuits and switches with which one can turn connected light bulbs on and off. A child probably learns more from doing these things than from learning the theories about them in school, or at the very least they help them understand things better than merely reading about them in a book and answering questions in an exam.

    With the Raspberry Pi one can do those things mentioned above, and combine it with our knowledge of computers and programming to make new things which are not only a pleasure to build and tinker with, but are also useful. The fact that these new things are useful is also in itself a source of pleasure. If by writing about our experience we can convince others to tinker with the Raspberry Pi and try building things, so that they can experience the same pleasure we feel, then this article is not in vain.

  4. CONCLUSION

The low cost of the Raspberry Pi and the plethora of projects possible with it makes it an ideal choice for School/College going students/others wanting to learn about computers, how they work and ways and means to control external entities using them. The site

<https://www.raspberrypi.org/> is where one can get all the help free of cost. Raspberry Pi is just the idea to bring a revolution in IoT in India. This will be of much help in

  1. Available: http://www.instructables.com/id/Raspberry-Pi-as-Hi-Fi- player-with-RuneAudio/?ALLSTEPS

  2. Available: https://pimylifeup.com/raspberry-pi-music-player/

  3. Available: https://pimylifeup.com/raspberry-pi-security-camera/

  4. Available: https://www.raspberrypi.org/blog/turn-your-pi-into-a- low-cost-hd-surveillance-cam/

  5. Available: http://www.instructables.com/id/Raspberry-Pi-as-low- cost-HD-surveillance-camera/?ALLSTEPS

  6. Available: https://www.raspberrypi.org/blog/piplanter-a-plant- growth-monitor/

  7. Available: http://www.esologic.com/?p=665

  8. Available: http://lifehacker.com/5929913/build-a-xbmc-media- center-with-a-35-raspberry-pi

  9. Available: http://www.apc.com/shop/in/en/products/APC-Power-

    Saving-Back-UPS-Pro-1000-with-LCD-230V-India/P-BR1000G-IN

  10. Available: http://www.apcupsd.org/wordpress/about/

  11. Available: http://www.apcupsd.org/manual/manual.html#apcupsd- network-monitoring-cgi-programs

  12. Available: http://gapcmon.sourceforge.net/

  13. Available: https://www.linux.com/news/power-monitoring-and- logging-apcupsd-and-cacti

  14. Available: http://www.anites.com/2013/09/monitoring-ups.html

  15. Available: https://en.wikipedia.org/wiki/Secure_Shell

  16. Available: https://kodi.tv/about/

  17. Available: https://www.raspberrypi.org/products/raspberry-pi-2-

    successfully implementing the concept of Smart Cities, Smart Home and assisted living, etc as they are all the direct

  18. model-b/

    Available: https://www.raspberrypi.org/products/raspberry-pi-3- model-b/

    offshoot of IoT.

    REFERENCES

  19. Available: https://www.raspberrypi.org/documentation/usage/gpio- plus-and-raspi2/README.md

  20. Available: http://www.csir.res.in/

  21. Available: https://en.wikipedia.org/wiki/The_Lego_Group

    1. Available: https://www.raspberrypi.org/help/what-is-a-raspberry-pi/

    2. Available:

      https://www.google.co.in/search?q=raspberry+pi+projects

    3. Available: http://www.digitaltrends.com/computing/raspberry-pi- projects/

    4. Available: http://www.pcworld.com/article/2895874/10-insanely- innovative-incredibly-cool-raspberry-pi-projects.html

    5. Available: http://www.instructables.com/id/How-to-Make-a-

      Raspberry-Pi-Media-Panel-fka-Digita/?ALLSTEPS

    6. Available: https://pimylifeup.com/raspberry-pi-photo-frame/

    7. Available: http://hackaday.com/2014/12/11/raspberry-pi-powered- super-digital-photo-frame/

  1. Available: https://en.wikipedia.org/wiki/Lego

  2. Available: http://www.lego.com/en-us/

  3. Available: https://en.wikipedia.org/wiki/Meccano

  4. Available: http://www.meccano.com/

Leave a Reply