Tuesday, September 8, 2015

Have you been longing to play Nintendo, Super Nintendo, or Sega Genesis games with your friends as though you were 12 again? Emulators are great, but what if you are living in different cities? Here's how.

1) Download Hamatchi and form a network. Hamatchi is VPN (Virtual Private Network) software that makes it appear as though you are on the same Local Area Network (LAN) as your buds, but over the internet. After you are both on the same network, be sure to take note of your friend's Hamatchi IP address, as you will need it later.

2) Download a stand-alone voice and / or video chat solution such as Mumble, Team Speak, or Skype.

3) Download an emulator that supports network play, such as

ePCSXe  - Sony PlayStation
nullDC - Sega Dreamcast
ZSNES - Super Nintendo
FCE Ultra - Nintendo
MAME - Arcade

4) Agree on a game to play ahead of time, because you will both need to have the appropriate ROM file. 

5) You will need to coordinate ahead of time / over voice chat who has the player one controller, as these consoles / arcade titles are not designed to figure it out like modern online games. Make sure that everything is working for your single player setup before even attempting online play. Set up one person's machine for player two input then connect to one another using the Hamachi IP address for your friend provided from Step 1.

Happy gaming!

Security system duino

Saturday, March 7, 2015

Reading a Doorbell Transformer with an Arduino (Part 1, circuit design).

Motivation: It would be nice to be able to get a notification such as a text message whenever someone rings the doorbell. In this tutorial I will demonstrate how I can use an Arduino to alert me electronically whenever someone is at the door.

My water heater closet has the 24 V AC transformer which is used to power my the doorbell. My particular doorbell circuit consists of a spring loaded solenoid in series with a button. When the button is pushed, the circuit is closed and current flows through the solenoid, causing it to move and strike a bell ("DING"). When the button is released, the spring pulls the solenoid hammer back in, and it overshoots, causing it to strike a second bell ("DONG"). Most mechanical doorbells are as simple as this.

Here is an illustration of the doorbell circuit, which I made using LTSpice.

LTSpice from Linear Technologies is a free circuit simulation software package. This part is for illustrative purposes but if you think it might be useful for you in the future, I encourage you to download and learn to use it.


The voltage source on the left represents household current (120V RMS = 170V P2P). The two inductors L1 and L2 represent the doorbell transformer. In order for SPICE to couple these in the EM, a SPICE directive is needed. The directive "K L1 L2 1" means that L1 and L2 are perfectly coupled (so we have a perfect transformer). The resistor R1 was needed for LTSpice to perform the simulation and produce simulated wave forms. In order to get a voltage drop in the right ball park (120 V down to 24 V), I chose values of 100uH and 5uH. Since we're not actually building this, but documenting what exists, it is not so important that we're entirely accurate. If you want to try this with LtSpice I found this video useful. The button is where the doorbell button exists in the circuit.

So how do we do this?

While the solenoid is turned on, the current flow causes a voltage drop of about 4.0 volts RMS at the transformer output. The Arduino will  need to detect this AC voltage drop.

I will use one the analog pins on the Arduino to read the voltage. Since it is a bad idea to put reverse voltage across an analog pin, and since it is also a bad idea to put 24V on a pic, I will design a half wave rectified, voltage divider circuit

Here is the voltage divider:

In this circuit, the 24 V AC source represents the output of the transformer when the solenoid is not engaged. The center tap of the voltage divider will go to the analog pin on the arduino. The green waveform represents the output of the voltage divider in the center tap.

We need to get rid of the negative voltages so we will add a diode to work as a half wave rectifier.

The green wave form will be what we read with the Arduino.  It varies between 0 and 1.5V when the doorbell is not depressed (solenoid off), and 0 and 1.1V when the doorbell is depressed (solenoid on).

Once we have this circuit built, the next part is to use software to determine using samples from the analog pin, whether or not the doorbell has been pushed within the last few seconds. Stay tuned for part 2.

Saturday, February 7, 2015

DIY Spectrometers, or "Want a chem analysis lab at home?"

 A spectrometer is a device which identifies chemical substances based on their spectrum, e.g. what wavelengths of energy they output or respond to when driven by a stimulus. The stimulus can be naturally occurring or produced by the experimenter.

WIRED science blogs ran a very basic story on DIY spectrometers in July 2012 for looking at illuminating objects (light bulb, sun) which should give a general idea of what spectroscopy is about, for those unfamiliar.

Emission and Absorption Spectrometer:

For self illuminated, simple sources like the sun or a CFL, it is easy to make this at home using a prism, diffraction grating, darkening medium such as cardboard, and either a sensor such as a webcam or your naked eye. For an easy 30 minute project demonstrating this, check out this entry on Instructables

This supports both emission lines (e.g. a flourescent bulb) and absorption / drop out lines (e.g. from the sun).

Flourescence Spectrometer:

Public labs has created a kickstarter which uses a $35 kit and free software, plus their own database, to identify samples after they have been suspended in a known oil, by illuminating the sample with a known light source and then diffracting it. 

Ramen Spectrometer: 

Uses a laser to excite a sample and measure the way monochromatic light scatters off of a sample. The scattered light is affected by vibration mode, rotational mode, and angular momentum of the molecules. The scattered light is picked up by a CMOS sensor like you find in digital camera, filtered, and then put into the frequency domain using Fourier transform. The spectral signature is then looked up against a database and the chemical composition of the sample (likely statistical model) is displayed to the user.
There are multiple parties working on this including Ben Krasnow. This is a completely open project. Structural parts are 3d-printable, software is open source and the acquirable parts are provided in a Bill of Materials (BOM).

https://hackaday.io/project/1279-ramanpi-raman-spectrometer
http://benkrasnow.blogspot.com/2013/05/intro-to-diy-raman-spectroscopy.html

Ion-mobility Spectrometer: 

Works on vapor samples. The sample is ionized using a radiation source such as Americium or Francium. The spectrometer then uses a drift tube to determine the length of time it takes for the ions to flow through a buffer gas in the tube. This is a common method used in airport screening "sniffers" such as those made by Smith's Detection, Implant Sciences Corportation.  May not be suitable for home production due to the difficulty of the ionization process (can one person buy enough smoke detectors to get an ionization source?)

Mass Spectrometer:

Measures the mass of individual molecules by some means. The traditional mass spectrometers are expensive, bench top laboratory equipment based on time of flights. Micro-electro-mechanical (MEMS) devices which vibrate at a resonant frequency are being developed, to act like tiny tuning forks. When a molecule of substance touches these tiny tuning forks, it will change the resonant frequency in a measurable way. This is similar to the MEMS accelerometers, gyroscopes, and microphones which are already common in cell phones today, so a DIY or low cost mass spectrometer may not be far out.

How might you use a spectrometer in your home or small lab? For instance, would this be useful for identifying chemical contaminants such as lead? Leave a comment below.

Sunday, February 1, 2015

Where 3D Printers Fail Us

With all of the hype surrounding 3D printing, I thought I would take a moment to talk about the things 3D printers are not good at.

1) 3D printers are great for producing very expensive toys

If you just want a statue of Yoda for your desk, buying a $1800-3000 consumer grade 3d printer is a great way to do that. Many 3d printer owners never end up learning to build their own models, and often just end up producing toy figurines they download from http://thingiverse.com. Let's say it wasn't against copyright law to sell something like this. It'd take you 1000 prints to break even if you sold them for $5 each (assuming $2.5 in plastic per unit). If you count your time and opportunity cost, you will not ever pay the cost of the printer.

2) Having one will reduce air quality in your home or lab.

Ever melt plastic with a lighter as a kid? Imagine that every time you print.


3) Thankfully, 3D printers are terrible at making weapons.

Don't mind the hype, 3d printed plastic guns are going to be terrible. Unless you want a gun that will fire once or twice, likely not shoot straight, then blow up in your hands. Its more suited for super soakers than 9 millimeters.

4) Parts are not even particularly strong compared to the weak plastics they are made out of

Additive process printers put down plastic in layers. This means there is some dimension (Z-axis) in which the print is likely to snap along. I have broken many pieces accidentally with my bare fingers.

5) Parts are not smooth like you see on the web.

Parts you see in places like Wired magazine or on web sites have been either professionally polished, sand blasted, or printed with a much more expensive process than additive deposition (which is where are the sub $10k consumer grade printers live). It is possible to achieve results that do not have a rough finish, but it takes harsh chemicals or many hours of extra labor.



6) Learning curve

Though tools like Google  Tremble Sketchup  make modeling a lot more accessible, it is still beyond the skill level or desire of interest of the average computer-savvy user, especially since computing is becoming less desktop centric, toward less production-oriented and more consumption-oriented modes such as tablets and phones. This leads back to point #1.

7) Speed of print

Even though 3d-printing is Rapid Prototyping, it is not rapid when compared to many people's expectations. A good quality print often ties up a printer for an entire day, and many times the print will have to be babysat.

8) Maintenance

I fix something every day. Sometimes there's a giant blob where someone wasn't watching a print and it continued to spit plastic all over itself for hours. Other times I will come to find a jammed print head, with the printer moving around through thin air. 3D additive printers are about 1000x more labor intensive as inkjets in terms of maintenance, and I am sure all of you readers have had some experience with a broken ink jet at some point.

Not to come off as negative..


All these things being said, I do love the technology. I just want to be realistic about it and use it for the niches where it fits. Where do you think 3d printers are over-hyped? Do you think any of these points are unfair? Please leave a comment below.

Domain of the 3d printer

3d Printers are not the "next industrial revolution" 

of home manufacturing they are hyped as.
The plastic is expensive, it takes multiple tries and tweaking to get a good print, and they can be maintenance nightmares.

I've been using the Makerbot replicator 2 for over a year now, and I have some feelings on what desktop 3d Printing is good for. I would not advocate printing anything out which you can buy easily mass market, and this includes items that others are 3d-printing and selling.

1) Replacement parts. This is the best use I have found.


I have a nice looking heavy chrome faucet which developed a broken plastic bushing, causing it to leak at the stem. I called Mohn, and they said that the only way to get a new bushing would be to buy a new faucet. I plan to measure it, prototype it, and print a new one.

2) Prototypes of physical parts


My ceiling fans have been breaking chains due to a poor design. The fan housing is made of stamped metal. Where the beaded chain comes out is a simple hole in the metal. This means that if someone pulls straight down on the chain (instead of outward to the side), the beads making up the chain will be pinched on the sheet metal and the chain will break. I've gotten used to this, but when I have guests they will invariably break the chain or be unable to turn on the ceiling fan. My solution? I have designed a part which is a low-angle tube shaped like a piece of elbow macaroni, which fits into the sheet metal hole and is held on the other side by a plastic nut. The chain is then pulled through this elbow and operates without any friction.

3) Enclosures for custom circuit boards / electronics projects


A no brainer. If you have a board which is a certain size, especially if it is protoboard with lots of wires running every which way, it helps to have an enclosure. Fry's sells expensive one-size fits all enclosures, but if you can design and print one which is a custom size for your needs, why not do that instead?

4) Personalized gifts and "if found" tags


Stuff like luggage tags which have your friends names embossed or engraved. I like these ideas:
 4a) key chain fobs that have an email address and phone number on them but no physical address. So if you lose your keys they are easy to claim, or someone will notify you on their location.
 4b) customized plastic rugged luggage tags
 4c) customized phone case, like key chain fob idea for lost phone
 4d) Personalized property plates for things like bicycles and cars. Try to screw these on some place that won't be obvious such as on the top of a car's glove compartment or under a bike's bottom bracket

5) Money making venture

People are willing to pay money for both prints of existing models and new models. Check out http://3dhubs.com for an example of 3d printing as a business venture.

What are your favorite uses for home 3d printing? Leave a comment below.