---------------------------------------------------------- AeroElectric-List Digest Archive --- Total Messages Posted Wed 11/16/16: 3 ---------------------------------------------------------- Today's Message Index: ---------------------- 1. 12:14 AM - LDR + RGB Led = Color sensor. How to calibrate it? (Chuoi) 2. 05:14 AM - Re: Automotive Electrical System Study (Robert L. Nuckolls, III) 3. 08:00 AM - Re: Automotive Electrical System Study (William Hunter) ________________________________ Message 1 _____________________________________ Time: 12:14:32 AM PST US Subject: AeroElectric-List: LDR + RGB Led = Color sensor. How to calibrate it? From: "Chuoi" 1$ color sensor. My adventures in electronics continue. While talking with a friend about colors, he told me about color sensors. Later I remembered the video where they sort smarties and so I wanted to know more. Watching some videos I found one with a LDR and a RGB led. They say it's not precise. Looking at the various builds of those sensors I guess that part of the problems are the case that holds everything together. Most of them have a lot of space between the LDR and the colored surface, some have the leds in front of the LDR... that cannot work. There should be no other light source than the RGB led. Put the LDR and RGB Led inside a small tube, inside needs to be black. I couldn't find a tube made of this material. so I took a thick Pen. Direct lightning of the rgb should be avoided. To get a nice homogeneous color I put a white semitransparent piece of plastic in front of the Led. The LDR should only get the reflected light. Put the sensor on top of the white plastic. The light needs to be behind the LDR!. It cannot work for everything. You can use it for only specific surfaces. For example I use glossy photo paper. Opaque would be better probably. but I had some photopaper in the printer and so I printed a colorpalette & a black and white palette. You need to know more about the Led & LDR. That is basically the problem. The Red, Green and Blue emitted by the led are not 100% red green and blue. The LDR cannot absorb every color perfectly . Without looking other codes I hooked up this color sensor pen to the arduino... and measured how much time it needs to turn on the various colors. I ended up with 50ms for each color. Done that I just let the LDR print some values on the screen. Black and white... how much range do I have from black to white? I wrote a code where it autocalibrates the black and white. Basically I measured the light asbsorbment on the previously printed black and white photo paper. I was actually impressed how much range i could have. From the total of 1023 range aviable on the arduino I go a black of around 30-50 on all colors and a white around 700. That means the color sensor has a theoretically precision of, let's say an average range of 650 on each color, 650*650*650 =274.625.000, around 270 million colors. Thats alot ...rgb has 16million colors. I personally know about 5-6 colors. At that point I started to test. to make it simple I placed another rgb led on the board and a white plastic hut on the led. The colors appeared already similar but to much lighness. Also on dark surfaces I got the led turn on. I then decreased the range at about 10% at the bottom and 10% from top. And wow.. color looks the same. But lets see the numbers. Printing the rgb values on screen gave different numbers than those I measured ... but opening a rgb color selector on screen and displaying it... showed approximately the right color ... so it was actually very correct.Even if my printer is a photoprinter it does not means that the colors are printed correctly. I never calibrated a printer or a monitor...So there can be a big difference. So I tried to calibrate the various colors based on the printed palette. Turned the red light on and decreased the range of green and blue to 0 while on red... the same for grren and blue.I finally found the real problems. The red is almost perfect. The blue is slightly shifted towards the red. The green has not enough light? When on green I need to put the red and blue levels very low. But doing that dr! ops the precision a lot . I get perfect red(255,0,0), blue(0,0,255), green(0,255,0), yellow(255,255,0),fuchsia(255,0,255),aqua(0,255,255). the range of every color is dropped so much that at the end I probably can measure only about 10-15 main colors. How could I calibrate a 1$ color sensor? Every led color is shifted slightly. The green does not output enough light. My printer didn't print the right colors. The LDR does not read every color correctly (wavelength,light....) I think somewhere out there is a mathematical calculation that allows the vitrual shifting of each color. I posted this here because it's a vast question that needs the basics of electronics engineering. While I think most problems could be solved with a complex mathematical function I could be wrong and solve the problem with some simple dimming of the led, adding more leds, maybe filter the light source or just move the sensor up or down inside the tube.what about just by changing the resistors?. In all cases a electronic engineer is needed. The way the leds emit the light and the sensor absorbs it has to do with the individual wavelength...i'm not an electronical enginer. I think also it's worth to ask because of the fact that color sensors are normally not that cheap. RGB led: TLHB4201 (http://www.kynix.com/Detail/3877/TLHB4201.html) LDR: FW300 Short clip that shows the sensor Read this topic online here: http://forums.matronics.com/viewtopic.php?p=462639#462639 ________________________________ Message 2 _____________________________________ Time: 05:14:55 AM PST US From: "Robert L. Nuckolls, III" Subject: Re: AeroElectric-List: Automotive Electrical System Study At 01:05 PM 11/15/2016, you wrote: >Hi All, > >I finally got around to conducting the scientific study of the >electrical draw of my car electrical system when the ignition switch is off. > >Here is the results of this scientific study: > >1999 Saturn 3.46 MA >2002 Saturn 2.02 MA >2007 Yukon 3.42 MA > >The 1999 Saturn was the one I had the new battery die on last >week. The battery was really dead (not mostly dead) after it sat at >the airport for about 5 weeks. AutoZone determined that the 8 month >old (new) battery had a bad cell and replaced it for FREE!!! > Interesting, thanks. Went out and measured the cars in my driveway: 1987 GMC R1500 24 mA 1998 Saturn SL1 1.5 mA 2006 Kia Sedona 2.0 mA >I ass-u-me that one cell going bad could reduce the capacity of the >battery to the point where the interior lights would not even show >any kind of life?!?!? Sure, if the cell went open . . . then it doesn't matter how much snort is left in the remaining cells. The truck's parked demand on the battery amounts to .024 x 24 x 30 = 17 a.h. or about 1/2 the battery's capacity in a month. I probably need to check that again, it seems excessive. Oops, just remembered that I've got a couple of chargers plugged into always hot outlets . . . I'll bet that's where most of the parked-drain is going. Bob . . . ________________________________ Message 3 _____________________________________ Time: 08:00:55 AM PST US From: William Hunter Subject: Re: AeroElectric-List: Automotive Electrical System Study I forgot that one of my Saturns had a mobile charger plugged so that would add to the draw. Bill Hunter +1 408-464-1902 On Nov 16, 2016 05:46, "Robert L. Nuckolls, III" < nuckolls.bob@aeroelectric.com> wrote: > At 01:05 PM 11/15/2016, you wrote: > > Hi All, > > I finally got around to conducting the scientific study of the electrical > draw of my car electrical system when the ignition switch is off. > > Here is the results of this scientific study: > > 1999 Saturn 3.46 MA > 2002 Saturn 2.02 MA > 2007 Yukon 3.42 MA > > The 1999 Saturn was the one I had the new battery die on last week. The > battery was really dead (not mostly dead) after it sat at the airport for > about 5 weeks. AutoZone determined that the 8 month old (new) battery had > a bad cell and replaced it for FREE!!! > > > Interesting, thanks. > > Went out and measured the cars in my driveway: > > 1987 GMC R1500 24 mA > 1998 Saturn SL1 1.5 mA > 2006 Kia Sedona 2.0 mA > > > I ass-u-me that one cell going bad could reduce the capacity of the > battery to the point where the interior lights would not even show any kind > of life?!?!? > > > Sure, if the cell went open . . . then it > doesn't matter how much snort is left in > the remaining cells. > > The truck's parked demand on the > battery amounts to .024 x 24 x > 30 = 17 a.h. or about 1/2 the battery's > capacity in a month. I probably need > to check that again, it seems excessive. > > Oops, just remembered that I've got a > couple of chargers plugged into always > hot outlets . . . I'll bet that's where > most of the parked-drain is going. > > Bob . . . > ------------------------------------------------------------------------------------- Other Matronics Email List Services ------------------------------------------------------------------------------------- Post A New Message aeroelectric-list@matronics.com UN/SUBSCRIBE http://www.matronics.com/subscription List FAQ http://www.matronics.com/FAQ/AeroElectric-List.htm Web Forum Interface To Lists http://forums.matronics.com Matronics List Wiki http://wiki.matronics.com Full Archive Search Engine http://www.matronics.com/search 7-Day List Browse http://www.matronics.com/browse/aeroelectric-list Browse Digests http://www.matronics.com/digest/aeroelectric-list Browse Other Lists http://www.matronics.com/browse Live Online Chat! http://www.matronics.com/chat Archive Downloading http://www.matronics.com/archives Photo Share http://www.matronics.com/photoshare Other Email Lists http://www.matronics.com/emaillists Contributions http://www.matronics.com/contribution ------------------------------------------------------------------------------------- These Email List Services are sponsored solely by Matronics and through the generous Contributions of its members.