Intro: Arduino Uno Automated Sunshade System
The product created is an automatic sunshade system for vehicles, it is fully autonomous and is controlled by temperature and light sensors. This system would allow a shade to simply cover the window of the car when the car reached a certain temperature and when a certain amount of light was passed through the car. Boundaries were set so that the shade would not work when a vehicle is on. A switch was added to the system in case you wanted to raise the shade even though neither of the parameters were met. For example, if it was a cool night and you wanted your car covered for privacy, you could simply hit the switch to raise the shade. You could also turn the switch off to completely turn the system off.
Problem statement – “When vehicles are left out in the heat the vehicle interior temperature can become highly uncomfortable, especially for oneself when reentering the vehicle or for passengers left in the vehicle. Having a blind system can also serve as a security device to prevent someone viewing inside your vehicle.” Even though there are sunshades for cars that are easy and simple to put up, it can sometimes be a hassle and you may forget to put it up. With an automatic sunshade system, you wouldn’t have to manually put the shades up or remember to put them up because it would automatically rise when needed.
Image Source: https://changhuiying.wordpress.com/2014/09/22/the-interior-of-car-parked-under-the-sun-is-hotter-than-the-outside-the-car/
Step 1: Design Concept Process
I wanted a simple to make and use design that could eventually be integrated into a vehicle. This means it would be a already installed feature for the vehicle. However, as currently constructed it could be used for a window shade systems as well. For the design creating process several sketches and ideas were made, but after using a decision matrix the now made product was the decided concept to construct.
Step 2: Materials Used
The pictures are of actual components used in the project. The Project Data Sheets are in the attached document. Not all data sheets could be provided. It cost me roughly $146 to build the entire product.
Most parts and components came from Amazon or a home improvement store called Lowe's.
Other devices used:
Arduino downloaded program
Step 3: Logic: How It Works
Through a computer or laptop, code from the Arduino programmer is sent to the Arduino Uno that then reads the code and enforces the commands. Once code is uploaded to the Arduino Uno there will not be any need to stay connected to the computer to continue the program as long as the Arduino Uno gets a different power supply to run. The H - Bridge in the circuit provides an output of 5 volts which is enough to control the Arduino Uno. Allowing the system to work without the computer as the power supply for the Arduino Uno, making the system portable, which is necessary if wanted to be used in a vehicle.
Two limit switches, a temperature sensor, a light sensor, an RBG LED, and a H - Bridge is connected to the Arduino Uno.
THE RBG LED is to indicate where the trigger rod is located. When trigger is at bottom position triggering the lower limit switch the LED shows red. When trigger is between both limit switches the LED displays blue. When the trigger is at the top hitting the upper limit switch the LED shows a pinkish-red.
The limit switches are cutoff switches for the circuit to tell the system to stop motor movement.
The H - Bridge acts as a relay for motor rotation control. it works by switching on in pairs. it alternates the current flow through the motor, which controls the voltage polarity allowing directional change to occur.
A 12 Volt, 1.5 Amp battery provides power for the motor. The battery is connected to the H - bridge so that motor rotational direction can be controlled.
A manual toggle switch is between the battery and H - bridge to act as a On/ Off component to simulate when the car is on or off. When switch is on, indicating that the vehicle is on, no action will occur at all. That way when driving your vehicle the shade wont work. When Switch is off, acting as if the vehicle is similarly off then the system will work and function properly.
The temperature sensor is the keystone component for the circuit, if a temperature of a set threshold is not met, then no action will be done even if light is noticed. If the temperature threshold is met, then the code checks the light sensors.
If the light and temperature sensor parameters are met then the system tells the motor to move.
A gear is attached to a 12V 200rpm geared DC motor. The gear drives a driver rod that rotates a chain and sprocket system that controls the up or down movement of an aluminum rod that is attached to the chain. The metal rod is connected to the shade, allowing it to be raised or lowered depending on what the current code parameters request the shade to be at.
Step 4: Project Development
Step 1) Build Frame
Step 2) Attach components to frame; includes gear and chain systems, also roller shade with locking pin removed
I used pliers to take the end-cap off the roller shade to remove the locking pin. If not careful the spring tension in roller shade will unwind, if that happens it is easy to re-wind. Just hold roller shade and twist internal mechanism until tight.
Step 3) Make circuit on breadboard - use jumper wires to connect proper breadboard pin to Arduino digital or Analog pin.
Step 4) Create code in Arduino
Step 5) Test code; Look at printout on serial monitor, if issues make corrections to code.
Step 6) Finish project; Code works with created circuit and product structure.
Many Forums and tutorial videos were used to help me create my project.
List of References:
With trial and error, research, and additional assistance from colleagues plus college professors I was able to create my final project.
Step 5: Creation Process: Framework
The product was to be constructed so that it could be made with parts fairly easy to obtain.
The physical frame was made of just cedar wood and screws.
Frame is 24 inches long by 18 inches tall. it is roughly a 1: 3 scale of a full size average vehicle windshield.
The physical product has two plastic gear and chain kits, two metal rods, and a roller shade.
A gear is connected to the DC motor, it rotates a metal rod which acts as a driver shaft that controls the chain movement. The driver rod was added to have the shade move evenly.
The gear and chain allows a different metal rod to lift and lower the shade, and acts as a trigger for the two limit switches. .
The roller shade originally had a locking mechanism in it when purchased and I took it out. This gave the roller shade the ability to be be pulled up and lowered down without locking into a position once lifting movement stopped.
Step 6: Wiring Set-up
The wiring had to be neatly organized and wires had to be separated so that no interference occurred between wires. No soldering was done during this project.
- A Ywrobot LDR Light Sensor is used as a light detector, it is a photo-resistor connected to analog pin A3 on the Arduino UNO.
- A DS18B20 Temperature Sensor is used as a set temperature parameter for the project, it reads out in Celsius and I converted it to read out in Fahrenheit. The DS18B20 communicates over a 1-Wire bus. A Library must be downloaded and integrated into the Arudino code sketch so that the DS18B20 can be used. The temperature sensor is connected to digital pin 2 on Arduino UNO.
- A RBG LED is used as a indicator for where the shade position is. Red is when the shade is fully up or fully down, and is blue when is in a moving state. Red pin on LED connected to digital pin 4 on Arduino UNO. Blue pin on LED connected to digital pin 3 on Arduino UNO.
- Micro limit switches were used as stopping points for shade position and stopped motor movement. Limit Switch at the bottom connected to digital pin 12 on Arduino UNO. Limit Switch at the top connected to digital pin 11 on Arduino UNO. Both were set to initial condition of zero when not triggered/ pressed.
- An L298n Dual H-Bridge was used for motor rotation control.Was needed to handle battery amperage that was being provided. The power and ground from the 12V battery is connected to the H-Bridge, which provides power for the 12V 200rpm geared motor. The H-Bridge is connected to the Arduino UNO.
- The 12Volt 1.5A rechargeable battery provides power for the motor.
- A 12Volt 0.6 A 200rpm brushed reversible geared DC Motor was used for this project. Was too fast to operate at full duty cycle while being controlled with Pulse Width Modulation (PWM).
Step 7: Project Design Data
Not much experimental data, calculations, graphs or curves were needed in order to develop the project. The light sensor could be used for a large range of brightness and the temperature sensor has a range from -55°C to 155°C which more than accommodates our temperature range. The shade itself is made of vinyl fabric and attached to an aluminum rod and a 12V battery was chosen because I did not want to have an issue with power. A 12V motor was selected in order to handle the voltage and current supplied from the battery and based on previous knowledge that it should be powerful enough to operate under the forces that would be applied. Calculations were done to confirm that it could indeed handle the torque that would be applied on the motor’s 0.24 inch shaft. Since the exact type of Aluminum rod was unknown due to using personal supplies, Aluminum 2024 was used for calculations. The diameter of the rod is about 0.25 inches and the length is 18 inches. Using the online metal store weight calculator the weight of the rod is 0.0822 lb. The vinyl fabric used was cut from a larger piece weighing 1.5 lb. The square piece of fabric used measures 12 in long by 18 inches wide and is half the size of the original piece. For this reason the weight of our piece of fabric is approximately 0.75 lb. The total combined weight for the rod and fabric is 0.8322 lb. The torque due to these combined loads acts at the center of mass of the rod and was calculated by multiplying the total weight by the 0.24 inch radius of the shaft. The overall torque will act at the center of the rod with a value of 0.2 lb-in. The rod is made of one material with uniform diameter and has a chain support on one end and the motor’s shaft on the other end. Since the chain support and motor’s shaft are equal distances from the center of the rod, the torque due to the weight is shared by each end equally. The motor’s shaft therefore needed to handle half of the torque due to weight or .1 lb-in. Our DC motor has a maximum torque of 0.87 lb-in at 200 rpm which will more than accommodate the sunshade and rod so the motor was implemented so testing could begin. The calculations made me realize that the motor should not operate at maximum conditions so the duty cycle would have to be reduced from 100 percent. The duty cycle was calibrated by trial and error to determine the ideal speed for both raising and lowering the sun shade.
Step 8: Arduino Sketch
To program code I used Arduino IDE. Download the programmer through the website https://www.arduino.cc/
It is simple to use if you never used it before. There are many tutorial videos on YouTube or the internet to learn how to code a program in Arduino software.
I used an Arduino UNO microcontroller as hardware for my project. It had just enough digital pin inputs that I needed.
The attached file is my code for the project and the serial monitor print-out. As noticeable in the document that displays the print-out it states when shade is all the way up or completely down, and when moving up or down.
To have the DS18B20 temperature sensor usable a Library called OneWire was used. This library is found under the Sketch tab when the Arduino program is open.
For code to work make sure the right Port and Board is being used when uploading the code, if not Arduino will give an ERROR and not function correctly.
Step 9: Final Product
I put all the wiring inside the box to protect them from being damaged or removed causing the circuit to possibly not work.
The video displays all possible settings for the automated sunshade. The shade goes up, then light is covered to bring the shade back down. This works only because the temperature threshold has been met, if the temperature was not warm enough the shade would not move at all and would stay down at the bottom in a resting position. The temperature required for system to work can be change and adjusted as desired. The toggle switch in the video is to demonstrate when the vehicle is turned on or when wanting to stop providing power to the motor.
The product is completely portable and autonomous. It is designed to be a item that is built into a vehicle as a automatic shading system, but can use current construction for outdoor shading systems or inside a house for windows.
For indoor use, the product could eventually be connected to a house thermostat physically or with a Bluetooth adaption to the circuit and code, making it possible to control the product with a mobile app. This is not the original intent or how the product is constructed, only a potential use of design.