Ask MAKEArchive: Ask MAKE

November 5, 2009

Ask MAKE: Image sensors: CCD vs CMOS


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

image_sensor.jpg

Ian writes in:

I was looking at buying a digital camera, and read that there are two kinds of sensors that they can use to take a picture- CMOS and CCD. Can you tell me what the difference is, and if one is better to get?

Sure! It's actually a pretty topical question, as the inventors of the CCD just won this year's Nobel Prize! As you mentioned, there are two basic kinds of image sensor that are used in today's digital cameras, CCD (charge-coupled device) and CMOS (complementary metal oxide semiconductor). They both work by converting light energy (photons) into electric charge (electrons), and the difference is in how this charge is read out.

To start, both kinds of sensor are made of a grid of 'buckets' placed evenly across a flat semiconductor surface. Each bucket acts as an individual sensor, which only sees a tiny portion of the image. By displaying a bunch of these tiny points in a grid (using a computer monitor or printer), we see the image.

Making color images is a bit more complicated. Because the buckets are sensitive to any wavelength of visible light, if we just looked at the results we would see a monochrome image. To get color information, we arrange the sensors into groups of four, and place tiny red, green, and blue color filters over them. Each group of four sensors is what we call a pixel, and it is interesting to note that modern cameras have millions of them.

Ok, so both CCD and CMOS sensors are basically just big arrays of individual sensors, so how are they different? The difference is in how the charges are collected and read out. In a CCD, the 'bucket' that collects charge is just a capacitor. To read the image data out of the CCD, the charge in each bucket is pumped individually over to an ADC (analog to digital converter), which actually measures charge. In a CMOS sensor, each bucket contains a photodiode and some amplifier circuitry. To read the image data out, the output of each amplifier is connected to an ADC through a multiplexer, which measures the voltage at each cell.

I don't think that either technology is necessarily better, but each has its own quirks. There is an interesting site at dvxuser which talks about the different kinds of sensor artifacts associated with each kind of sensor. For most cases, though, I think that other specifications, such as ease of use and sensitivity to light, are probably more important to think about when choosing a digital camera. Good luck!

[photo by SarahCartwright]

Posted by Matt Mets | Nov 5, 2009 10:30 AM
Ask MAKE | Permalink | Comments (4) | Email Entry | Suggest a Site

October 29, 2009

Ask MAKE: Playing back a recorded sound


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

singing_scope.jpg

George writes in:

I've been wanting to make a prank project, that I can leave somewhere to play back a recorded sound and flash some lights. I'll use LEDs for the lights, but don't know how to play back sound. Do you have any suggestions?

Aha, this sounds like it could be a fun project. I'm going to assume you are using a microcontroller to monitor an input (sound? light? time? vibration?), and then initiate a sequenced event. It's a bit late for Halloween, but this would be a good way to make lawn props that react when someone comes near your house.

Because playing back sound takes a reasonable amount of memory and speed, it's not something that can be done easily with a standard microcontroller. Instead, the best way to handle this would be to hook up another device, that can be started by the micro and then do the heavy lifting of actually playing back a sound. At least three possibilities come to mind: using a Wave Shield, hacking an MP3 player, or hacking a cheap toy with a sound recorder.

If you are using an Arduino, the Wave Shield might be an ideal solution to your problem. It is an expansion module that allows you to play sounds off of an SD card, and there is a nice library to control it as well. It runs in at about $22 bucks, which seems pretty reasonable for what you get.

If you aren't using an Arduino, or already have an old MP3 player and don't want to spend the bucks on a project you will only use once, then you can try to use that. The best way to do this is probably to wire an optocoupler to the play button on the MP3 player, and then trigger that with your microcontroller. If you have more than one sound track that you want to trigger, you could also wire up the next button, but that might get tricky. The bonus for going this way is that you could recycle some electronics junk that would otherwise go to the scrap heap.

Either of the two above solutions are great if you are only thinking of making one or two of the devices, but what if you want to make a bunch of them? In that case, it might be more economical to try hacking a cheap toy, such as this one. Somehow these are still available, and are less than $2 in quantity. The sound quality probably won't be anywhere as good, but hey, the're cheap! If you are in a rush, you could also try hacking a voice recording card that you can pick up at a local store. Good luck!

In the Maker Shed:

Makershedsmall

waveshield_crop_cc.jpg

Arduino WaveShield Kit

Posted by Matt Mets | Oct 29, 2009 10:00 AM
Ask MAKE | Permalink | Comments (6) | Email Entry | Suggest a Site

October 22, 2009

Ask MAKE: Debouncing a switch


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

debounce_switches.jpg

Jen writes in:

I'm making a circuit to blink an LED at different speeds, that I can control using a button switch. It wouldn't work until I added added some 'debounce' code. What does that mean, and why did I have to add it?

Good Question! Switch bounce is one of those rare electronic effects that is actually caused by a mechanical shortcoming. The issue is in the way the switch works. When you flip a switch (or press down on a button), you're really pushing one piece of metal against another. If this happens with sufficient force, one or both of the pieces will deform slightly, and then bounce back in the other direction. Depending on how well the switch was designed, this could go on for a number of times before both pieces stop moving. Now, all of this bouncing means that from an electrical perspective, the switch looks like it is opening and closing rapidly until the bouncing dies down. It happens very quickly, however digital electronics are fast enough to see this as a bunch of switch presses!

There are three ways to deal with this: mechanically (building a better switch), electrically (building a filter out of discrete electric components), or digitally (with software).

In your question, you mentioned that you used some debounce code, which is probably the best solution for you. For this solution, you write a software routine that runs when someone presses a button, then waits for a short time (long enough for the bouncing to have stopped) before reading the switch state. This effectively ignores any spurious signals from the switch contacts bouncing without any extra hardware. If you happen to be using the Arduino platform, try this tutorial.

If you aren't using a microcontroller, though, software isn't going to help, and you will have to try one of the other solutions. The traditional way to handle switch bounce on a breadboard is to use a resistor-capacitor (RC) filter in a low pass configuration. What this does is prevent the output of the switch from going high too quickly, which effectively filters out any high-speed signals. Check out this tutorial if you'd like to try out this method.

So, how could you re-design the switch to prevent bounce? It turns out that the most common thing to do is to wet the contacts with mercury. Because mercury is a liquid at room temperature, its surface tension keeps the contacts connected even when they bounce. The only issue with this is that mercury is pretty toxic, so you should only use this if you absolutely need to, such as when you're controlling high-power machines at fast speeds.

[photo by Flickr user russ_j_taylor]

Posted by Matt Mets | Oct 22, 2009 10:00 AM
Ask MAKE | Permalink | Comments (7) | Email Entry | Suggest a Site

October 15, 2009

Ask MAKE: Using an optocoupler


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

ask_make_optocoupler_header.jpg

Matt writes in:

We are working on a project to control a CW ham radio keyer using a computer, and are concerned about protecting the computer from the radio. We heard that an opto-isolator could be used for this, but aren't sure how to go about it.

Good question! An opto-coupler is a device that can be used to electrically isolate two circuits, so that a voltage spike or other problem on one side will not destroy the circuit on the other side. A common use for them is when you want to interface a computer to an AC-powered device, such as a light or a motor. Usually, the opto-coupler will not be used to control the device directly, and instead will just transfer a signal from one circuit to another.

optocoupler_diagram.jpg

So, how does it work? You can think of an optocoupler as a combination of an LED and a phototransistor. To send a signal, the transmitting side power the internal LED, just as you would power a regular LED. This lights up and causes the phototransistor on the other to start conducting current. You can think of it as kind of a switch at this point, and use it to turn on a low-power device directly, or turn on a relay to turn on a higher-powered device. The above circuit diagram should work for an automatic keyer. Choose the resistor based on your microcontroller voltage and the current draw of the optocoupler chip that you use. One thing to remember is that the output is polarized, so you have to make sure to connect it up so that the high voltage side is on the collector, and the low voltage side on the emitter. Good luck with your keyer!

Posted by Matt Mets | Oct 15, 2009 10:00 AM
Ask MAKE | Permalink | Comments (2) | Email Entry | Suggest a Site

October 8, 2009

Ask MAKE: Getting started with physical computing


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

led_header.jpg

John writes in:

I am an artist in Santa Fe, NM. Much of my work is assemblage using old salvaged electronic equipment. I would like to start using interactive electronics. I have some electronics knowledge but am a newbie with microcontrollers, etc. I would like to know what is the best way to get started in this area of physical, interactive microcontrollers. Can some one point me in the right direction?

Sure thing! For your first time, I recommend getting a kit that is specifically designed to get you up and going with physical computing. We sell some nice Arduino-based kits in the Maker Shed -- take a look at the Getting Started with Arduino Kit and Advanced Arduino Starter Kit. These bundles are useful because they include enough instructions and parts to give you a good feel for what you can accomplish. Another good way to go might be with a BASIC stamp -- they seem to have been eclipsed in popularity by Arduino lately, but are still very capable systems.

If you would like to get some hands-on instruction, try looking for a local group that has microcontroller classes. We covered how to find them a while back.

Finally, if you want to read up a bit first, there are bunch of good books on the subject. Here are a few: Physical Computing: Sensing and Controlling the Physical World with Computers, Making Things Talk, and Getting Started with Arduino.

Got a great resource that I overlooked? Abhor Arduinos and have a better suggestion? Sound off in the comments!

Posted by Matt Mets | Oct 8, 2009 01:00 PM
Ask MAKE | Permalink | Comments (11) | Email Entry | Suggest a Site

October 3, 2009

The Mummy's "Book of The Dead" prop

book_of_the_dead.JPG

We recently had a question from a reader about this prop. "Connie" wrote in wanting to know how to replicate the mechanism that, in the movie, is used to unlock The Book's cover. Never having seen The Mummy, I went into research mode and enqueued it from Netflix. Then I watched it. Big mistake.

But, you know, to each his or her own. And "The Book of the Dead," with its ornate clasps and intricate star-shaped key, is admittedly an awesome prop. The scene Connie is referring to, I believe, occurs at almost exactly one hour into the "Deluxe Edition" cut of the film, and shows the intrepid but remarkably foolish archeologists inserting the aforementioned star-shaped key into a correspondingly star-shaped opening in the book's cover, turning it, and thereby releasing the spring-loaded cover clasps and, with them, all manner of unpleasant whatnot.

So I started Googling around, looking for dweebs enthusiasts that might have already built such a thing. And while I did not find any working mechanical replicas of the prop, I did discover the remarkably beautiful static replica shown in the photo at the top of this post by Jeff Stelter of Stelter Creative Woodworks.

I also found this video by YouTuber oneandonlyJadedMonk showing his working mechanical replica of the star-shaped key used to open the book. Connie, if you're looking for a real expert, I think this might be the man to talk to.

But as for completely working cover locks, I'm afraid I have to admit defeat. Having watched the scene a few times, I'm completely confident that a suitable lockwork could be designed and built, but actually doing either is well above my pay grade. But something I've learned writing for this blog is what an incredible resource the MAKE readership can be, and so I'm going to throw the question out to them.

How 'bout it, folks? Anybody know how this thing works? Or know of somebody's who has built one? Or, even better, know anything about the original prop?

Make: Halloween Contest 2009

Microchip Technology Inc. and MAKE have teamed up to present to you the Make: Halloween Contest 2009! Show us your embedded microcontroller Halloween projects and you could be chosen as a winner.

Posted by Sean Michael Ragan | Oct 3, 2009 06:00 AM
Ask MAKE, Halloween, How it's made, Remake | Permalink | Comments (8) | Email Entry | Suggest a Site

October 1, 2009

Ask MAKE: Kid-powered battery charger


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

hand_crank_ipod.jpg

Phil writes in with an interesting question:

When I found out about this neat Ubuntu tablet that is powered by AA batteries, I started wondering if it's possible to recharge those batteries using the musclepower of kids.

Sure, it's easy enough for adult muscle power to generate some electricity, but could there be some ways for kids' musclepower to be harnessed (gently) to recharge AA batteries?

What kind of not-very-tiring machines could be devised that could store mechanical energy in such a way that the energy could later be released more quickly to recharge AA batteries via a cordless power drill running in reverse?

Of all the possible machines that could be set up (pulley systems, water pumps, hydraulic lifts), which would be the simplest, least costly and least dangerous to set up? Are there any kinds of contraptions that could be created so that even a five year old could be involved in creating electricity to recharge AA batteries?

While this would be a potentially fun tool for families to use here in the United States, this could be a vital energy production/computing/education tool for families where there is no existing electrical infrastructure.

The idea of storing up a bunch of mechanical energy in order to power a high-torque generator is a good start, but I don't think it is the right way to go. Instead, it would probably be better to skip the cordless drill, and use something designed to be a crank generator. Most rechargeable batteries can be trickle charged, or charged slowly, so it is probably better to design a hand crank that is easy to turn, and just puts out lower current. Of course, the the trade-off is that it will take longer to charge the batteries. I would start with this design for an ipod charger.

Another alternative might be to make a kid-sized pedal-powered generator, and use that to charge the batteries. David Butcher made one that looks really nice, and sells plans from his website.

Anyone have other ideas about how to harness kid power to charge batteries? How about a giant hamster wheel?

Posted by Matt Mets | Oct 1, 2009 05:20 PM
Ask MAKE | Permalink | Comments (10) | Email Entry | Suggest a Site

September 24, 2009

Ask MAKE: Get your project featured on Make


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

Dsc06844

Carl writes in with a good question:

I make cool projects (I think so anyway), and I would really like them to be on Make. What do I need to do?

We occasionally receive really cool projects that we would like to publish, however they just don't have quite enough information for us to figure them out. So, here are some tips about documenting your projects in a way that makes them accessible.

The first step is to document your project during your build. The final product is what most people will see, however the build process can be equally interesting. I learn a lot from looking at the tools and techniques others use to construct their projects, and suspect many other makers do as well. Take some photos, comment some code, record some sound- whatever is appropriate for your project. For extra points, making a timelapse of your construction can be really fun to watch. The important thing is to keep the documenting process simple so that you don't get bogged down with it and forget to finish your project.

Once you have all of your cool documentation, you probably want to put it on the web somewhere. A great way to go is with Instructables, which is a site dedicated to hosting DIY projects. Another option is to use a more traditional blogging site. My favorite is WordPress, however Blogger is also a good alternative. If you have constructed your own website, that is great too, just make sure that each project has its own page. This is important, because it creates a permanent link to your project, making it possible for us to link to.

If you have taken video of your project, then by all means upload it to a free video hosting service. This allows us to embed your video in a post, which will greatly increase the chance that people will watch it. Again, there are a number of free services that you can use; Youtube and Vimeo are popular options.

The final step is to submit it to us! We have a nice tip line, try it out and don't be afraid to promote yourself!

Posted by Matt Mets | Sep 24, 2009 10:00 AM
Ask MAKE | Permalink | Comments (0) | Email Entry | Suggest a Site

September 17, 2009

Ask MAKE: Why do flourescent lights buzz?


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.comor drop us a line on Twitter. We can't wait to tackle your conundrums!

flourescent_light.jpg

A few weeks ago, we looked at why dimmer switches cause incandescent light bulbs to buzz. We subsequently received a number of questions about why flourescent bulbs vibrate, such as this comment by snarkyFish:

It might be nice to have another one of these that explains why fluorescent lights / ballasts hum and buzz as well. I imagine it's a very similar explanation, but a much more complicated fix.

You are right, they do buzz for a similar reason, which is the mechanical components being vibrated by electromagnetic waves. In this case, however, it is probably not the bulb itself that buzzes, but the ballast.

Fluorescent bulbs are made up of a glass tube that is filled with a low-pressure inert gas and a small amount of mercury, have a phosphor coating on the inside, and have an electrode on each end. When a large enough voltage is applied across the electrodes, the gas begins to conduct, which allows an electric current to flow from one electrode to the other. This current causes collisions between gas molecules and the mercury, which creates UV energy that is then converted to visible light by the phosphor coating on the tube.

This is all well and good, however as the gas heats up, it's resistance goes down, which means that it becomes a better conductor and subsequently draws even more current. If this were left unchecked, the bulb would quickly heat up and self destruct, so a ballast is placed in series with the bulb to limit the current draw. There are a number of different kinds of ballast design, but the simplest one is to just use an inductor. An inductor will certainly limit the rate at which current can travel to the light, however it does so by absorbing magnetic fields into it's core. This absorption, which causes magnetostriction, is probably the source of your hum- it literally causes the inductor to expand and contract at twice the AC frequency, which creates an audible sound wave (at 120Hz in the US or 100Hz in most of Europe).

I don't think there is a safe way to fix this besides getting a new ballast. Newer ballasts use an electronic controller instead of an inductor for the ballast, so they shouldn't be susceptible to the same buzzing problem. Making your own is certainly a possibility, but as with any high-voltage project, you better know what you are doing first.

Any other tips for how to fix a buzzing fluorescent light? Let us know in the comments!

[CC licensed photo by adotjdotsmith]

Posted by Matt Mets | Sep 17, 2009 10:00 AM
Ask MAKE | Permalink | Comments (12) | Email Entry | Suggest a Site

September 10, 2009

Ask MAKE: Simple proximity sensors


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

Aaron writes in with a question about short-range sensors:

My question is really more of a search for direction. I have exhausted several approaches and could use advice. The goal is to create several simple, cheap sensors that have only the ability to sense that there is another one of them next to eachother. I need a range around 5 feet. It would need to have an id. For instance sensor 1 could see sensor 2 and 3 within 5 feet but no other and sensor 2 could see sensor 1 and 4, and so on.
I have considered rfid most intensly, but I find noise and cost go up at this range and I have had issues with consistancy. Laser requires line of site not be interrupted, blue tooth has too great a range, and so on.

Interesting question! I've actually been thinking about this for a project as well. There are three types of signal that I can imagine using for this application: RF, audio, and optical. Because you mention that maintaining line-of-sight is an issue, let's stick to a radio based solution. To make things simple, lets assume that each node is identical. Then, we need a protocol for each node to take turns transmitting their IDs to the other nodes. We also need to figure out how far away the transmitting node is, which we can estimate using the received signal strength if we make each node transmit at the same power. This is possible because radio waves follow the inverse square law.

Now, there are many different ways to build a radio system to do this, however a nice off-the-shelf part that will work is the xBee. Each node would then consist of a microcontroller (whichever you fancy) and an xBee radio. Program them so that they transmit their own ID at random intervals, and spend the rest of the time listening for other radio's IDs. Measure the signal strength of the received ID using the RSSI indicator, and if it is above a certain value (determine experimentally), then add the ID and time of reception to a list. If the same ID is received again, update that entry with the latest time a signal was received. Then, go through the list periodically, and remove any ID that hasn't been heard from in a while (longer than the longest time between random transmissions). This way, you will always have a list of devices that are nearby. By having them transmit their IDs at random intervals, you will minimize the chance that two transmit at the same time without having to deal with synchronization issues.

That's the easiest way I can think of to do this, however it is still pretty complex. Have a better solution? Sound off in the comments!

Posted by Matt Mets | Sep 10, 2009 05:00 PM
Ask MAKE | Permalink | Comments (9) | Email Entry | Suggest a Site

September 3, 2009

Ask MAKE: Where to find an Arduino class?


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to mattm@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

hack_pittsburgh_arduino.jpg

Bruce writes in:

Do you know of any Arduino efforts in San Diego, CA? Do you know of anyone who might know?

Well Bruce, I understand how difficult it can be to find local DIY events, so I compiled a list of the places I would look. The first thing I would do is search google, however there is a good chance that local events might not show up if they haven't been widely publicized. The next places I would check are Hackerspaces and Dorkbot. If there is a hackerspace in your area, there is a good chance that they will be holding classes about the Arduino or similar devices. Dorkbot groups seem to be more focused on presentations, however the participants can probably help point you in the right direction.

Another great possibility is a Make: group. There are a bunch of them popping up across the country (and hopefully across the world- let us know where you are!). Here are the ones that I know about:

Besides the more obvious tech-focused groups, many artists organizations and collaboratives are also hosting Arduino classes, such as The Steel Yard in Providence, RI, Machine Project in Los Angeles, CA, and The Crucible in Berkeley, CA.

However, don't give up if you don't see anything listed for your city. Try asking around at a local college, check http://www.meetup.com/, chime in on the Make forum, take a glance at the official Arduino calender and the Make Events page, or just find some friends and host an event yourself, and be sure to tell us about it!

Know of any other good resources? Have any San Diego leads for Bruce? Want to see your group listed? Chime in in the comments!

The above photo of an Arduino class at Hack Pittsburgh is by Marty McGuire.

Posted by Matt Mets | Sep 3, 2009 11:18 AM
Ask MAKE, Events | Permalink | Comments (9) | Email Entry | Suggest a Site

August 27, 2009

Ask MAKE: Back to school bike light

AskMake_Jameco.gif

Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!


This week's question comes from back-to-college student Andrew:

My class schedule this semester has me riding home at night, so I need some safety lights. The lights at the bike store are not only expensive, but unattractive. How can I make them myself?

I can't imagine a better combination than bikes and LEDs. You could build your bike light from scratch, or you could hack a dollar-store gadget to blink a few LEDs. We have lots of bike light projects here on MAKE to get you started. Be sure to keep an eye on our bicycle archives for the latest bike projects, too!

Battery-powered lights:

Blinky lights! Use a 555 timer chip to make your rear light blink:

Alternative energy bike lights:


Style points:

Show us your bike lights! Post up a link to your styling safety lights in the comments.

This week's Ask MAKE has been sponsored by Jameco Electronics.

Posted by Becky Stern | Aug 27, 2009 11:00 AM
Ask MAKE, Bicycles | Permalink | Comments (2) | Email Entry | Suggest a Site

August 20, 2009

Ask MAKE: Why do lights buzz?

AskMake_Jameco.gif

Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!


askmakebulbs.png

Martin writes in:

Why do my incandescent light bulbs buzz when I'm using a dimmer switch? What can I do to stop it?

Household lights run on alternating current (AC), which can be seen as a sine wave on an oscilloscope. To decrease the brightness of the bulb, a dimmer switch takes chunks out of the sine wave. This essentially turns the bulb on and off around 120 times every second, depending on the dimmer swtting. Charging the bulb filament creates an electromagnetic field, and when this field is turned on and off so rapidly, the changing force can cause the filament to start vibrating in sync with the frequency of the ons and offs.

To stop the buzzing, you can try rough service light bulbs, which have the filament anchored in more than two places, unlike regular light bulbs. Think of the filament supports as legs on a table. Two legs would make for a wobbly table, but make that three or four legs, and you've got something more sturdy.

If it's your dimmer that buzzes instead of your light bulbs, you may need a dimmer rated for a higher capacity. Try removing some of the light bulbs connected to the dimmer and see if it makes a difference. If the buzzing is quieter, you may need a stronger dimmer. Common triac-based dimmers are controlling the chopping up of that AC wave, and can also vibrate because of it. Some higher quality dimmers have filters in them to prevent that.

Some more reading on the subject:

Have you had to fix a noisy light problem in your house? Share with us in the comments.

This week's Ask MAKE has been sponsored by Jameco Electronics.

Posted by Becky Stern | Aug 20, 2009 09:00 PM
Ask MAKE | Permalink | Comments (8) | Email Entry | Suggest a Site

August 13, 2009

Ask MAKE: Voltage divider

AskMake_Jameco.gif

Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

Resistive_divider.png

Louis writes:

I've seen the term "voltage divider" used a lot lately. What exactly is a voltage divider, and what is it used for?

A voltage divider does what it sounds like: it creates an output voltage less than the input voltage. A potentiometer can be used as a voltage divider, as can two resistors in series. It's often used as a reference voltage, where little current is drawn over the connection. Op-amps use reference voltages to change signal output, so you can use a pot as a voltage divider to change attributes of sound in a synthesizer, for example. The op-amp outputs current that is proportional to the difference in voltage between it's two inputs, so the resistor divider is used to make the output voltage a multiple of the input voltage- basically a resistor divider in reverse.

Many sensors respond to their respective input by producing a corresponding change in resistance. For instance, a light sensor might have a high resistance when it's bright out, and a low resistance in darkness. Sensors can be used in one of the positions pictured above (R1 or R2; the diagram is a resistive voltage divider) to invert the output. For example, a light-sensitive resistor (LDR) in a voltage divider could be changed from its normal high-when-light state to high-when-dark. Sure, you could invert that output in software, too, but what if you're not using a programmable microcontroller? With just an extra resistor, you've inverted the sensor's function.

Here's some more reading material on voltage dividers:

Where do you use voltage dividers? Post up your experiences in the comments.

This week's Ask MAKE has been sponsored by Jameco Electronics.

Posted by Becky Stern | Aug 13, 2009 09:00 PM
Ask MAKE, Electronics | Permalink | Comments (1) | Email Entry | Suggest a Site

August 6, 2009

Ask MAKE: LED as light sensor

AskMake_CoBrand_Jameco_f1.gif

Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

ledtouch_photo.jpg

This week's question comes from Kevin:

I heard that you can use an LED as a light sensor. How?

LEDs are diodes tuned specifically to emit light and packaged in translucent enclosures. A photodiode is essentially the same thing, but sensitive to a wider range of light wavelengths. From the very informative Wikipedia page on the subject:

For example, a green LED will be sensitive to blue light and to some green light, but not to yellow or red light. Additionally, the LED can be multiplexed in such a circuit, such that it can be used for both light emission and sensing at different times. In Dietz et al., a scheme for implementing this multiplexing is presented:

  • A LED is connected to two bidirectional CMOS I/O pins on a microcontroller (or a microprocessor with an I/O bus).
  • To emit light, both of the I/O pins are set to output mode, and the LED is driven with current in the forward direction, resulting in current through the LED and emission of light.
  • To detect ambient light:
    • The I/O pins are set to output mode, and the diode is driven in the reverse-bias direction, such that the diode inhibits the current and the LED's inherent capacitor is charged.
    • The I/O pins are set to high-impedance CMOS input mode.
    • The diode leaks current at a rate proportional to the incident light, as incident photons cause electrons to leap across the band gap.
    • The time it takes for this leakage current to discharge the LED's inherent capacitor is measured and is inversely proportional to the incident light.

Don't be intimidated by the electronics terms above, it's actually pretty simple. Arduino has an example on their site showing a LED connected from one digital pin to another through a 100 ohm resistor. Part of the code tells the LED to light up, and part of it reverses the current and tells the former power pin to read the current leakage of the diode, which will change relative to the amount of ambient light in the room.

Here's a short video showing a grid of red LEDs being used also as photodiodes (also photo above). Provolot tried it out, too, with success (and source code). Forest M. Mims III uses this technique to sense specific wavelengths of light for sun research in Hawaii.

Have you worked with LEDs as photodiodes? Share your project, video, or tips with us in the comments!

This week's Ask MAKE has been sponsored by Jameco Electronics.

Posted by Becky Stern | Aug 6, 2009 09:00 PM
Ask MAKE, Electronics | Permalink | Comments (10) | Email Entry | Suggest a Site

July 30, 2009

Ask MAKE: EPS foam


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

Dan writes in:

How are big closed cell polystyrene bocks made? I've seen them 12" square and about 8' long.

Expanded polystyrene foam (EPS or Styrofoam) is made from pellets of polystyrene, which is a plastic made from crude oil. The pellets are expanded in a steam chamber. You can find these pellets in this form inside most beanbag chairs. To make solid objects, they use steam molds that fill a chamber with the pellets, then steam fuse them into custom packaging, foam drinking cups, etc. Here are a few videos I found on the topic; one's on Planet Green, the other one is a segment on Discovery's How It's Made:

Polystyrene is lightweight and good for protecting valuables in shipping, among other things, but it's not biodegradable. It can, however be recycled. I found a video on Planet Green where they turn styrofoam packaging into moulding for your house. Neat! Also, don't forget to check out the Wikipedia page on polystyrene foam.

More:

Posted by Becky Stern | Jul 30, 2009 09:00 PM
Ask MAKE, How it's made | Permalink | Comments (0) | Email Entry | Suggest a Site

July 16, 2009

Ask MAKE: TV as computer monitor


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

rcaplugsintotv.jpg

Mike writes in:

I'm writing to see if you can help me hook up my old TV to view on it, what I see on my computer monitor. The TV only has RCA jacks on it. The guy at best buy said a cable to do this directly wasn't made, but a could buy a new $300 TV that had the right plug in. Please help if you can, building things isn't a problem for me, but electronics, I've never understood, so, I guess I'm asking for directions to build such a cable.

As it turns out, there is such a cable, it's just not very common. Depending on your video type coming out of your computer, you'll need a different cable. I'm guessing your machine has a VGA port (usually blue with a trapezoidal shaped plug), so you'll want to look for a VGA to RCA converter. It usually comes bundled with an s-video plug on it, too. It should be noted that most of these cables require your graphics card to have a "TV out" function, which means it just adapts the connections (one wire to another wire), but does not convert the signal. You can usually tell the difference by the price and size. If it's super cheap and just looks like the different connectors with a bit of wire in between them, it's just an adaptor. If it's more expensive (usually between 20 and 50 dollars) and has a bit more heft to the hardware, it's probably a converter.

Some computers already have s-video ports on them, and if you do you could go straight for an s-video to RCA adapter. Apple computers have all kinds of shapes and sizes in video ports, but they make an adapter to RCA for all of them. If your computer only has a DVI port, look for a DVI to RCA adapter.

TVs usually aren't great for use as computer monitors if you're just browsing the web or doing other text-heavy stuff, but they can be great for watching movies, playing games. or including TVs in art installations or other display settings.

If you're looking to get sound into the TV as well, you'll need another cable in addition to your video adapter. This adapter is way more common and can be found by asking for or looking up a 1/8 inch (3.5mm) to RCA adapter. They come in all different combinations of male/female and stereo/mono, so pick whichever one fits your situation (probably male-male stereo to left and right channels).

I used to work in a computer lab organizing equipment and checking out cables and adapters to folks, and I learned a lot about the different ways things can be connected together. If there's one thing I remember the most, it's that you should come to a connection/adapter problem knowing what all the different ports are that you want to connect. The guy at the big box store might not know if there's an adapter to suit your needs, but the internet sure will, it just needs to be fed the right terms. Here's an excellent page describing common video connectors. Best of luck with your endeavor!

Image above is used under a creative commons by-sa-nc license and is by Lionel Fernández Roca on Flickr.

Posted by Becky Stern | Jul 16, 2009 09:00 PM
Ask MAKE, Electronics, Home Entertainment | Permalink | Comments (4) | Email Entry | Suggest a Site

July 9, 2009

Ask MAKE: Pull-up resistor


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

arduino_switch_ledspulldown.jpg

So what's a pull-up (or pull-down) resistor, anyway? Well, it's used when you're reading an input voltage from some kind of sensor as a "default" value. Say you're using a pushbutton with your Arduino and want to know when the pushbutton is depressed, so you connect the digital pin to ground through the button. When the button is depressed, ground is connected to the pin. But when the button is not connected, the Arduino is looking at the signal connected to that pin, which is "floating," and therefore subject to interference and static, things that are probably not desirable in a deliberately triggered system. You need a way to keep the signal consistent, like connecting the pin to power, unless the button is depressed. Since you shouldn't connect power directly to ground, you need a load in there to prevent a short, so you use a resistor. The Arduino pin will still read 5V even when connected to a 10K-ohm resistor, but when the button is depressed it will read the connection to ground. This is a pull-up resistor. I can remember it because I think of the pin being "pulled" up to power. If you had the circuit wired the other way around, with the pin connected to power through the pushbutton and using a resistor connecting the other side of the pushbutton to ground, this is called a pull-down resistor.

There are lots of great tutorials online for implementing simple circuits with pull-up or pull-down resistors:

Posted by Becky Stern | Jul 9, 2009 10:41 PM
Ask MAKE, Electronics | Permalink | Comments (2) | Email Entry | Suggest a Site

July 2, 2009

Ask MAKE: Kids' sprinklers and the CPSIA


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!


Bill writes in:

Last year I built a Kid Wash and my kids have loved playing in it. We brought it out again yesterday with the great weather we had over the weekend and my son (age 12) came up with the idea of earning money over the summer by building and selling them locally. It's an easy enough project that I figure he can handle it and it is popular enough with the neighborhood children that he could also have some success in selling it.

However, the new CPSIA regulations have me worried that such a project (however small) will never get off the ground or we'll just be setting ourselves up for legal problems down the road. How do makers who build and sell toys deal with such regulations? Obviously if he was trying to make and sell something hazardous I wouldn't allow it, but how do we encourage such entrepreneurship without exposing ourselves to liabilities.

There was a huge outcry over the CPSIA regulations when they were announced because of their lack of consideration of the costs they would impose on small manufacturers, especially handmakers of one-of-a-kind toys and clothes. The CPSC voted to impose a stay of one year for testing and certification requirements, which expires February 10, 2010. These folks clearly realized there needs to be more thought put into the wide-sweeping rules that would devastate many small businesses. So you still aren't allowed to sell toys with lead paint, small choking-sized parts, etc., but you don't have to have your KidWash tested by a third party for lead and phthalates before selling them to your neighbors. Not until next year, at least.

Posted by Becky Stern | Jul 2, 2009 09:00 PM
Ask MAKE | Permalink | Comments (0) | Email Entry | Suggest a Site

June 25, 2009

Ask MAKE: Crawl space camera


Ask MAKE is a weekly column where we answer reader questions, like yours. Write them in to becky@makezine.com or drop us a line on Twitter. We can't wait to tackle your conundrums!

Henry writes in:

There are several ducts and wall spaces I would like to be able to look in. They sell pipe inspection cameras but these are expensive because they are based on fiberoptics. I think an inexpensive video camera and a few LEDs would give you the length of a USB cable and the image could be captured on a laptop. Has anyone made such a thing?

Well, I haven't seen this particular setup DIYed for such a purpose, but I'm sure you could rig up something quite easily. They even make wireless spy cameras small enough to do the job you're talking about. A piece of flexible conduit would work nicely, as you could run the wires for the LEDs down to the handle, but a wooden rod would do the job. Just wire up your LEDs/battery circuit with the battery and switch at the handler's end of the operation, and surround the camera with the LEDs at the business end of the contraption (3 white LEDs wired in series with a 9V battery should do the trick).

When I was a kid, my parents took on a home remodeling project that ended up exposing the long-hidden colony of carpenter ants in the wall above the old sliding glass door. If they had one of these things, it probably would never have rained ants all over my dad! If you find anything cool in there, let us know! Here are some projects to get you started:

RC boat with cheap wireless video

From the pages of MAKE, Vol. 14 (Optics):

vol14_buggie.png
Living Room Baja Buggies by John Mouton. With wireless cameras on board, these radio-controlled racers give you virtual reality telepresence; Living Room Baja Buggies in the Digital Edition.

spy_14.jpg
Covert Spy Sunglasses by Kip Kedersha. Record what you see and hear with these low-cost stealthy sunglasses; Covert Spy Sunglasses in the Digital Edition.

Posted by Becky Stern | Jun 25, 2009 09:00 PM
Ask MAKE | Permalink | Comments (0) | Email Entry | Suggest a Site

Void your warranty, violate a user agreement, fry a circuit, blow a fuse, poke an eye out. Make: The risk-takers, the doers, the makers of things... Welcome to Make: Online!


CRAFT Maker Shed Maker Faire MAKE television
MAKE: en Español MAKE: Japan


Check out all of the episodes of Make: television

Make: Science Room

Connect with MAKE

Be a MAKE fan on Facebook MAKE on Facebook
Visit our Facebook page and become a fan of MAKE!
MAKE on Twitter MAKE on Twitter
Follow our MAKE tweets!
MAKE Flickr Pool MAKE on Flickr
Join our MAKE Flickr Pool!
    make_tips on Twitter

    MAKE's RSS feed is here.
    Add MAKE to iGoogle - GoogleGoogle.
    How to add MAKE to your RSS reader - Real simple.
    Add MAKE on FriendFeed




    Maker SHED

    Advertise here with FM.

    Why advertise on MAKE?
    Read what folks are saying about us!

    Click here to advertise on MAKE!



    Subscribe to MAKE Magazine!

    Make: Online authors!

    Gareth BranwynGareth Branwyn
    Senior Editor


    Phillip TorronePhillip Torrone
    Senior Editor
    | AIM | Twitter


    Becky SternBecky Stern
    Associate Editor
    | AIM | Twitter


    Marc de VinckMarc de Vinck
    Contributing Writer
    | AIM | Twitter


    John ParkJohn Park
    Contributing Writer
    | Twitter


    Sean RaganSean Ragan
    Contributing Writer
    | Twitter


    Matt MetsMatt Mets
    Contributing Writer
    | AIM | Twitter


    Dale DoughertyDale Dougherty
    Editor & Publisher
    | Twitter


    Shawn ConnallyShawn Connally
    Managing Editor
    | Twitter


    Goli MohammadiGoli Mohammadi
    Associate Managing Editor

    Kip KayKip Kay
    Weekend Projects
    | AIM | Twitter


    Collin CunninghamCollin Cunningham
    Contributing Writer
    | AIM | Twitter

    Adam FlahertyAdam Flaherty
    Contributing Writer
    | AIM | Twitter



    More contributors: Mark Frauenfelder (Editor-in-Chief, MAKE magazine), Kipp Bradford (Technical Consultant/Writer), Chris Connors (Education), Diana Eng (Guest Author), Peter Horvath (Intern), Brian Jepson (O'Reilly Media), Robert Bruce Thompson (Science Room)

    Suggest a Site!

    Current Podcast

    itunesdl.gif Weekend Project: Making Char Cloth Learn how to make a cheap and effective fire starter made from an old t-shirt. To download The Char Cloth video click here and subscribe in iTunes. See Char Cloth in action with the Fire Piston from William Gurstelle.... More...

    Get the Make: Online sent via email
    Enter your email to receive Make: Online each day:



    MAKE Fascination video series brought to you by Dow

    Make: Education

    Important please read


    Subscribe to MAKE Magazine!

    Recent Posts from the Craft: Blog