Build a Real-Time UV Exposure Meter With Arduino
by CrazyScience in Circuits > Arduino
16686 Views, 86 Favorites, 0 Comments
Build a Real-Time UV Exposure Meter With Arduino
Hello readers in this Instructables i will show you how to make real-time UV exposure meter with arduino.
Have you ever wondered what percent of UV light coming from the sun is harmful or healthy to you? The answer that almost everyone would say is a big "NO" and even i realized it recently.
Sunlight is good and it totally depends on what time of the day you go out! like for example during early hours the uv coming from the sun is in minimal quantity and its good for you.
The UV light peaks during the noon hours and long term exposure will damage the skin!
I wanted to make a device that shows the real time readings of the UV light that is coming out of the sun.
Note that in different parts of the earth where you live the amount of UV light coming out from the sun varies! but the light is still the same.
This portable UV light measuring meter is powered by USB and you can carry it anywhere since it fits in the hand.
It has OLED display that shows the UV light readings and parallelly there is a analog meter with a dial that shows the UV light exposure.
Now you may ask why use both indicators? You could have simply used any one of them.
This is because when you go outside due to the sunlight the OLED readings becomes barely visible, But the analog meter works best here and why settle for only one while you can have two.
This device is powered by Arduino uno board and the UV sensor ML8511 is used to measure the UV light.
Now you may ask are you sure the device shows the right readings? and how did you calibrate this device.
Well i calibrated the device with bare minimum indoor light that doesn't have readable UV light and to my surprise with the weather app referred from web i can see that the values almost matched in my case.
You can cross check from your end because the time and intensity may differ in your place compared to mine.
Also to double check if the device is giving right values i measured the values in the mid of the day(peak sunlight) and with the evening hours.
During the mid day the device showed the high UV reading whereas during the evening it was pretty much low.
You can consider building this project as i will be explaining the build of mine in very detailed way and the main part is you will get a chance to learn many things like the electronics, programming and the creative usage of Arduino sensor modules.
Like always there is a video of complete project build don't miss to check that.
Supplies
These are the list of components that you should keep handy so the build process can be way quicker
Arduino Uno from amazon
Jumper Cables
Programming Cable
Arduino IDE
Tinkercad (if you want to remix my design)
Ultimaker Cura (Or any other slicer)
PLA Filament
Hot Glue
Super Glue
Double Side Adhesive Tape
Red and Green Paint
Marker
Sunlight!
By buying from these links i may earn a small percent of comission at no extra cost to you
Tinkercad Design and Slicing
I designed the entire parts for this project using the TinkerCad application, its a web based application and you can use that to edit my models if you wish to.
The main thing here is the modules that i will be using is of standard size.
So you can simply use my STL files given on this step to print the parts if you don't want to further edit my design.
It took me quite a while to design this and i have taken care of the strength to weight ratio at the time of design, After few trials i came up with this final design.
You can simply use the STL file that i have given, Export it to the slicer and follow the settings that i used.
I will be printing the 3 parts that i designed one after the another since i want the parts to be of different colors.
The 3 parts are the base, the lid and the arc(meter).
Base holds the electronics and hides all the wires, The arc shape is the dial and we see the analog readings from here
Lid holds the oled, Uv sensor and the servo and i have made enough room to fit all these components.
3D Printing
After the slicing i imported the model from cura slicer to SD Card, you can use any other slicer also but i find this very user friendly with lot of slice options.
Now feed that gcode to 3d printer and you can see the parts getting printed, i will start with base followed by the lid and then the Arc.
For the pointer that sits on the servo horn i used a small piece of PLA filament,
Simply i glued that piece on the servo horn, This pointer can be made with 3d printing but the parts may be fragile and i didn't want that.
There are 3 parts in total and i printed them in different colors, Well this choice of color is based on the individual.
None of the parts need any rafts or supports and printing time is also very less, I used PLA filaments to print this.
After some time you will have the parts ready and none of them needs post processing.
This saves lot of time, and now we can head over to making the electronic circuit that will sit inside this 3d printed casing.
Well now we can build the electronics that actually is the main part of this project.
Circuit and Program
The circuit is not soo complex and if you previously built some projects this circuit will be very easy to make.
I will break down the circuit into small steps so that it will be clear for all the readers.
The OLED, UV sensor and the Servo are the 3 components that we will be connecting to the uno board.
OLED module comes with 4 pins
SCl to A5
SDa to A4
Vcc and Gnd are connected to 3.3v and the ground pin of the uno board.
UV sensor comes with 3 pins(if you have 4 pins you will be using only 3 pins)
Vcc and Ground will be connected to 5v and the ground pin on the uno.
The signal output pin on the UV sensor will be connected to A0 pin.
Micro servo has 3 pins
The signal pin is connected to D9 on the Uno.
Like always the vcc and ground are connected to 5v and the ground pins
Note: I will be powering all the components from Uno board via the USB power supply.
I have optimized the program for the power distribution between the components with good efficiency so that the servo jittering is eliminated.
After the circuit is complete simply connect the uno board to computer, Open ide and you are good to go.
Select the proper type of port and the board type before you click on that upload button.
After you have uploaded the program, You should see the message on the OLED, if you cant see anything on the OLED swap the 3v and 5v pins between the OLED and UV sensor.
Now you should be able to see the circuit working properly.
Downloads
Casing the Electronics
Now we will fuse the electronics and the 3d printed part, 3D printed part serve as a frame that keeps the electronics organized.
I will start by placing the uno board to the base of the 3d printed base, you can either use double sided adhesive tapes or hot glue.
If you are using hot glue make sure that the glue is not too hot which may otherwise melt the plastic of the base.
After the uno board is placed and the glue is dry we can head over to working with the lid part.
I will start by adding the UV sensor module first followed by the OLED module and lastly the micro servo.
Now we have the 2 halves ready and that needs to be combined into one and i will organize the extra jumpers first and then combine these two.
Follow the exact same placement like i did, since i have designed the base and lid and placing of components to utilize the cable space management efficiently.
I will use superglue at the joining part of these two parts, gently press to ensure good bonding between these.
Now we have the project ready and the only thing missing now is the meter which is most important and we will see how to make that in the next step.
Installing the Dial
The dial was hand painted after marking the low and high levels of the UV light.
As you can see the white arc(meter) was divided between the low and high levels of the ultraviolet light.
Low levels of the UV light is indicated by the green color on the meter and it occupies almost 40% of the space on the semicircle.
High level of UV light is indicated by the red paint and it occupies almost 60% of the space on the half circle.
Here the safe level is achieved during the morning hours of sunlight and as soon as the afternoon sunlight starts the UV light reaches to high.
I have measured this and considering those readings i made partition on this arc, if ypu are fro different place where the sunlight intensity varies you may need to change the percentage too
In my case the ideal sunrise time is 6:30 am and sunset time is 6:40PM and the peak uv light was between the 11am to 2:30pm range.
After the paint is dry, add a tiny amount of super glue to the back of this meter and place on the frame of the servo.
Now for the dial i will use a small piece of pla filament, 2cm piece was used here.
Use small heat on the tip and gently press to form a flat surface and this will be glued to the horn of the servo.
This completes the build part and now lets hop in to test this project and lets see that in the next step.
How to Use and a Build Video Tutorial
Well we are in the last step of this project and it is the fruit of the hard work i would say and for every builder seeing their project coming to life and put for practical application is a real bliss to see.
To use this project at first connect the usb cable to uno board and the other end to the power bank.
You will see a message on the OLED "UV Meter ready for use" and next the device goes for calibration and now the previous dial readings will be reset to the zero.
And now the device is fully ready for using, Simply expose the device to sunlight and you will see the readings on the OLED and also the Analog readings on the meter dial.
I have tested this device on the mid of the day(afternoon)and i saw that the meter showed max uv readings which is agreeable.
Then when i checked the device during evening(before sunset) the UVC levels was pretty much on the lower side.
Well now you have a UV meter that tells you the levels of UV light and with the help of this you can decide if you want to step out of the house and pose threat to your skin or simply stay indoors
This was all about making this super useful device, i have attached a complete build tutorial for this uv meter.
If you feel struck somewhere at the time of build you can simply leave a comment and i would be happy to answer to all your queries.
Thank you for your time and i wish to see many builds of yours in the i made it section, Have a great day :)