Build a Sunburn Alarm

download Build a Sunburn Alarm

of 8

Transcript of Build a Sunburn Alarm

  • 8/8/2019 Build a Sunburn Alarm

    1/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    Home Sign Up! Browse Community Submit

    All Art Craft Food Games Green Home Kids Life Music Offbeat Outdoors Pets Photo Ride Science Tech

    Build a Sunburn Alarmby nmcclana on June 22, 2010

    Table of Contents

    License: Public Domain Dedication (pd) ............................................................................................

    Intro: Build a Sunburn Alarm ....................................................................................................

    step 1: FAQ .................................................................................................................

    How does it work? ........................................................................................................

    How Accurate is it? ........................................................................................................

    What are the Technical Details? ..............................................................................................

    step 2: Materials .............................................................................................................

    step 3: Make it: Schematic ......................................................................................................

    step 4: Make it: Power and Propeller ..............................................................................................

    step 5: Make it: Testing ........................................................................................................

    step 6: Make it: Display and Crystal ...............................................................................................

    step 7: Make it: UI and Sensor ...................................................................................................

    step 8: Make it: Programming ....................................................................................................

    step 9: Make it: Using the Propeller Platform SD and LCD UI ............................................................................

    Related Instructables ...........................................................................................................

    Advertisements ...............................................................................................................

    Comments ...................................................................................................................

    http://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=titlehttp://www.instructables.com/tech?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/science?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/ride?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/photography?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/pets?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/outdoors?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/offbeat?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/music?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/life?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/kids?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/home?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/green?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/games?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/food?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/craft?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/art?utm_source=pdf&utm_campaign=categorieshttp://www.instructables.com/about/submit.jsp?utm_source=pdf&utm_campaign=titlehttp://www.instructables.com/community?utm_source=pdf&utm_campaign=titlehttp://www.instructables.com/tag/type-id/?utm_source=pdf&utm_campaign=titlehttp://www.instructables.com/account/gopro?sourcea=inside_pdfhttp://www.instructables.com/?utm_source=pdf&utm_campaign=title
  • 8/8/2019 Build a Sunburn Alarm

    2/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    License: Public Domain Dedication (pd)

    Intro: Build a Sunburn AlarmEver get a sunburn? Prefer to avoid them in the future? Mr. Burns combines information about your skin type and any sunscreen you're wearing with a realtime UV lmeasurement to let you know before the burn sets it!

    Here's a little demo;

    Continue to the next page and I'll answer a few questions and show you how to make it

    step 1:FAQHow does it work?

    Sun exposure time is a factor of 3 things;

    Skin type. Lighter complexions burn more quickly1.Sunscreen. Suncreen extends exposure time2.Ultraviolet Radiation. UVA (315-400nm) is the main culprit, and it can vary widely throughout the day, geography, time of year, etc.3.

    Skin type and sunscreen are easy - Mr. Burns just asks you to provide that information. Measuring Ul traviolet radiation is complex;

    Initially, I went to the usual sources to get a UV sensor, but I found out they were very expensive ($20 - $30). If you take a regular LED and invert it (so the anode isconnected to ground), it will generate a very weak voltage in response to light, but you need an op-amp circuit to amplify the voltage & I wanted something simpler.

    Finally, I came across this whitepaper from Mitsubishi - they had the problem of sensing when to turn on the light in your remote control; a capacitive sensor would turon when it's not needed and waste power. They figured out a way to sense light using the backlight LED itself - and that's what Mr. Burns is based on.

    When you use an LED as a photodiode, it's sensitive to wavelengths equal to it's output color and shorter. By using a blue LED that generates light at 415nm, it's aperfect fit for sensing UVA, and it's cheap (

  • 8/8/2019 Build a Sunburn Alarm

    3/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    How Accurate is it?

    The sensor picks up the UVA and measures it correctly. Exposure calculations are based on WHO research, too. It's pretty accurate, the most likely cause of error issunscreen;

    Most people don't put on enough sunscreen - you're supposed to put on 1mg/cm2, which means about an ounce to cover an adult male. You're also supposed to re-apply every 2 hours. If you do this correctly, you're fine, but otherwise, you should under-estimate the SPF of your sunscreen.

    Also, Mr. Burns measures incident UVA at the beginning of the exposure, but it doesn't re-adjust if UV changes. The literature isn't clear as to whether your skin isequally sensitive throughout the exposure. It's easy to implement, though - and if I find evidence that it is, I'll update the code.

    What are the Technical Details?

    It's a Parallax Propeller running at 80Mhz connected to an HD44780 8x2 character LCD (4-bit interface). The Propeller stores the exposure table in RAM and measur

    incident UV through an R/C decay circuit.

    step 2:MaterialsI built mine with a Propeller Platform SD and an LCD UI module. If you've got those, then the only thing you'll need is blue LED and 22pF Cap. Download the file on s9 to your SD card, attach the LED & Cap, and you're ready to go.

    But I'll also show you how to build Mr. Burns on a breadboard - and here's what you'll need for that;

    Code

    Here's the sourcecode. Everything is available under the MITlicense.

    8x2 Character LCDDisplays the time. Sparkfun has a 16x2 LCD that will work, too

    3xAA battery boxMouser Part#12BH331/CS-GR

    Parallax PropellerAvailable at Parallax

    5Mhz CrystalAvailable at Parallax

    32.768 KHz CrystalMouser Part #73-XT262

    http://www.mouser.com/Search/Refine.aspx?Keyword=73-XT262http://www.parallax.com/http://www.parallax.com/http://www.mouser.com/ProductDetail/Eagle-Plastic-Devices/12BH331-CS-GR/?qs=S9JdzgtLf05MShRzsOwjHw%3d%3dhttp://www.sparkfun.com/commerce/product_info.php?products_id=255http://www.gadgetgangster.com/working_files/mrburns.zip
  • 8/8/2019 Build a Sunburn Alarm

    4/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    32kb EEPROMMouser Part #579-24LC256-I/P

    22pf Ceramic Cap

    Blue LEDMouser Part 859-LTL42UB6N

    5x Tactile SwitchesMouser Part #653-B3F-1000

    3.3v Voltage RegulatorMouser Part #511-LD1117V33

    Around 10 10k ohm Resistors

    4x 4.7k ohm Resistors

    3 or 4 .1uF Ceramic Caps

    3 47uF Electrolytic Caps

    A Prop Plug

    Breadboard and a bunch of hookup wire.

    step 3:Make it: SchematicFirst, review the schematic below to understand how everything is connected. The box on the left is the SD card slot, and the box on top is the Prop Plug. I'll walk throbreadboarding it, but the schematic is your best guide. Here's a hi-res version, the lo-res version is below.

    http://farm2.static.flickr.com/1314/4724773347_508c542ca7_o.pnghttp://www.parallax.com/Store/Microcontrollers/PropellerTools/tabid/143/ProductID/398/List/1/Default.aspx?SortField=ProductName,ProductNamehttp://www.mouser.com/Search/Refine.aspx?Keyword=511-LD1117V33http://www.mouser.com/ProductDetail/Omron/B3F-1000/?qs=lK7M36XCk6JQHckSc1xIsg%3d%3dhttp://www.mouser.com/Search/ProductDetail.aspx?qs=14HO7rLZPQtCvbx5CWrpBw%3d%3dhttp://www.mouser.com/Search/Refine.aspx?Keyword=579-24LC256-I%2fP
  • 8/8/2019 Build a Sunburn Alarm

    5/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    step 4:Make it: Power and PropellerAdd the voltage regulator and bypass caps as shown on the image below. Also, add the battery box, connecting the black wire to the negative rail, and the red wire toinput on the regulator.

    I've also added pull up resistors in the picture, that's for the EEPROM I'll add in the next step.

    step 5:Make it: TestingAdd the EEPROM, connecting Vdd and Vss. Also add a 4pin header as shown in the photo.

    Your basic Propeller setup is now complete. Plug your Prop Plug into the headers, connect the usb cable and fire up the Propeller Tool. Hit F7 and make sure you cancommunicate with the Prop

    step 6:Make it: Display and CrystalConnect the display - it's quite a few wires, so follow the schematic. Note that I'm using a protoboard to make the display hookup a bit easier. I suggest you do thesame.

    The crystal goes on the pins marked Xo and Xi . No need for caps on the crystal.

  • 8/8/2019 Build a Sunburn Alarm

    6/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    step 7:Make it: UI and Sensor

    Add the buttons, as shown on the schematic. You'll need 4 buttons;

    Left1.Right2.Enter3.Begin Exposure4.

    If you edit the code, you can get away with less, although it's nice to have the additional inputs. I've breadboarded 2 buttons below.

    Also add the LED and cap. This is your UV sensor portion of the circuit. The longer lead on the LED goes to the negative rail, the shorter lead connects to P7.

  • 8/8/2019 Build a Sunburn Alarm

    7/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    step 8:Make it: ProgrammingOnce you've got everything wired up, download the sourcecode (here), connect your Prop Plug and program the Propeller.

    step 9:Make it: Using the Propeller Platform SD and LCD UIIf you're using the Propeller Platform SD and LCD UI, setup is a little different;

    1 - The Propeller Platform SD is pre-assembled.

    2 - Follow this instructable to put together the LCD UI.

    3 - You don't need a Prop Plug. The Propeller Platform SDhas a bootloader, so you just unzip this file and copy to the root of your SDCard.

    4 - You'll need to add a blue LED and a 22pf Cap. You can get the Blue LED right here, the battery pack is here. The long lead from the LED goes to ground, the sholead goes through the hole marked P7. Connect the cap on the other side of the board to the same holes - doesn't matter which lead goes to which hole.

    That's it! Stay out of the sun!

    Related Instructables

    Muzak

    Visualizer by

    nmcclana

    Propeller

    Platform by

    nmcclanaPropellerPlatform Battery

    Pack by

    nmcclana

    PropellerPlatform (video)

    by nmcclanaThe single mosteffective way toget rid of a

    sunburn by

    drpepper8412

    The LCD UI

    Module by

    nmcclana

    El Jugador:Retro DIY Game

    Console by

    nmcclana

    Lycra Sun Mask

    / Hood by

    TimAnderson

    http://www.instructables.com/member/TimAnderson/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Lycra-Sun-Mask--Hood/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Lycra-Sun-Mask--Hood/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Lycra-Sun-Mask--Hood/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/El-Jugador-Retro-DIY-Game-Console/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/El-Jugador-Retro-DIY-Game-Console/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/El-Jugador-Retro-DIY-Game-Console/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/El-Jugador-Retro-DIY-Game-Console/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-LCD-UI-Module/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-LCD-UI-Module/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-LCD-UI-Module/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/drpepper8412/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-single-most-effective-way-to-get-rid-of-a-sunb/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-single-most-effective-way-to-get-rid-of-a-sunb/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-single-most-effective-way-to-get-rid-of-a-sunb/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-single-most-effective-way-to-get-rid-of-a-sunb/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/The-single-most-effective-way-to-get-rid-of-a-sunb/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-1/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-1/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-1/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-1/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-Battery-Pack/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-Battery-Pack/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-Battery-Pack/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform-Battery-Pack/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Propeller-Platform/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Muzak-Visualizer/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Muzak-Visualizer/?utm_source=pdf&utm_campaign=relatedhttp://www.instructables.com/id/Muzak-Visualizer/?utm_source=pdf&utm_campaign=relatedhttp://www.gadgetgangster.com/find-a-project/56.html?projectnum=328http://www.gadgetgangster.com/find-a-project/56.html?projectnum=320http://www.gadgetgangster.com/working_files/mrburns/run.binhttp://www.instructables.com/id/The-LCD-UI-Module/http://www.gadgetgangster.com/working_files/mrburns.zip
  • 8/8/2019 Build a Sunburn Alarm

    8/8

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/

    Advertisements

    Comments

    9 comments Add Comment

    teamcoltra says: Jun 25, 2010. 11:26 PM REPGive this to your daughter --- Repels sunburn -- AND first dates. :D

    Treknology says: Jun 24, 2010. 5:02 AM REP

    In Australia, I have my own sunburn alarm: IF Outside = 1 AND Visibility = 1 AND NaturalLi ht = 1 THEN AlarmState$ = "PANIC!"

    nmcclana says: Jun 24, 2010. 9:41 AM REPHa! I think in Australia it's safe to assume that UV is always at 10. But the challenge with UV is that the level can change independent of visible light. Foexample, UV penetrates cloud cover, so even if it looks cloudy and shady, you may still be getting a lot of UV.

    Treknology says: Jun 24, 2010. 12:10 PM REPCloudy = NaturalLight, IF Visibility = 1 AND NaturalLight = 0 THEN Time = "Night" That means it's safe to spread one's wings and go for a night fligin search of food.

    Redgerr says: Jun 25, 2010. 7:58 AM REPunless you et eaten by some other creature... then Alive = 0 and Game = over :c

    Backyard Builder says: Jun 24, 2010. 6:12 PM REPThey make beads that change from clear to a certain color when you need to put on sunscreen to avoid sunburn I'm not sure what they are called but I'msure they would be cheaper, waterproof, and l ighter. But your idea is t ruely genius

    Redgerr says: Jun 25, 2010. 7:56 AM REPor you can stay inside all the time ;) but great 'ible

    bowmaster says: Jun 24, 2010. 9:28 AM REPThis is nice. I may make a waterproof one for the pool.

    Patman27 says:Jun 23, 2010. 4:30 PM REP

    Now, only to mount it into a hat, or hell, maybe even an integrated HUD/mini LCD for sunglasses! (???)

    http://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/Patman27/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/Patman27/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/bowmaster/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/bowmaster/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/Redgerr/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/Redgerr/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/Backyard+Builder/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/Backyard+Builder/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/Redgerr/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/Redgerr/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/Treknology/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/Treknology/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/nmcclana/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/Treknology/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/Treknology/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#DISCUSShttp://www.instructables.com/member/teamcoltra/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/member/teamcoltra/?utm_source=pdf&utm_campaign=commentshttp://www.instructables.com/id/Build-a-Sunburn-Alarm/?utm_source=pdf&utm_campaign=comments#comments