Real Time Environment Simulation Through Virtual Reality

The primary objective of the work is to develop a simulation which changes its environment based on the outside environment. This is done by getting the input from the sensors and sending it to the cloud platform and then getting the sensor data into the simulation and changing the environment of it. The aim of the work is to design an embedded device which could collect sensor values of environment defining variables like pressure, temperature, altitude and amount of light and use it accordingly to change the environment of the simulation. This was achieved by constructing embedded device which relies on sensors to transmit the reading of environment defining factors to a cloud services provided by Thinkspeak platform. These reading are archived and can be accessed by the android application to change its environment.


Introduction
The aim of this research is to take the Immersive Experience of Virtual Reality to the next level by offering Real Time simulated events. The research aims to extend the effect of real world elements such as lighting and weather into the virtual world, thereby giving a more real world immersive experience. The information and datasets required to make these changes will be interfaced through various web based IoT API's. These API's allow the Virtual Reality Application to access the sensory data of lighting sensors that can be setup through an Arduino system along with weather systems. The application can use this data to adjust the ambience of the Virtual World accordingly. A simple example would include making the game world dark when the user enters a dark area or changing the world weather to reflect a weather in a certain area. The desired objectives for the research are summarized below: 1. To design and develop a portable device which can receive inputs from the environment. 2. To interface this device with the user's mobile device which runs the simulation. 3. To use the sensor inputs to change the environment of the simulation study.

Background
IoT and Virtual Reality are two tending concepts which have revolutionized the world. Combining them is what we wanted to achieve which gives users a unique experience. Virtual reality is going places from schools to the military training academies. Their application is very vast. One thing which Virtual Reality provides is entertainment, without a doubt.
The virtual reality is the next big thing. Virtual Reality videos and games are trending. The people out there look for entertainment and virtual reality provides them what they need. Now, the other concept, IoT also has a plethora of applications. From house monitoring systems to baby monitoring systems, it is without a doubt one of the best platform for innovation. Now combining them to provide an enriching user experience was our goal. To simulate a particular place in virtual reality is a delight to the user who experiences the virtual reality but that particular place also has its own environment which changes periodically. Now, to provide an enriching experience to the user we can simulate the environment as is. The use of sensors can be brought into play to get to know how the environment has changed. A much more personalized feel is gained by the user when both virtual reality and iot are combined to get the best of both. The entertainment industry has gained a great momentum after the introduction of virtual reality but going the extra mile to give the user an everlasting experience impresses the users. Giving attention to details and making the user feel the awe is the success strategy of many applications and we intend to provide the same.

Design
There are mainly three components in this research, those are, hardware, thingspeak and the application. These three entities constitute the design. The thingspeak acts as the middle management for the hardware and the application part.

A. Hardware Design
The sensor modules incorporated in the embedded device yields analogue value which can be interpreted by calibrating the sensors. These readings are transmitted to the thingspeak channels which are can be used by both smartphone and analytics module. Unity 3D was used to design the software aspect of this research. This involved designing a level where in the player can experience changes in the environment that mirror their physical location. These environment changes include changes in Lighting, Wind, Sun rays and weather effects like Rainy, Hazy and Cloudy weather.
These effects are controlled and activated based upon the readings received from the hardware sensors and online API's. The API's provide the readings in a JSON format which is then parsed using Unity's JSON object and used to manipulate various Game Objects in the world that simulate the various effects listed above.This Simulation is currently deployed as a standalone application in both Windows and Android Platforms. Both offer the similar experience of simulating real-time effects as mentioned in the previous section. The Android Application includes support for Google VR which allows the player to experience the entire simulation in Immersive Mobile VR which showcases the true potential of this research and the possibilities of achieving realistic simulations.

1) Realistic Constraints
• Live Streaming: Live Streaming changes to game environment may not be possible. As the values may continually change to a negotiable extent, changing the environment every time is not fruitful. Every time a value changes, reflecting it may not cause a big difference if the change is negotiable.
• Hardware Requirements: The hardware requirements for a great quality is very costly. The graphics support costs money if we are using high quality simulation. The mobile device needs VR Support and high quality graphics card 2) Design Constraints • The sensors may not give accurate values as there is a cost factor attached. Hence the reliability factor increases with the quality of the material which is costly.
• Connection: Connection to the internet may cause a problem because sometimes the internet connection might be slow and hence the transmission of data is interrupted.
• Hardware: By the use of better VR headsets, the quality of the experience is enhanced. Using Oculus Rift may give high quality results but the cost factor will increase exponentially. Since the research needs to connect to the internet to transmit the sensor values, the cheap and the best option available in the market is Arduino enc28j60 Ethernet Shield. Hence this is the perfect match.

3) Tradeoff
• Hardware Requirements of Full-fledged PC VR headsets: As we do not possess computers powerful enough to run dedicated PC VR headsets like Oculus Rift and HTC Vive effectively, the research is built as a Mobile VR application to mitigate the heavy requirements.
• Mobile VR Optimization/Quality Loss: Various performance improvements have been made to optimize the simulation to run on GoogleVR for Android without dropping too many frames per second. • Textures are compressed and rendered at half the original resolution to improve performance for MobileVR. • Hard Shadows are used for all Objects in the simulation to improve performance. • Foliage Draw Distance has been reduced greatly, meaning the simulation will only render foliage in the immediate vicinity of the player and any foliage outside of the draw distance is not rendered thereby increasing performance. • Foliage density is reduced to a factor of 0.75 to improve performance while still maintaining an acceptable lush look in the simulation environment. • The player model present in the Non-VR simulation is removed from the VR version to reduce the polygon count during rendering to improve performance. Control however is shifted to the camera which is setup with Gaze input to provide an equally immersive feel.
• Unsupported Sunray Effect in VR: As Mobile VR does not support certain image effects like Sun Shafts, they are not present in the VR version of the simulation.
However, this effect can be seen in the non VR-version of the game.

A. Hardware Device
The hardware device comprises of the pressure, altitude and temperature sensor, ldr, Arduino Uno, enc28j60 Arduino Ethernet Shield. The Ethernet shield is primarily responsible for connecting Arduino to the internet. The laptop/pc is connected to the internet via lan or WiFi.

1) Thingspeak Outcome
The Fig 1 graph represents the pressure value got from the sensor. All the graphs on the thingspeak channel are dynamic graphs that are updated in real time after receiving the values from the respective sensor. Fig 2 graph shows the altitude values we have got from the sensor. These values are sent from the Arduino the thingspeak platform which are then accessed by the application. You can see the temperature variations from the graph the amount of light to modulate the light of the game environment is got from the ldr, which then gets stored in the thingspeak platform.

Application
Now, the application has a simulation which can be seen through a Virtual Reality Headset. The environment of the game changes according to the environment outside. The ultimate aim of the research is to change the environment of the simulation accordingly with the changes in the outside environment. This happens by the values of the sensors we get.
After wearing a VR headset the environment comes live before our eyes through Virtual Reality. The image in Fig 10below is a representation of how the game looks in the VR mode.

Conclusion and Future Scope
The aim of the research was to design an embedded device which could collect sensor values of environment defining variables like pressure, temperature, altitude and amount of light and use it accordingly to change the environment of the simulation. This was achieved by constructing embedded device which relies on sensors to transmit the reading of environment defining factors to a cloud services provided by Thinkspeak platform. These reading are archived and can be accessed by the android application to change its environment. This can be extended to military applications where one can simulate the environment by getting real time values from the places( for example. Siachin) , with this application the military personnel can know how to handle different situations.This requires a great amount of hardware and extra components for simulation like Oculus Rift. But when all this is put together and the same research is extended and did at a higher level we can simulate any place. Even this idea can be applied to simulate sightseeing places and how the place looks during sunset, sunrise, rainfall, snowfall, etc and that too we can experience the place according to real time variables.to a fixed-time simulation, allowing us to conduct a comparative study. This application is a total package which can be utilized by any sector who wish to enhance user experience by the combination of Virtual Reality and Internet Of Things. From the Realtime experience of TajMahal when it's rainig, snowing, sunset, sunrise to the real time experience of climbing the Mt.Everest can be experienced by combining Virtual Reality and the Internet of things as explained in the above research