How to build a MINIATURE Spectrometer for the Raspberry Pi

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi and welcome back to leslie's lap in a previous episode we took a look at a homemade raspberry pie spectrometer like this and one of the most frequently asked questions i got at the back of that episode was well can we make it smaller um so in this episode that's exactly what we're going to do so let's go so back in episode 20 i demonstrated the homemade raspberry pi spectrometer which very simply consisted of a raspberry pi camera a zoom lens that i picked up off ebay and a diffraction rating spectroscope which came from patton hawxley or a uk company that produce diffraction gratings and spectroscopes for educational purposes um yeah it's pretty pretty useful uh tool uh it's a little bit on the large side if we compare it with say a raspberry pi 3 um yes it's quite a it's quite a large spectroscope and there's been a lot of comments you know can we shrink this can we make it any smaller uh there was some talk on hackaday about maybe integrating something like this into uh troy uh tricorders um like star trek tricorders right there's actual projects where people are trying to build these things and but yeah um can we shrink this thing at the back of the video where i demonstrated this uh the director tom from patton hawksley actually sent me this which is a miniature version a really really generous gift and this isn't a sponsorship or anything like that it was just a thank you for the orders that have been generated essentially and they sent me some other kit as well which will be featured in upcoming videos no doubt uh diffraction gratings and slits and so forth but let's take a look at this this is a very very tiny version of the diffraction grating spectroscope and we can see the slit in the end there and then we have the eyepiece that you'd look through to see the spectrum and it has to be said when i tried this out with my eyeball um this performs just as well as it's larger there's a larger version there so obviously the question is well can we build a raspberry pi spectrometer out of this and obviously make a very very small uh diminutive version of its uh of its predecessor there so i've gone shopping on ebay and i've picked up a little raspberry pi camera with an m12 mount and this actually has the ir cut filter removed so we should be able to see a little bit of infrared um should be noted that these cameras by default come with a you know standard sort of cctv lens so the focal length of this is 3.6 millimeters and we'll talk a little bit about why that's important shortly i also picked up a selection of lenses and some third-party lenses to try and these have also all different focal lengths so we've got an eight millimeter focal length a 12 and a 16. um why have we gone to all this effort well if we take a look at the uh the lens i was using in the previous version i've got quite a few of these lenses the handy for like ai projects and stuff you know computer vision and what's important about these is the focal length is actually variable between 9 and 22 millimeters and this is what gives us the level of zoom essentially so if we think about um a standard standard lens 3.6 millimeters and the idea is that we get a very very wide field of view and sold a virtual image um that's produced just about fits on the on the ccd if we start using longer focal lengths we actually get a larger image or a larger virtual image projected onto the ccd which means that we get a larger view in our case of the spectrum that we're that we're looking at um so yeah that's it in a nutshell um out of these three lenses um i'd guessed ahead of time that 12 millimeters would be um exactly where i wanted to be in terms of uh fitting the entire spectrum in the entire field of view of the camera and so that's what we're going to try today i do also have 8 and 16 millimeters um and honestly i just sort of bought these for experimental purposes there's obviously um other things that i've been wanting to do with uh with cameras if we're thinking about things like machine vision um just out of curiosity i mean when we first try this we'll try it with the standard lens um so you can see the difference you know we'll see what uh what kind of field of view you get with the standard lens and then obviously we'll try the 12 millimeters so i built a small aluminium jig for this um everything's adjustable so the the back camera mount we can actually rotate on its axis if we want to look at a particular end of the spectrum and it's all just you know manufactured out a little bits of aluminium i'm a big fan of metal but i'm sure some of you guys have 3d printers and you could probably come out with something creative with the 3d printer anyway i have the camera hooked up to the raspberry pi before i can fit it in this mount i need to remove the lens uh everything's a friction fit although i do have set screws to retain things in position and we'll use the stock 3.6 millimeter lens first i think my biggest complaint about the raspberry pi cameras with the m12 mounts is more often not the mounts are plastic and it's very very easy to cross thread them so there's my camera mounted and then we just need to take the spectroscope and i'll just line this up and then we'll take a look at the software so that's the spectrometer assembled as you can see very very much smaller than the original and you're looking at a length of about 80 millimeters if we compare that with a raspberry pi model 3 it's about the length of the raspberry pi excellent so now that everything's set up we'll just point it out the window and take a look at the software and we should be able to see our if i can get there get it lined up right we should be able to see our spectrum um needs a little bit of focus that's about as good as i can get it um yes so we can see very very small spectrum in the middle there it looks like we're picking up some ir we've got a couple of dark absorption bands way over at the red end there excellent i suppose we could attempt to calibrate it so let's give that a go i need a white surface this lid will do so we'll put peak hold on and we'll give it a quick blast so there's 405 we can see how tight this is already and then we'll give it a quick glass with 650 that's 650 we'll hit calibrate and we can see it's done something very very interesting with my graticule obviously when i wrote this stuff where it was never designed to have such a narrow view of the of the spectrum there um but yeah it's it's a little bit how you're doing i think that's something we could maybe fix um yeah so there's our there's our spectrum now it's kind of difficult to work out where the end is i can see 700s popping up in the peak so we're just in the near infrared i would say excellent um obviously this isn't this isn't the the sort of best way to run the software obviously we've got two too narrow of a view so let's disassemble this and we'll replace the lens so just remove my spectroscope and i should just be able to unscrew the lens and we'll replace it with 12 millimeters again you've got to be very gentle with these plastic m12 mounts and we'll take a guess at where the focus is should be about right let's make sure everything's home and we'll pull it into focus i think that's about as good as we can expect to get awesome so now we've now have a spectrum that is uh more or less filling our field of view we'll try and tilt the camera a little bit just that should be about it and then obviously you know we tighten it up at this point uh but yeah looking so far so good it's looking as good um as the larger version let's do a quick call on this let's see if we can get something a little bit more reasonable out of it so we'll clear the points uh we'll fire on peak hold so there's 405 and then we'll calibrate 650 there's our 650 we'll hit cal and now we've got something that looks a little bit more reasonable on the screen there so let's take off peak hold and we'll have a quick look out of the window once more much better awesome might say every bit as capable as the larger version but in as much smaller package and while we're about it i have a fluorescent lamp on the bench um let's see some uh some lines some emission lines excellent look at that absolutely fantastic well we're on the subject of fluorescent tubes and everybody likes to see a mission spectrum i mean it's it's marvelous seeing all those little peaks in there so i've got a few more tubes that we can try out today just because why not i'm doing a video so we might as well see some stuff i've got this which is a deuterium lamp um this emits mostly uv but i do believe there should be the deuterium alpha line somewhere in the red and there should be a fairly uh fairly decent continuum in the middle of the emission there as well and this was something i picked up off ebay for like five quid which is not a bargain you'd be looking at like 300 pounds for a lamp like this um so i'll maybe give that a bill uh one thing to note about things like deuterium lamps and they make copious amounts of ultraviolet and so whatever you do don't look at them when they're in operation and don't expose your skin to them for too long and that's how you get skin cancer and and corneal ulcers right nobody wants those kind of things but we'll give it a quick try in a minute um i've got some other lamps as well um i picked up this this is a black light one of those uv black lights i don't expect we'll see very very much out of this but there must be some visible emission that we can see surely um i picked up this as well um this is a pure mercury vapor lamp this is a germicidal lamp and once again i can't really stress too much the danger of looking into these things um absolutely don't um the ultraviolet that it emits is really quite dangerous i think it's uvc um so yeah it would give you uh quite the tan and it can actually damage your eyes so let's just turn off the fluorescent and we'll try a couple of these tubes we'll try the uv black light first i suspect we'll have to stick the spectroscope right up to it but we'll see if we can see anything oh interesting so we can see a little way into the ultraviolet which is actually really really nice and some guys had asked um you know how far into the uv can can these sort of cameras see um i didn't think it would be very far um but we can see a peak there at 375 or thereabouts that's actually pretty impressive i'm surprised uh very surprised to even see it and we can see a 405 nanometer line there as well how curious very very interesting cool um let's try another lamp so i'll try the uvc lamp and once again i'm just looking at the camera monitor here so i think i can get away with that so this is our uvc lamp this is mercury vapor only and we can see specifically mercury vapor lines in there so there's a there's a red line a green line and a blue line and a violet line which is pretty nice you know if you wanted a spectroscopic standard to play with um you know a wavelength standard i suppose this would be a cheap solution although uh maybe a little a little of a dangerous solution uh yeah as i've said copious amounts of ultraviolet light are emitted by these kinds of lamps so do be careful um cool so have the deuterium lamp hooked up if i point it towards the camera we should be able to see its light output and it doesn't look particularly bright but don't let it don't let it deceive you and chances are high that the uv out of this is excessive so because it's a point source it's actually pretty difficult to line it up with the spectrometer but we can see some line and a little bit of a continue i don't really want to have to touch the envelope but anyway not too exciting um and like i say chances are high that there is lots um lots and lots of ultraviolet being emitted there so i have a very small xenon lamp that you might find in a camera flash for example we'll see if we can get some light out of it it's quite dim but there's our cenon spectrum i suppose if we put a reflector behind it or i don't know maybe even like actually drove it properly with that with a high current would be able to see something a little bit better um but yeah sure certainly detectable peaks in there anyway so all in all a very capable and useful uh miniature spectrometer and as i've said much much smaller than the previous version only 80 millimeters in length um we could weigh it you know if you guys are interested in sticking these things on drones or whatever and measuring the spectra of street lights i suppose we could do that so how many grams 51 grams um granted you know i've sort of built all this out of aluminium if you're going to 3d print um a case for this i suppose you could get that a little bit lighter but yes a very very useful diminutive spectrometer it has to be said um i'll link in the website for patton hawks they're down below so if you guys want to go and buy one of these and it's actually ever so slightly cheaper than its bigger brother um it comes in at about 64 bucks you know plus or minus a few pence or whatever um yeah the camera is just a regular pie camera with an m12 mount and don't forget if you want to you know have the spectrum fill the screen as i've shown you today you want to go pick yourself up a 12 millimeter lens um again very very cheap you can you find these things all over ebay if you're interested in you know doing uh doing things with pi cameras and and whatnot it's always a good idea to get a selection of lenses in any way so that you can fine-tune your application thanks for watching this episode of leslie's lab if you want to see more content like this don't forget to hit like and subscribe down below and i'll see you guys next time
Info
Channel: Les' Lab
Views: 34,433
Rating: undefined out of 5
Keywords: Raspberry Pi, Laser, Spectroscope, Spectrometer, Spectrophotometer, diffraction, Picamera, Raspberry Pi 4, Picam, GitHub, Violet Laser, Red Laser pointer, Fluorescent tube, Python, Spectra, Mercury Spectrum, Daylight Spectrum, Optical Spectrum Analyzer, Optical Spectrum Analyser, Miniature Spectrum analyser, Miniature Optical spectrumanalyzer, Mini Spectrometer, mini spectroscope, small spectroscope, Xenon, Deuterium, Mercury Vapor, UVC Lamp, Ultraviolet, tricorder, drone, ultraviolet
Id: Tw3HJEhE2dI
Channel Id: undefined
Length: 17min 9sec (1029 seconds)
Published: Sun Jun 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.