Ed and Jack – Energy Efficient Lighting

Summary

To summarise our project, we have produced a light switch module that automatically controls the lighting within a room. The purpose is to not only prevent, but change the behaviour of those who leave the lights on before leaving a room. The context being that it is a common behavioural issue, especially in the UK, that people do not consider the environmental impacts that leaving appliances on has. Leaving lights in wastes a considerable amounts of energy, and can be easily avoided. This automated lighting system is controlled by using a person counter to identify whether people are in the room or not. This is done by using two IR Sensor Modules. When the person count is 0, the lights remain off, when it is 1 or above they turn on. This is when the three way toggle switch is on energy saving mode. When the on or off options have been selected, the light will act as a conventional light. This enables the users to keep the functionality of a standard light, keeping the products use flexible. The other key feature to this product is the gamification. The light switch module recognises if the last person leaving the room has turned the switch off themselves. If they have, they get a point. If the person leaves the room without switching the light off; as they should, the module will get a point. This score will show as an ongoing percentage on the LCD display that features on the front of the product. If the light switch gets a point, a responsive sound will be produced. This will keep as a reminder every time they forget to turn the light switch off. Eventfully, the combination of the gamification and competition along with the reminder will increase the number of times that they will remind to turn the light off before leaving the room. The product heavily relies on the competitive human nature.

 

Final Design

Our final design consists of a white housing that holds all the electrical components. The aesthetic has been taken from other light switches, as home integration is key in the success of this product. A shiny, metallic silver switch situates at the top left. It contrast clearly enough against the white to make usability as easy as possible. The LCD display keeps central, to be as easily seen as possible from all directions, and the IR Sensor Modules locate at the bottom corners. There must be a space in between these for the directional person count to work effectively. Due to the size of the display, the moving score bar had to be removed. Clarity is significant in achieving the behavioural change, and this feature cramped the display.

Final Prototype

 

Final Code

The loop function contains a switch case machine which is run off an if statement based on the toggle switch position. Each toggle switch position corresponds to an action, namely:

In the “ON” position, the light is forced on and the lcd.off() function is run. This turns off both the LCD back light and the LCD itself. The automation() code is still called as the personCount needs to be kept count at all times..

In the “AUTO” position, the lcd.on() – turns the LCD back light on, automation(),  lights(personCount) – which allows the lights to be influenced by the number of people in the room, score()  and screen(pPercentage, cpuPercentage). The latter two functions deal with calculating the score percentages and with printing the information on the LCD.

In the “OFF” position, the LCD is turned off, automation(), score() and screen() are all run so that it can accurately increase cpuScore even when the screen is off.

The automation function contains the code that allows personCount to either increase or decrease. This in turn alters boolean variables that trigger the score and subsequent screen functions.

The score function contains an if() statement that only runs when two conditions, isRoomEmpty = true and wasRoomEmpty = false have been met. These two conditions are set in the automation() function inside the if() statement that only runs when the sensors are triggered. This prevents the score() function from getting stuck in a loop once personCount hits zero. Based on the current position of the switch and the two booleans, it will either add a point to playerScore or to cpuScore.

Using these two variables, this function then uses a map() function to work out what percentage of the total times the player and the CPU have won.

The screen function then takes the pPercentage and cpuPercentage from the score() function and prints them in opposite corners of the display followed by a ‘%’ symbol.

https://create.arduino.cc/editor/JackGormley/f8bba017-3928-4212-a159-f3141c624d56/preview?embed

 

Final Circuit Diagram

Components:

Buzzer, IR Sensor Module (x2), LED, LCD, 3 Way Switch, Resistor (x2)

Final-ish_bb

 

Potential Developments

We started this project with lots of ideas regarding how to incorporate different features into the final product. Some of which, have been left as concept due to feasibility, cost and time. Despite this, we have still kept in mind a lot of potential development options, as we believe as an idea, we could take this further.

Player Connectivity

If the product were to be bought, internet connectivity would be a good way of improving the overall interactivity. Doing so, would have a higher chance of enhancing the behavioural change. The website for example could display an overall leader board that links up to different products in different households. Displaying scores between neighbours would be an effective way of increasing the competitive nature of the product. Furthermore, the competition could exaggerate the gamification of the product. Other features that could be added through the use of the internet, include notifications via an app. The occupants of the house would download an app onto their smartphones, which would link up to their performance regarding how many times they have successfully turned the lights off before leaving the room. The app could also implement intra house competition. For example, a light switch module could be installed into every bedroom. Each user would compete, and due to the close proximity, the desire to turn the light off and win would be great. A Wi-Fi shield could be implemented to achieve connectivity to the internet, which is easily incorporated with the Arduino Uno.

Brightness Dimming

Initially we had the aim to use an LDR or another ambient sensor to measure the natural brightness of the room. However, testing the LDR proved that the component is not accurate enough. There are also many light influences in any room. The IR Sensor Modules are very sensitive, and not that tolerable to flashing lights. Another sensor that achieves this function but with more accuracy would be desirable for the consumer product. Another way of achieving automatic dimming, would be to use a spreadsheet that list the times of sunset and sunrise for each day. The Arduino would read the times, and a correlated brightness would be represented through the light. To incorporate this feature into a consumer product, the LDR would need to be calibrated in the situated room. The user would place the sensor in a suitable place within the room, that receives an average natural light brightness. This would be read and stored. The Arduino would be programmed so that the brightness produced by the room lighting would match a luminosity, so the room would remain a constant brightness all the time. This is done by using a Triode AC Switch. This dimming feature would increase the amount of energy the module saves vastly, as our initial research has already stated, “modern dimmer switches cut the supply on and off rapidly at hundreds of times per second – something called a TRIAC switch. This reduces the amount of power reaching the bulb, reducing the brightness. This does reduce the overall amount of power being used and therefore you could call them more efficient.”.

Computer Interaction

If the LCD display is increased in size and resolution, it would give us more opportunities in terms of content and detail. The clarity would be improved, so text would be more legible from a distance. Scrolling messages could be a development to build on the interactivity and competitiveness between the player and CPU. Including playful but taunting messages across the screen would provoke the user in a positive way. Messages that would notify them if they are winning or losing would evoke an emotional response, and their behaviour change would be enhanced further. This can be done by using the scroll function already programmed onto the I2C chip on the LCD.

Self Sufficiency

Another variation that we had in mind at the beginning of the project was to use solar energy. If the light switch module does not use any power from the mains, then the energy efficiency would be increased even further. Self-sufficiency would be a great selling point for product. Moreover, one of the aims for this project is to reduce the consumption of an appliance. Solar energy would not reduce energy consumption, but would eradicate any non-renewably sourced energy, and also any cost to run it. Household lighting tends to be used more when the natural light is low. Therefore, the capacitor connected to the solar cells will be more than likely charged up during the day, when the natural light is at its highest. In theory, if the solar energy is enough to power the module for enough time, it could be self-sufficient. The module could always be connected to both the mains and the solar panels for maximum functionality. If the solar energy produced is not enough to last an evening, the power can be taken from the mains.

Conclusion

In order to prove that this prototype conserves energy, an experiment would need to be conducted over a period of time. Installing it into someones house and recording the information would be good way of doing this. The product is finished and ready to use, so the reliability is not an issue. From clear day to day observations, and reports already written on energy wastage (see blogs), we know that people leave the lights on when leaving a room. So the problem is evident. The fact that the light is automated will reduce the energy wasted by cutting the power to the light when no one is present. This can be proved with simple mathematics. The psychology around gamification has been highlighted. Playing on the users typically competitive nature will trigger some sort of behavioural change. Whether this be due to annoyance or self determination. We strongly believe that this product conserves wasted energy from leaving the lights on when leaving the room.

Blog 11 – Energy Efficient Lighting

Consumer Product

Our final prototype represents how the final product will function, and how it will be presented visually. However, there will need to be some slight alterations. In the home, the product will need to be integrated slightly differently compared to the exhibit.

Difference in Components

  • CFL lighting:

An LED strip with a USB connection has been used to replicate the home lighting. This is convenient, as the Arudino Uno has a 5v pin, and the voltage of the LEDs is 5V. Additionally, LED bulbs are not affected at all by being turned on and off. This characteristic makes LED bulbs a top energy savings lighting choice. They’re a great option, Energy.gov says, when used with sensors that rely on on-off operation. They also turn on at full brightness almost instantly. Additionally, compact fluorescent lamp (CFL) are frequently used by consumers wanting to save money on electricity and reduce their eco footprint. They are more commonly used in for home lighting, so consequently, these will be used for the consumer product.

 

 

  • Housing:

The prototype has a cut out section that displays the internal circuitry. This is to show how the Arduino and all the component work together. The consumer product would not feature this. It would sit in the wall like a typical light switch.

Prototype 2

 

  • Display:

The display we have used if fairly simple in terms of resolution and complexity of available characters. To clearly represent the score to the user, a more detailed bar scoring system would be ideal. Making the screen larger, but keeping the volt usage low would improve the clarity and therefore the overall functionality of the product.

 

  • Reset Button:

A reset button is commonly found on technological devices, especially on household products. This is due to some malfunctions being inevitable, and not always easily avoidable. Therefore, a reset button to clear all the code would be a good feature. This would reset the score and person count to prevent malfunctions from occurring.

 

  • Relay

Our home implementation would require the use of relays to control the current to household bulbs. Relays act as switches for mains voltages and are operated electromagnetically, while keeping the 5V control circuit separate from the mains power switch. This would allow us to interface our low power arduino circuit with AC mains voltage.

 

Difference in Code

  • 15 minute delay:

Since CFL lights are already very efficient, the cost effectiveness of turning them off to conserve energy is a bit more complicated. If we want to be energy efficient, stopping the light from turning off before 15 minutes will prevent the light from turning off and on when someone leaves the room briefly. In the long run, this will conserve more energy than without this feature. Our previous research supports this.

 

Proof of Concept

From our initial research, we identified the problems regarding the energy that is wasted as a result of leaving the lights on within the home. We need some additional information to support our claims, that a reminder will encouragement the users to switch the lights off when leaving the room, and in the long run, save energy.

https://www.clearlyenergy.com/blog/posts/how-much-are-your-bad-habits-costing-you

A incandescent bulb costs about 0.75cents per hour; and LEDs or CFLs cost only one-sixth of that, so leaving the lights on (either overnight or while you’re at work for the day, say both are about 8 hours) costs you roughly 6 cents for a normal light and a bit over 1 cent for modern bulbs.

 

Calculating Energy Savings

https://www.energy.gov/energysaver/when-turn-your-lights

To calculate the exact value of energy savings by turning a lightbulb off, you need to first determine how much energy the bulb consumes when on. Every bulb has a watt rating printed on it. For example, if the rating is 40 watts, and the bulb is on for one hour, it will consume 0.04 kWh, or if it is off for one hour, you will be saving 0.04 kWh. (Note that many fluorescent fixtures have two or more bulbs. Also, one switch may control an array. Add the savings for each fixture to determine the total energy savings.)

Then you need to find out what you are paying for electricity per kWh (in general and during peak periods). You will need to look over your electricity bills and see what the utility charges per kWh. Multiply the rate per kWh by the amount of electricity saved, and this will give you the value of the savings. Continuing with the example above, let us say that your electric rate is 10 cents per kWh. The value of the energy savings would then be 0.4 cents ($ 0.004). The value of the savings will increase the higher the watt rating of the bulb, the greater the number of bulbs controlled by a single switch, and the higher the rate per kWh.

The most cost-effective length of time that a light can be turned off before the value of the savings exceeds the cost of having to replace bulbs will depend on the type and model of bulb and ballast. The cost of replacing a bulb depends on the cost of the bulb and the cost of labour to do it.

In addition to turning off your lights manually, you may want to consider using sensors, timers, and other automatic lighting controls.

This information has been taken of Energy Gov, the U.S. Department of Energy’s consumer resource on saving energy and using renewable energy technologies at home. This information is very reliable, and supports our claims clearly.

Blog 9 – Energy Efficient Lighting

LCD

The LCD that we have, has an additional I2C chip that can control standard character LCDs using just 2 pins. This board has been developed with character LCDs in mind as a means to reduce the pin count required to drive them. This is ideal for our project, as the Arduino Uno has limited pin numbers, especially with the amount of components that we are incorporating.

I2C Scanner

Before we plugged the LCD into our Arduino, we checked the specification of the component. We found out that a reference number or code is required to be able to speak to the I2C chip. We had find the I2C by a scanning code. We found this online on an open source forum.

https://create.arduino.cc/editor/JackGormley/cd8524fd-8909-4bed-a7a0-88ec6f2ce68c/preview?embed

It identified 0x3f on the serial print. We then downloaded a library called <LiquidCrystal_I2C.h>.

I2C

Initial testing code

https://create.arduino.cc/editor/JackGormley/36a41e5f-a2c2-4cf3-a356-dd5f4f106a8e/preview?embed

We connected the LCD to the Arduino; like the following Fritzing diagram. As characters were already programmed onto the I2C, we could type freely into the code and it would display without any problems.

lcd.setCursor(7, 1);

  • This has used the function that directs the cursor of the display. Essentially, it allows us to put the characters where we want, within the 16 by 2 layout.

lcd.print(“Yiss”);

  • This has used the function that prints what we want (Yiss), at the set cursor position (7,1).

For our prototype we need a moving bar to display a score. This had not been pre-programmed. We needed another way around this. After researching into the subject, we found that writing the characters in binary would allow us to get around the already existing characters.

We achieved this by using ‘B’ at the beginning of the line of code to establish that the values inputted are binary. Each of the 32 blocks (16×2) that make up the screen is 5×8 pixels, therefore, a 5×8 pixel binary input is needed. 1s and 0s are used to differentiate between a pixel and a space.

byte chr1[8] = {
B10101,
B10101,
B10101,
B10101,
B10101,
B10101,
B10101,
B10101
};

References:

https://playground.arduino.cc/Main/I2cScanner

http://www.martyncurrey.com/arduino-with-hd44780-based-lcds/#customCharacter

After achieving reliable instructions to perform using the LCD, we incorporated out three way switch. For the final prototype, there are three different light settings; on, off or automatic. Automatic will be the energy saving, computer controlled lighting. For each of these options, a different display will be shown to let the user know which one they have selected.

  • On: ON
  • Off: Display off
  • Automatic: Score bar and percentage value.

For this to work, the screen needs to clear after a different switch has been selected, and show another character layout. Interrupts were the first thing that we could see working effectively, so that is what we tried.

Using Interrupts

https://create.arduino.cc/editor/JackGormley/d755265e-ec7b-4468-8121-ced2736d2402/preview?embed

This worked well, the text was not repeatedly clearing, and the change was quick and sharp. However, the Arduino Uno only has two interrupt pins, and these pins are needed for the IR sensors. The functionality of these components is heavily reliant on the interrupt function, due to the directional person count feature.

We needed another way of achieving three options on the display, without using interrupts.

Without Interrupts

https://create.arduino.cc/editor/JackGormley/d76ab490-9f5a-4007-a569-6c1d518f680e/preview?embed

Prototype Limitations

Due to the size and resolution of the LCD, we are limited to what we can show. The display content needs to be clear from a distance whilst simultaneously showing a score and player information. We concluded that the bar would take up the bottom blocks, of which will be filled and a space will be created to represent the difference of the two values. The percentage values will then be located at each top corner, on the first row of blocks.

Prototype 1

This photo is of our first 3D printed prototype.

prototype 1

  • We have accurately measured the dimensions of the components that need to be visible; both sets of IR sensors, the switch, and the screen, and extruded holes to the suitable sizes.
  • We had oversized the dimensions as we wanted to give the circuitry enough space so it would not be obstructed.
  • For a light switch, the housing a relatively bulky so this will be reduced. The player icons or titles need to be incorporated into the front.
  • The components had nothing to rest on or be supported by, so lips will need to be created for added security.
  • The enclosed housing does not show off the circuit and linked components. For the purpose of the exhibit, we will open this up so it can be easily seen.

CAD Improvements

Capture2Capture3Capture1

  • Clear circuitry for exhibit.
  • Lip
  • Screen support
  • Lettering

Blog 6 – Energy Efficient Lighting

Design Description

A modular light switch that fits into the wall. A set of IR sensors will keep a person count to determine whether the lights will be on or off. A 3 way switch is needed for an override on and off, to provide flexible use for the user. An LCD display will show a points system, that incorporates a competition with the computer or another user. The points system will be kept as an ongoing percentage, which avoids having the score to be reset. Consequently, the score will become increasingly more accurate. All components will face the front, towards the room. This allows for a thin product, and clear visibility. The module will also connect to the internet, which will provide data regarding the times of sun set and sun rise. This indicates how bright the room will need to be, acting as an automatic dimming feature.

Prototype Developments

As we mentioned before, the behaviour change is heavily influenced but the level of interaction between the light switch and the user. Now that we know that the gamification aspect will achieve this, we need to think of a way of how to incorporate it into a prototype.

Our initial concept was a simple display using an array of LED lights that represent a points system. This is clear, and can be seen from a distance away. We put together a circuit consisting of 6 LEDS and a shift register. The code assigns an LED to a different pin, allowing us to control when it turns on. Having two rows would work well for a points system, and could be displayed nicely on the outside of the prototype. We played around with different outputs and layouts, but soon realised that it is not engaging enough. We needed something more playful.

Display

A development for this would be an LCD display. This would allow us to program messages, and a moving graphic. The screen would be flush with the shell of the light switch, and would be in clear view.

 

Design Influences

We have come to a point that we know the structure and layout in mind for the working prototype. The product relies on many other things to enhance function and the behavioural influence it has on the user.

These are as follows;

  • The positioning of the IR sensors
  • The size of the LCD Display
  • The front graphics
  • The positioning of the light switch instalment
  • The number and size of switch(s)

 

Basic Prototype LayoutLayout

Screen Concept

Screen.jpg

Graphic Development

The housing could be etched onto, which could be the method of implicating the graphics onto the prototype. Two people pushing a bar towards each other could could be an effective way of representing the points system. The people could be engraved, and a coloured LED could highlight them. This sketch denotes this concept.

Sceen Concept.jpg

 

Layout Draft

 

Layout

Potential Situations

Description
Human Interaction
Arduino
Potential Problems
Single person walks into room.
Walk past sensor.
·         Increment personCount variable.
·         LDR detects ambient light.
·         If dark enough, turn on light.
·         The person could stop in between the two sensors.
·         Person turns back on themselves.
·         Person could enter room though another door.
·         Person could leave though another door.
·
Person stops walking in door way.
The person is going in between rooms, and stops. They could trigger an IR sensor, or turn a light on/off from outside the door.
·         The IR sensors could be triggered, but only one could be.
·         If the sensors are not reliant on each other, then the lights may turn on or off when the user does not need them to be.
Two people walk the  into room.
Single file, two people follow each other into the room. The IR sensors are triggered, and the light switch could be used.
·         The person count will be increased to two, and the light will be turned on according the setting and brightness.
·         The IR sensors will need to be reactive enough to detect two people close to each other.
One person walk in, and one person walks out.
The first person waits while the other walks through the door. They then walk through the doorway.
·         The person count will be increased by 1, and then decreased by 1.
·         The IR sensors will need to be reactive enough to detect two people crossing each other.
One person walks into room, and then through another door.
The person walks into the room, and straight through another. They do not use the light switch, but does trigger the IR sensors.
·         The person count will be increased, and left at that value.
·         If no one else is in the room, the lights will be turned and left on without them needing to be. Another set of IR sensors could solve this.
A child walks into the room.
The IR sensors are triggered.
·         If tall enough, the person count will be increased.
·         The child may not trigger the sensors, due to the height of the light switch. The child may harm themselves in the dark.
A dog walks into the room.
The IR sensors are triggered.
·         If tall enough, the person count will be increased.
·         The dog does not need the light to be on, but if they trigger the sensors, they will turn on automatically. Energy could be lost.
The door is opened and left obstructing the light switch.
The person opens and leaves the door open. They will need to move the door to use the switch.
·         The person count will be increased, but will not be able to change until the obstruction is removed.
·         The lights may not change due to the obstruction.
People are already in the room, and want to watch tv. It’s the evening.
They will want the lights off or dimmed, so an override switch will be needed.
·         The off switch will be triggered, which will stop the code from controlling the light intensity. The person count will remain to count.
·         The people may only want the light to be dimmed, there is not dimming override.
Someone loses something under the sofa, and needs the light bright. It’s in the afternoon.
The override switch will be needed to turn the brightness up.
·         The on switch will be triggered, which will stop the code from controlling the light intensity. The person count will remain to count.
·         Turning on the override switch may cause the person count to go up if the IR sensors are obstructed by their hand.

 

Blog 4: Energy Efficient Lighting

Psychology surrounding Gamification

Our idea is to gamify saving energy, and turn off the lights in a room. Playing a computer, giving some sort of incentive by turning things into a game or competition will motivate the user to turn off the lights when leaving a room.

We have realised that on it’s own; automatically turning the lights off,  will not change the users’ behaviour. Therefore, we want to incorporate a level of human interaction.

There are several different ways of achieving this:

  • A points system, playing against the computer. Whenever someone leaves the room the automatic lights will trigger it to turn them off. If the user does not manually turn them off, the computer wins a point. If they turn the lights off themselves as leaving the room, they will gain a point. Different levels and challenges could be introduced to increase the level of entertainment.
  • A trigger; such as a sound of visual stimulant could activate when the user leaves the room. If they do not turn the lights off, they will be reminded by this trigger. Incentives could be incorporated to make this more enjoyable.
  • LED displays could be used, to indicate how the user is doing. Saving energy could be represented in terms how many trees they have saved. On the other hand, at the end of the week, the user could be told how much of an effect they have had on the environment. A negative reminder instead of a positive.
  • Competition between different users in a different household could provide self motivation to beet another player. Social pressure is also a big part of this.

Gamification seems like a viable solution. Increasing interactivity could change the user’s behaviour in terms of turning lights off when leaving the room. However, we need proof before going ahead with this. Finding some in depth research and analysis will help with this.

https://kontra.agency/gamification-psychology/

“The main aim of gamification, i.e. the implementation of game design elements in real-world contexts for non-gaming purposes, is to foster human motivation and performance regarding a given activity. Previous research, although not entirely conclusive, generally supports the hypothesis underlying this aim. However, previous studies have often treated gamification as a generic construct, neglecting the fact that there are many different game design elements which can result in very diverse applications. Based on a self-determination theory framework, we present the results of a randomized controlled study that used an online simulation environment. We deliberately varied different configurations of game design elements, and analysed them regarding their effect on the fulfilment of basic psychological needs. Our results show that badges, leader boards, and performance graphs positively affect competence need satisfaction, as well as perceived task meaningfulness, while avatars, meaningful stories, and teammates affect experiences of social relatedness. Perceived decision freedom, however, could not be affected as intended. We interpret these findings as general support for our main hypothesis that gamification is not effective per se, but that specific game design elements have specific psychological effects. Consequences for further research, in particular the importance of treatment checks, are discussed.”

Blog 2 – Energy Efficient Lighting

Blog 2

The previous blog was a summary our initial ideation regarding the project. We highlighted some aspects that we were not certain on, and therefore needed researching into to determine if the concept would be worth pursuing.

 

Research Queries:

Does turning off a light bulb intermittently save more energy than leaving it on?

We looked at a range of different sources determine if turning the lights off at irregular times during the day would save energy. Whether light bulbs have a high start up energy impacts this.

https://www.energy.gov/energysaver/when-turn-your-lights

“The cost effectiveness of when to turn off lights depends on the type of lights and the price of electricity.”

Sustainable awareness has been an influential impact on how people live their lives, even if their behaviour changes are not that beneficial. Energy efficient lightbulbs, typically compact fluorescent lamp (CFL) are frequently used by consumers wanting to save money on electricity and reduce their eco footprint.

CFL Lighting

“Since they are already very efficient, the cost effectiveness of turning CFLs off to conserve energy is a bit more complicated. A general rule-of-thumb is this:

If you will be out of a room for 15 minutes or less, leave it on.

If you will be out of a room for more than 15 minutes, turn it off.

The operating life of CFLs is more affected by the number of times they are switched on and off. You can generally extend the life of a CFL bulb more by switching it on and off less frequently than if you simply use it less.”

 

What’s the relationship between brightness of a bulb and energy usage?

Having an automatic dimming function is a feature that we want to include in our product. But we are unsure if it would actually make home lighting more energy efficient. Again, we looked at several different sources, and felt that this website explained the information clearly.

https://www.thegreenage.co.uk/do-dimmer-switches-save-energy/

“modern dimmer switches cut the supply on and off rapidly at hundreds of times per second – something called a TRIAC switch. This reduces the amount of power reaching the bulb, reducing the brightness. This does reduce the overall amount of power being used and therefore you could call them more efficient.”

To summarise, there is a semiconductor device called a ‘Triode AC Switch’ (TRIAC), which is a member of the thyristor family. It can be used as a solid state power switching device but more importantly it is a ‘bidirectional’ device. In other words, a TRIAC can be triggered into conduction by both positive and negative. This makes it a switching gate controlled device.

“dimming incandescent is actually less efficient than using a lower wattage of bulb. For example, a 60W bulb dimmed to the brightness of a 40W bulb will use more energy than a 40W bulb on maximum. The light will also tend to be ‘warmer’ in colour.”

This piece of information gives us a clear indication that using incandescent bulbs will not be beneficial in terms of making lighting more sustainable, even if dimming was used. CFL bulbs are what we will use.

Not only will dimming conserve energy, but it also increases their life span. This consequently, will make this lighting system even more sustainable. It will reduce the number of bulbs required within a house, over a long period of time.

“Using a dimmer can actually help prolong the life of your bulbs. This is because bulbs running at lower power get put under less stress as there is less heat being emitted. This is why some of those famous bulbs you see on the internet that are still running after 100 years tend to be at very low levels – they would have burnt out long ago if they were at maximum output.”

 

How much is this in relation to Arduino power usage?

After looking at different sources, including open source forums, I have found what components use the most power. As our goal is to conserve energy, ideally, we would want the Arduino uno to use as little as possible. Not all of components will be needed for our project.

The two main active components on the board are the 328 and the FTDI chip.

The FTDI will probably always be the same unless it goes into standby when there’s no USB activity.

As for the 328 the overview on the spec sheet says:

– Active Mode: 0.2 mA

– Power-down Mode: 0.1 [ch956]A

– Power-save Mode: 0.75 [ch956]A

But that’s at 1MHz and 1.8v which isn’t a lot of use.

 

How much would power usage increase with a internet connected device?

The Uno itself is not the most power efficient hardware, consuming just under 50mA when running. Also “any WiFi device will have some huge power consumption, something around 50mA when receiving and over 150mA when transmitting.” That’s basically 100mA when the Uno is running and listening for WiFi packages.

 

Is a solar powered system feasible?

The amount of electricity a solar panel produces depends on three main things

  1. The size of the panel,
  2. The efficiency of the solar cells inside
  3. The amount of sunlight the panel gets.

https://solarpowerrocks.com/solar-basics/how-much-electricity-does-a-solar-panel-produce/

As of 2017, a typical solar panel produces around 265 watts of power. That can vary based the size and efficiency of the solar panel you choose; you’ll see panels that produce 210, 280, even 320 watts. More efficient panels are a little more expensive, and are usually only needed if you have limited space on your roof.

 

How accurate is an ambient light sensor at detecting light in a room from different positions?

An LDR is a sensor that will detect surround light. It is a component that has a variable resistance, which changes with the light intensity that falls upon it. This allows them to be used in light sensing circuits.

https://www.kitronik.co.uk/blog/how-an-ldr-light-dependent-resistor-works/

“The most common type of LDR has a resistance that falls with an increase in the light intensity falling upon the device. The resistance of an LDR may typically have the following resistances: Daylight = 5000Ω, Dark = 20000000Ω”

Applications of LDRs

Lighting switch: The most obvious application for an LDR is to automatically turn on a light at a certain light level. An example of this could be a street light or a garden light.

Camera shutter control: LDRs can be used to control the shutter speed on a camera. The LDR would be used to measure the light intensity which then adjusts the camera shutter speed to the appropriate level.

Blog 1 – Energy Efficient Lighting

PROJECT AIM

An automatic lighting system for the home that logs the entry and exit of people within a room. Turns the lights on and off depending on if there are people in the room or not.

PROBLEMS

People often leave lights on in a room when they are not needed. Whether this be laziness or carelessness. Energy is wasted in the process. Full lighting is also not usually necessary throughout the day. Dimmers are common, but tend to be not effectively used.

  • Bright lights are not needed during daylight hours. Lights (unless dimmers) only have full off or fully on.
  • Arduino project could contribute to energy usage from the grid (might use more energy while running all the time vs energy saved).

RESEARCH QUERIES

Does turning off a light bulb intermittently save more energy than leaving it on?

  • Do lightbulbs have a high start up energy?

What’s the relationship between brightness of a bulb and energy usage?

  • Is it worth dimming the bulb?
  • How much is this in relation to Arduino power usage?
  • How much would power usage increase with a internet connected device
  • Is a solar powered system feasible?
  • How accurate is an ambient light sensor at detecting light in a room from different positions?

SOLUTION CHARACTERISTICS

  • Automatic light activation.
  • Sense directional movement and keep track of people in room.
  • Ambient light sensor to set bulb brightness accordingly (or in room with no light during the day). Maintains a certain luminosity in a room with light from outside and light from bulb.
  • Can refresh every hour or so. Connect to internet to deduce sunrise and sunset.
  • Run clock that measures sun cycles throughout the year instead of internet connection? Notification of energy saved/ in terms interesting statistics (e.g you’ve saved 10 trees this week). LED display/app interaction, run Arduino off solar to minimise impact.

HOME ENVIRONMENT INTEGRATION

  • Modular box that fits over existing light switches and can actuate them
  • Can detect entry and exit of people to the room reliably, not including anomalies (e.g pets).

 

MQ-2 and MQ-7 Prototype

We have all the code behaving as we want it to, and the circuit responding to it we expected. The inputs and outputs are clearly observable, and moreover easily controlled. Unfortunately, the motor does not provide us with enough torque, and as a result does not turn the fan with a high enough velocity. Therefore, the whistle is not provided with enough directed air pressure to pass through it to make a noise. Despite this, the output of a motor turning could lead to a range of different functions to alert a passer-by that a flammable gas such as butane, or carbon monoxide is present.

Box Base     Box Lid

Because of how we have designed and structured the breadboard and Arduino, we had to then distance the sensors, LEDs and motor, so they were easily visible. We did this by taking them off and connecting them with female to male cables. We then designed the box around this arrangement. It featured a lid with six holes, and a base to contain the circuitry.

Box open

In hindsight, we should of positioned the holes for each smoke sensor on opposing sides of the box. This would of made testing far easier and proving of concept far easier.

MQ-2 and MQ-7 with DC Motor

I set up a simple circuit consisting of a DC Motor, Diode and Transistor. The code allowed me to control the RPM of the motor, by typing a number between 150 and 255 into the Arduino Serial monitor.

The image and video below shows this.

20180224_202008

 

The following code is what I used to control the motors speed:

int motorPin = 3;

 

void setup()

{

  pinMode(motorPin, OUTPUT);

  Serial.begin(9600);

  while (! Serial);

  Serial.println(“Speed 0 to 255”);

}

 

 

void loop()

{

  if (Serial.available())

  {

    int speed = Serial.parseInt();

    if (speed >= 0 && speed <= 255)

    {

      analogWrite(motorPin, speed);

    }

  }

}

The next stage was to combine the original MQ-2 and MQ-7 breadboard and code with the DC Motor circuit and code. The aim was to be able to set a different motor speed as an output for each different gas readings. A different speed for the MQ-2, MQ-7 and neural set up. This along with the separate LED displays would clearly determine what gas is being detected.

The image shows the Fritzing breadboard of the final set up.

Final

The next image shows the real circuit, as well as an additional 3D printed fan to clearly show the rotation of the motor.

Fan

The video shows the circuit in action, using all the components.

The red LED is shown when the MQ-7 sensor is detecting carbon monoxide, and the green LED lights up when butane is detected. The lighter used contains a combination of flammable gases, which explains why both sensors react to it. But when the fuel is released from the lighter in the direction of each sensor, it is clear that they are responding independently.

The readings on the Arduino Serial monitor also support these observations.

MQ-2 (Pin A0) Detected:

MQ-2

MQ-7 (CO value) Detected:

MQ-7

Both Detected:

Both

As well as the additional motor functions, the following code has also been improved from the last by making the tones more distinguishable between each sensor that is detecting a gas.

int redLed = 12;
int greenLed = 11;
int whiteLed = 7;
int buzzer = 10;
int smokeA0 = A5;
int AOUTpin = A4;
int DOUTpin = 8;
int motorPin = 3;

int sensorThres = 100;

void setup() {
// Output setups, LED, buzzer, motor
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(whiteLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
pinMode(DOUTpin, INPUT);
pinMode(motorPin, OUTPUT);
Serial.begin(115200);

 

}

void loop() {
// Defining the read intergers for the input
int analogSensor = analogRead(smokeA0);
int value = analogRead(AOUTpin);
int limit = digitalRead(DOUTpin);
int speed = Serial.parseInt();

//Output of serial print and LED, buzzer, motor
Serial.print(“Pin A0: “);
Serial.println(analogSensor);
Serial.print(“CO value: “);
Serial.println(value);
Serial.print(“Limit: “);
Serial.println(limit);
Serial.println(“Speed 0 to 255”);
delay(100);
if (analogSensor > sensorThres && value > 100) // Both triggered
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, HIGH);
digitalWrite(whiteLed, LOW);
tone(buzzer, 1000, 600);
delay(50);
tone(buzzer, 1000, 600);
delay(50);
tone(buzzer, 1000, 600);
digitalWrite(motorPin, 255);

}
else if (analogSensor < sensorThres && value > 100) // MQ-7 triggered
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
digitalWrite(whiteLed, LOW);
tone(buzzer, 500, 300);
digitalWrite(motorPin, 150);

}
else if (analogSensor > sensorThres && value < 100) // MQ-2 triggered
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
digitalWrite(whiteLed, LOW);
tone(buzzer, 2000, 1200);
digitalWrite(motorPin, 150);
}
else if (analogSensor < sensorThres && value < 100) // Neutral setup
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, LOW);
digitalWrite(whiteLed, HIGH);
noTone(buzzer);
digitalWrite(motorPin, 0);
}
}

Now that I have successfully built the circuit with all the necessary components along with the correct code, I now need to incorporate it into a housing with physical components that respond to the outputs.

MQ-2 and MQ-7 in Series

After both smoke sensors were used for their own purpose correctly as independent components, we collaborated the code and breadboard layout to form one complete circuit. The aim was to allow the individual sensors to detect different gas inputs, and use the same output components but in a different format. For example, different LED display, sound, and motion.

We firstly combined the separate codes to form the following:

int redLed = 12;

int greenLed = 11;

int buzzer = 10;

int smokeA0 = A5;

int AOUTpin = A4;

int DOUTpin = 8;

 

int sensorThres = 400;

 

void setup() {

  // put your setup code here, to run once:

  pinMode(redLed, OUTPUT);

  pinMode(greenLed, OUTPUT);

  pinMode(buzzer, OUTPUT);

 

  pinMode(smokeA0, INPUT);

 

  pinMode(DOUTpin, INPUT);

 

  Serial.begin(115200);

 

 

}

 

void loop() {

  // put your main code here, to run repeatedly:

  int analogSensor = analogRead(smokeA0);

  int value = analogRead(AOUTpin);

  int limit = digitalRead(DOUTpin);

 

  Serial.print(“Pin A0: “);

  Serial.println(analogSensor);

  Serial.print(“CO value: “);

  Serial.println(value);

  Serial.print(“Limit: “);

  Serial.println(limit);

  delay(100);

 

  if (analogSensor > sensorThres)

  {

    digitalWrite(redLed, HIGH);

    digitalWrite(greenLed, LOW);

    tone(buzzer, 2000, 600);

    delay(100);

    tone(buzzer, 1000, 600);

   

  }

  else

  {

    digitalWrite(redLed, LOW);

    digitalWrite(greenLed, HIGH);

    noTone(buzzer);

   

  }

   if (value > 100)

  {

    digitalWrite(redLed, HIGH);

    digitalWrite(greenLed, LOW);

    tone(buzzer, 1000, 600);

    delay(100);

    tone(buzzer, 5000, 600);

   

  }

  else

  {

    digitalWrite(redLed, LOW);

    digitalWrite(greenLed, HIGH);

    noTone(buzzer);

   

  }

}

 

However, it did not behave as we expected. The readings were not clear, and the gas detection did not seem to have a pattern. Consequently, we decided to rewrite a new code instead of taking syntax from previous ones. This resulted in us achieving more effective and clearer instructions. The following images and video show what we did.

This is the Fritzing board containing all components.

MQ-2 and MQ-7 no white

This is the circuit we put together.

20180224_180249 (1)

The following video demonstrates our testing.

 

This was our improved code:

int redLed = 12;

int greenLed = 11;

int buzzer = 10;

int smokeA0 = A5;

int AOUTpin = A4;

int DOUTpin = 8;

 

int sensorThres = 400;

 

void setup() {

  // put your setup code here, to run once:

  pinMode(redLed, OUTPUT);

  pinMode(greenLed, OUTPUT);

  pinMode(buzzer, OUTPUT);

 

  pinMode(smokeA0, INPUT);

 

  pinMode(DOUTpin, INPUT);

 

  Serial.begin(115200);

 

 

}

 

void loop() {

  // put your main code here, to run repeatedly:

  int analogSensor = analogRead(smokeA0);

  int value = analogRead(AOUTpin);

  int limit = digitalRead(DOUTpin);

 

  Serial.print(“Pin A0: “);

  Serial.println(analogSensor);

  Serial.print(“CO value: “);

  Serial.println(value);

  Serial.print(“Limit: “);

  Serial.println(limit);

  delay(100);

  if (analogSensor > sensorThres && value > 80) // both triggered

  {

    digitalWrite(redLed, HIGH);

    digitalWrite(greenLed, LOW);

    tone(buzzer, 1000, 600);

    delay(100);

    tone(buzzer, 5000, 600);

 

  }

  else if (analogSensor < sensorThres && value > 80) //CO trigger4ed

  {

  //output goes here

  }

  else if (analogSensor > sensorThres && value < 80) //smoke triggered

  {

  //outpu goes here

  }

  else if  (analogSensor < sensorThres && value < 80)

  {

    digitalWrite(redLed, LOW);

    digitalWrite(greenLed, HIGH);

    noTone(buzzer);

  }

}

 

This code turned the red light and a series of tones, when either of the sensors detected a gas. A green LED was present when nothing was detected. This function does not determine what gas or sensor has detected anything, which would not be very beneficial in actual use.

For this reason, we wanted to increase the number of LED’s that would display each detection. Having one colour for neutral, one for each sensor, as well as multiple for both sensor detection. Another improvement from the last configuration, is an increase in resistance over each output component. We reduced the brightness of the LED’s and the amplitude of the buzzer to make it more bearable when testing the circuit. The following image and video show the results.

This is the Fritzing board containing both smoke detecting sensors, a buzzer, and a white, green and red LED.

MQ-2 MQ-7 and Buzzer

This is the circuit we put together.

20180224_205410

This video demonstrates all the components and their functions in use.

 

The following code achieves these functions.

int redLed = 12;

int greenLed = 11;

int whiteLed = 7;

int buzzer = 10;

int smokeA0 = A5;

int AOUTpin = A4;

int DOUTpin = 8;

 

int sensorThres = 400;

 

void setup() {

  // Output setups, LED, buzzer, motor

  pinMode(redLed, OUTPUT);

  pinMode(greenLed, OUTPUT);

  pinMode(whiteLed, OUTPUT);

  pinMode(buzzer, OUTPUT);

  pinMode(smokeA0, INPUT);

  pinMode(DOUTpin, INPUT);

  Serial.begin(115200);

 

 

}

 

void loop() {

  // Defining the read intergers for the input

  int analogSensor = analogRead(smokeA0);

  int value = analogRead(AOUTpin);

  int limit = digitalRead(DOUTpin);

 

  //Output of serial print and LED, buzzer, motor

  Serial.print(“Pin A0: “);

  Serial.println(analogSensor);

  Serial.print(“CO value: “);

  Serial.println(value);

  Serial.print(“Limit: “);

  Serial.println(limit);

  delay(100);

  if (analogSensor > sensorThres && value > 100) // Both triggered

  {

    digitalWrite(redLed, HIGH);

    digitalWrite(greenLed, HIGH);

    digitalWrite(whiteLed, LOW);

    tone(buzzer, 1000, 600);

    delay(100);

    tone(buzzer, 5000, 600);

 

  }

  else if (analogSensor < sensorThres && value > 100) // MQ-7 triggered

  {

    digitalWrite(redLed, HIGH);

    digitalWrite(greenLed, LOW);

    digitalWrite(whiteLed, LOW);

    tone(buzzer, 1000, 600);

    delay(100);

    tone(buzzer, 5000, 600);

 

  }

  else if (analogSensor > sensorThres && value < 100) // MQ-2 triggered

  {

    digitalWrite(redLed, LOW);

    digitalWrite(greenLed, HIGH);

    digitalWrite(whiteLed, LOW);

    tone(buzzer, 1000, 600);

    delay(100);

    tone(buzzer, 5000, 600);

    digitalWrite(redLed, LOW);

    digitalWrite(redLed, HIGH);

  }

  else if  (analogSensor < sensorThres && value < 100) // Neutral setup

  {

    digitalWrite(redLed, LOW);

    digitalWrite(greenLed, LOW);

    digitalWrite(whiteLed, HIGH);

    noTone(buzzer);

  }

}

Using a standard lighter proved to be a challenge to detect specific gases, as they do not always contain just butane. The readings on the Arduino Serial monitor show definite readings of each gas, so we know that they work and behave as we want the code to. However, we think the lighter also contains carbon monoxide, so the red LED also reacts to the lighter. Breathing on the sensor is another method of getting a reading from the MQ-7 sensor, and only the red LED responds.

The next step of this project is to incorporate an additional output, which will be a motor. We plan on connecting it to a fan, which will blow air through a whistle. This will be covered in the next blog post.