The innovation of an Automatic Headlight Switch (AHS) System is deemed as an endeavour towards increasing the comfort and safety of two wheeler and four wheeler drivers especially while driving as well as while the vehicle is being parked. Often drivers forget to switch off the lights when the vehicle is parked or the ignition is turned off which leads to the unnecessary energy drainage. This continuous drainage might lead to complete shutdown and since majority of today's vehicle have been shifted to electronic circuitry requiring a continuous energy supply, it may barge off the owner to start it. Where as there is the major requirement of power management in the electric vehicles as well, since they completely run on lithium ion batteries, hence any sort of useless energy drain is inacceptable. The AHS system is proposed to overcome these situation, and holds potential for being the next level in smart headlight and vehicle power management technology. It is thus a major leap from the present technology. The sensing and response engine is designed and programmed in a way that the issue of manual switching off the headlights, was smartly tackled by pre-programmed involuntary light shifts.
An Automatic Headlight Switching System can prove to be an asset while driving. While the conventional headlight system enables visibility even in pitch dark conditions but is also a great point of energy consumption in vehicles. Driving a vehicle on road is a job of great responsibilities; the driver has to maintain the consistency of complete alertness as well as have to take care of numerous factors; such as traffic lights, other vehicles on the road, human being, etc. Running through all these road guidelines and keeping track of each and every rule simultaneously is itself a very tough job. Whereas with all these responsibilities the driver also has to take care of numerous other things such as the switching of headlight, indicators while turning, ditches on the way, balance (if riding a two wheeler), sign boards, etc. and the list goes on and on. But with this, several points of distraction also get included when someone is driving a four wheeler such as temperature inside, other passengers, stereo, etc. which make the task of driver even more difficult.
Due to all these indulgence forgetting headlight in switched on mode while the car is being parked is not a huge mistake; rather it is very common to encounter such issues in day today life. But this silly mistake quite often leads to a situation of very huge paybacks. Since the headlight consumes the energy in large amount (considering old model of cars) which leads to the drain out of the battery, after this drain out the battery becomes so much weak that it couldn't even ignite the engine for once. Ergo the passenger or the driver of the vehicle gets stuck at the location.
This problem doesn't seem to be such a big issue considering the development of new less power consuming headlights but for the old models there isn't any solution yet. Where as dwelling with this issue another serious problem of power management in a vehicle arises. Which isn't that big of a challenge in the stereotype fuel dependent vehicles, but it is the matter of great concern for its electric counterpart. As the power source in the electric vehicle is very limited so far and it need to compete with its fuel counter part in all aspects, therefore using it wisely is very important to increase over all efficiency. Ergo to achieve this notion there are three stones that need to be turned. Primarily, track of amount of unnecessary energy consumption, secondly related study of energy consumption with respect to the part of the day and complete track of light switch encountered in a day.
However, the proposed system suffices the gap between the energy consumption and the headlight switching. The AHS is the combined outcome of three very different platforms the arduino uno board to work as a stimuli and response module where as keeping a strong backbone of cloud (which is the second platform) to support and process the data generated by it in more intuitive way. And the third platform is Python which is use to create a seamless connection between the two.
The AHS uses the light sensor to sense the light in the surrounding and when the intensity of light reaches the particular intensity of decreases below the particular level it performs the particular operations automatically. We therefore tried to improvise upon the existing manually operated headlight system to an upgraded automatic version which is software driven and expected to be more fool proof and devoid of the lacunae inherent to the manual system.
1. Problem Formulation
To solve any problem, the first and foremost step is to recognize there is one. Ergo problem formulation is one of the key aspects to before developing any software or hardware system. Hence, in order to develop the system, prerequisite is to study all the existing system, that provides solution for the issues. It is done to obtain a clear understanding of the needs of users, and what is exactly desired from the final product's perspective. For example, in windows there is a utility named as “task manager” which can analyse the different system resources. And this made us to think that we should build software through which we can also analyse the energy consumptions of vehicles.
Also due to rising requirement of acquiring eco-friendlier way of transportation and also to refrains drivers from keeping the track of hectic headlamp switch, there is shift in designing locomotives as well as design of the headlights. To overcome the first issue, the companies have evolved electric vehicles out of their endeavours where as the latter has been tackled by redesigning the headlights, but the bridge between the two is not quite proper as the all new headlight switches don't keep track of the energy consumption and the upgrade can not be implemented in the old vehicles which are in abundance on roads.
2. Hypothesis Formulation
By going through all the fore discussed aspects following points have been concluded:
a. There is no such system that can track energy consumption of the vehicle and keep track of its complete data.
b. The present systems work in the same manner but AHS will be more efficient as the complete calculation and storage is based on the backbone of cloud.
c. It will help to clear off the load from the vehicle driver so that he/she could better concentrate on the driving part only, which in turn definitely reduce the number of road accidents.
d. To automate the headlight switching process so that any carelessness doesn't result in battery drain-outs and create any sort of disruption in journey.
e. To increase the efficiency of the electric vehicles as the resultant of reduction of energy consumption.
f. To utilize the power of cloud computing and giving access to the user any time anywhere.
g. To provide the producers the better look on to the consumption of the user so that better products could be created.
Since we have complete track of energy consumed and can also acquire great data chunks in cloud regarding light switching, we can study and take appropriate steps in each and every perspective ranging from manufacturing, configuring or even in efficient functioning.
The Automatic Headlight Switch (AHS) must take the input from the illumination present in the surrounding. There must be a threshold limits which encompasses the range of operational module of the system. The AHS must be functioning in the two threshold points named as the Lower Threshold and the Upper Threshold. The Lower Threshold is the point when the intensity of light present in the surrounding is less than a pre defined value of 3 lux, where as the Upper Threshold is the point when the intensity of light present in the surrounding is more than a defined value which is 3 lux.
3. Research Design
The AHS will be developed in three very separate modules. The Primary module of the system will be the sensor and response engine, second will be the cloud backbone and third with be the the bridge between the two.
a. Sensor and Response Engine:
The sensor and response engine will perform the sensor and response cycle in the system. It will take the input from the stimuli, i.e. the intensity of light in our case. It uses a photoelectric cell to capture the intensity of light present and supplies its value to the microcontroller. The microcontroller in turn runs the schedule to create the most appropriate response and accordingly operates the response engine.
b. Cloud Backbone:
The backend of AHS relies on one of the most upcoming platform, known as “Salesforce”. It stores the complete data in the form of an objects and perform the required computations over it.
c. Python Bridge:
The data capturing module of an AHS is achieved through an intermediate programming language (python). I have called it intermediate because it's just being used to bring the two very different systems under one roof and operate in symbiotic kind of association. The circuit board passes the data to the python script which in turns triggers the system to launch an HTTP request to the cloud server (i.e. in my case Salesforce Server) which saves the record in a database where several other operations are performed.
Headlight system has always been very innovative and interesting field. The automatic headlamps eliminate the requirement to manually switch on or switch off the lights in most of the situations. The automatic headlight system is very synonymous to human eye towards the outside light levels. Such a system offers both safety and convenience.
The system can be very helpful while driving on roads with many tunnels, at twilight or sunset, and even in foggy, icy, stormy and rainy conditions. For example, when the car enters a dark tunnel, the driver will not have to fumble for the headlight's switch. The car's headlights automatically switch on after sensing the low light in tunnel and when the car comes out of the tunnel, the headlights will switch off. The automatic headlamps are activated through a photoelectric sensor which is embedded into the instrument panel. The sensor is located at the base of the windshield under the defogger grill. The sensitivity of the sensor is either set by the auto manufacturer or the driver. The sensor is activated by the lighting conditions at dawn or dusk. The lights may switch off after few minutes when the engine has been turned off.
However, there are 3 types/ designs developed by Ford, General Motors and Chrysler which fall under the same principle. 
Automatic Light Control developed by General Motors'
• Oldsmobile vehicles had a standard feature of ACL (Automatic Light Control System) from 1999 - 2004 and it was given out as an option to some Pontiac models. In the development of ACL system, the sensitivity of the sensor where configured at the production house itself with the delay of headlamps and where non adjustable. The system used to activate the headlights when the car was driven into an enclosure, such as a parking garage or it could be turned on and off automatically in foggy or hazy weather conditions. In this, headlamp turning off delay was set to twenty seconds. But if the vehicle was equipped with fog lamps as well, they will switch off when the driver turns off the engine.
Ford's Auto Lamp System
• Lincoln-Mercury vehicles have used a system called "Auto-Lamp." A photocell is used to activate the automatic headlamps whenever the conditions warrant. Its two secondary features differentiate Auto-Lamp from General Motors' Automatic Light Control system. The automatic headlight system can be bypassed at the light switch. Secondly, Auto-Light has an exit delay feature, which keeps the interior and exterior lights illuminated so the path to the driver's dwelling can be illuminated. This was an optional feature (circa 1981 and 1982 model year) later made a standard on the Mercury Grand Marquis.
• Twilight Sentinel is one of the earliest forms of automatic headlamp features for General Motors (Cadillac and Buick) and Chrysler cars. It dates back to 1964. Twilight Sentinel uses an amplifier and a single photocell to gauge the light intensity before switching the lights on. The 1980 Buick Buyer Guide states the headlights will "stay on to light a path ahead of the car for three minutes," when the engine is turned off. The driver can set the time length for the headlamp delay. According to Imperial club, the Chrysler version of Twilight Sentinel will illuminate the reverse lamps along with the headlamps. According to Chip Lamb, one uses the turn signal to illuminate the corresponding side of the car, provided that the car is equipped with side cornering lamps (Cadillac, Buick Riviera and Electra and Chrysler Imperial feature). Cornering lamps are white lights on the leading portion of the front fender of some luxury cars.
The AHS system is developed in tree different modules as discussed above. These three different modules are from three completely different frameworks. The first is the Arduino which gave rise to the sensor and response engine on the system, the second is the cloud rear end which encompassed by the platform named as “force.com” of Salesforce and the third is the python that runs on its interpreter to perform the task. These frameworks are further discussed in details.
Arduino is an open-source framework of hardware and software. Arduino boards take inputs from light sensor, button, or even from Twitter- and turn it into a mechanical response such as switching a motor, turning on a LED or even publishing something online. We can instruct Arduino by sending a set of instructions to the Atmega chip installed on it. To do so we need to program our board in Arduino programming language (based on Wiring), with the help of Arduino Software (IDE interface showed in figure 1), based on Processing. 
Arduino has been the hardware backbone of thousands of amazing projects, from a tiny simple one to complex scientific one. It has a worldwide community of students, hobbyists, artists, programmers, and professionals, their contributions have added up to its incredible amount of accessible knowledge which is of great help to novices and millions of other users.
Arduino was developed at the Interaction Design Institute in Ivrea as a tool for fast prototyping their projects. It was aimed to help the students who don't have a background in electronics and programming. But as soon as it reached a wider community, the Arduino board started changing and adapted to new needs and challenges, differentiating its offer from simple 8-bit boards to amazing products in the section of IoT applications, wearable, 3D printing, and embedded environments. All Arduino boards are completely open-source, empowering users to build independently and eventually to stay in full compliance to their particular needs.
Due to its simple and easy to understand architecture, Arduino has been very scalable in wide range of projects and applications. The Arduino software is easily understandable yet flexible enough for advanced users. It runs will almost all know operating systems i.e. Mac, Windows, and Linux. Intriguing teachers and students use it to build low cost scientific instruments, to prove chemistry and physics principles, or to get started with a career in programming or robotics.
Several amazing interactive prototypes can be seen these days are built by designers and architects, where as musicians and artists use it for experimenting with new musical instruments. It is a concise tool to learn new things. Anyone can start scratching its surface by just following several sequential instructions, or sharing ideas online with other members of the community.
Salesforce began with the vision of reinventing Customer Relationship Management (CRM). Since then we've changed the way enterprise software is delivered and used, changing the industry forever. All Salesforce products run entirely in the cloud so there's no expensive setup costs, no maintenance and your employees can work from any device with an internet connection – smartphone, tablet or laptop.
We make CRM easy to use for small businesses and large scale enterprises. This approach has helped to make Sales Cloud the world's number 1 CRM system. But Salesforce doesn't start and end with CRM for Sales and Marketing. Our platform enables you to manage all interactions with your customers and prospects, so your organization can grow and succeed. That's why we call it the Customer Success Platform. 
Salesforce is a cloud computing company which offers a variety of services (SaaS) and products (PaaS). Salesforce started as Software as a Service (SAAS) CRM company. Salesforce now provides various software solutions and a platform for users and developers to develop and distribute custom software. Below is an image of the power of Salesforce in today's tech-savvy world.
Salesforce offers cloud services like Sales Cloud which can be used by your organization's Sales team, Marketing Cloud which can be used by your marketing team, chatter a social application which your organization can use to connect employees and various other services. Below is an image that shows the cloud services that are offered by Salesforce:
Python is an interpreter, object-oriented, high-level programming language with dynamic semantics. It has high-level built in data structures, combined with dynamic typing and dynamic binding; that make it very attractive for lightning fast Application Development, or as a scripting language or as a glue language to connect existing components together (which is out section of interest). Python is very simple, easy to learn and due to its syntactic simplifications the cost of program maintenance is decreased significantly. Python supports module & package architecture as well, which encourages program modularity and code reusability. The Python interpreter and its extensive standard library are available in source or binary form free of cost with a license of free distribution. 
Often, programmers fall in love with Python because of its increased productivity and since there is no compilation step, the edit-test-debug cycle is very fast. Debugging Python programs is easy: a bug or bad input will never cause a segmentation failure. Instead, when the interpreter finds some error, it raises an exception. When the running program doesn't catch the exception, the interpreter prints the trace of the error with the stack location. A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.
The implementation of AHS take place in a very specific way. Firstly, the Arduino Atmega chip is loaded with a program coded in Arduino programming language and complied by its compiler. The program designates three separate pins as input pins. Two of the pins will perform analog read cycle where is the third pin will be performing digital read cycle. The latter one will work as the switch which will shift the light from manual to automatic mode. So that if there comes a situation in which driver wants to take control in his/her own hands than they can easily shift to manual mode. Now the other two pins are connected to the light sensor to take inputs corresponding to the illumination as well as the intensity of light illuminating the surroundings.
Since this board consumes negligible amount of electric power; therefore, it can even run through already installed batteries in the vehicles. After installing the board on to the vehicle it need to be connected to the device that can take in the serial input signals. This can be any of the Raspberry pi board (This board is suggested as it runs python on it and we need python for connecting the cloud platform). From the work perspective and for testing perspective we have connected the serial out of the board to a computer system. The Computer system used just need to run python interpreter which receives the output of the Arduino as an input to the bridge. The python interpreter keeps on running a python script which combines the efficiency of several other python modules to achieve what it aims for. To fulfill the requirement, it needs serial library, datetime library, json library and a custom made library known as simple_salesforce. With this a successful http request is made to the cloud server which stores the data into the database and instantly generates the several reports based on the cumulative of all data present at the moment. The salesforce server
The functioning of the system starts from the circuit board which keeps sensing the input from the LDR; the value of LDR fluctuates between the defined range i.e. it shows zero when there is no light and 1024 when there is complete illumination. The intensity of light in the surrounding is to be calculated to achieve the required threshold point where the vision of human eye starts staggering.
Measuring Light Intensity using Light Dependent Resistor (LDR)
The resistance of the Light Dependent Resistor (LDR) varies according to the amount of light that falls on it. The relationship between the resistance RL and light intensity Lux for a typical LDR is
If the LDR connected to 5V through a 10K resistor, using the voltage divider rule, the output voltage of the LDR is
Substituting RL from equation 1 into equation 2, we obtain the light intensity
For a low cost LDR, at the same light intensity, the part to part variation in resistance can be as high as 50%. Therefore, such a low cost LDR is seldom used for measuring light intensity but more for light presence/absence detection.
RL Light Resistance
Table 1: Typical Low Cost LDR Specification
The arduino board in this system talks to the python interpreter to supply the resistance value though the serial port. The python interpreter keeps on listening to this serial port and accordingly calculates the intensity of light present in the surrounding. Since the threshold of the system is already set the arduino microcontroller is the incharge to switch the circuit through the relay connected to it its one of the pin which results in the switching on or off the headlight (in this case). The connection module is shown in figure 10.
Whereas the python interpreter, work in the direction to push the data acquired through the serial port into cloud.
After the data enters the cloud it is being operated upon producing the charts and keeping track for better understanding of the user.
The salesforce produces the reports for the consumptions of the energy from the data acquired by it from the python.
...(download the rest of the essay above)