How to build a speed detector for a coilgun project

If you are building a coilgun (or gauss gun) or rail gun, a necessary part of your project will likely be some sort of speed detector. Getting a coilgun to work is rewarding, but you can’t continue the project without a reliable, accurate device to measure speed. A speed or velocity detector allows you to objectively quantify the performance of your gun. Given this information, you will hopefully be able to tune your project for maximum performance. For example, you can double the size of your capacitor bank and see if there is an improvement in final speed or not. Or, you can use different projectiles and see which ones go the fastest, or which ones have the greatest amount of kinetic energy (you will also need a weight scale to determine kinetic energy).

Here is my speed detector for my coilgun project:

This is quite simple and very cheap to build. In order to build it, you will need two infrared LEDs and two infrared detectors. These are readily available from Radioshack. You can probably buy them for a cheaper price from Jameco or Digikey, but then you would have to pay and wait for shipping. I built my project from two scrap pieces of wood and a piece of metal. As you can see, I didn’t even bother to cut the two pieces of wood to the same length because I’m lazy. You will also need to buy a PIC microcontroller and prototype board. The prototype board is readily available from Radioshack; however you will probably need to order the PIC microcontroller from Jameco or Digikey. The only other specialty components are LM339N and a BAR LED, both available from Radioshack for a fairly cheap price. One last thing I would like to mention is that since you will need to buy a PIC from Jameco, it would probably save you money just to buy all the components from Jameco, with the exception of maybe the prototype board.

How the speed detector works

The speed detector I designed is extremely simple, which is why I’m sharing it with you. There are two sets of infrared emitter and detectors. The emitter is always on. As soon as an object breaks the first beam, the first infrared detector no longer detects a signal. The signal from the infrared detector is analog, not digital. To help interface it to the PIC microcontroller, an op amp is used. This brings the signal to either a full zero or one. This signal is then sent to the microcontroller. Some microcontrollers have ADCs built in, but I would still recommend using an external op-amp such as the LM339N to produce a cleaner trigger signal. For my project, I used a PIC16F627, but there are many microcontrollers you can choose from that will work fine. I do recommend PIC16FXXX microcontrollers because they are very cheap, and you can even build a PIC programmer yourself. One thing that is important is to keep the infrared detectors in a dark place. As you can see, a piece of paper is covering the first detector, and a metal plate is covering the second detector. This helps to get cleaner signals and block out unwanted infrared radiation.

As soon as the processor detects the pin goes low, the software enters a counting state. In this state, the PIC microcontroller simply starts counting from 0. The current value of the counter is always displayed on the BAR LED. When you’re designing your detector, you have to keep in mind how fast you expect objects to pass through, and how accurate you want your results to be. In my case, results are only 8 bits accurate, but that is more than sufficient to get reliable and accurate data for a coilgun project. During the counting phase, you will need to carefully tune how fast the microcontroller counts. Because I’m only using an eight bit display, the counter will overflow very quickly. Therefore, it is necessary to intentionally add delay into the microcontroller program to count at a rate where you don’t expect there will be any overflow. For example, if you don’t expect objects to travel slower than 2 meters per second, you can use that fact and the length between the two detectors in order to figure out how many clocks it will take before overflowing. And oscilloscope is very useful to ensure your microcontroller is counting at the correct rate. Otherwise, all your data will be wrong. Verifying the counting frequency with an oscilloscope is necessary because it is too fast for a human to see. My microcontroller operates at 7.15 kHz.

Once the projectile breaks the second infrared beam, the program stops counting and displays the final count on the BAR LED. You will then have to use good old fashioned math to determine the final velocity in meters per second. I wrote a quick C program to do this, but you could also use Excel to create a simple lookup table.

Posted under Technology

This post was written by admin on September 28, 2008

Tags: , , , ,

Using GPIO for I2C

Originally, this website was dedicated to methods for saving money in your every day life. While I still post those types of articles, I will also start posting a series of technical articles.

This article is about whether or not you can use GPIO pins, or general purpose input / output pins in order to communicate on an I2C bus. The answer is yes! For electronic hobby projects, I2C is an excellent bus protocol to use due to simplicity, ease of debugging, and extremely low cost of bus components. Another great feature of the I2C bus is that there is no minimum speed the bus has to operate at. Simply put, this means that it doesn’t matter how slow you send a message on the bus. This makes it extremely easy to debug, and usually doesn’t even require an oscilloscope to fully debug any problems you might have with the bus. There are two wires of importance in I2C. These wires are the clock and data wires. In order to use GPIO to communicate on the I2C bus, you will need to have exactly two GPIO pins dedicated to I2C. Please note that if you are doing more complicated tasks involving multiple bus masters, then you may need to use additional GPIO pins, but the vast majority of projects only require one bus master, presumably some sort of microcontroller or microprocessor.

The next common question that comes up is how to write the software to communicate with the I2C bus via GPIO. There are two ways to do this, assuming whatever microcontroller your using doesn’t have a built in I2C module (which is why you would want to use GPIO in the first place). The first method is called bit banging. Simply put, the software writes data to the GPIO pins one pin at a time, delays for a short period of time, and then proceeds to write the next piece of data and so on. Often, empty for loops are used in order to create delay between changing the GPIO pins. This is because I2C generally needs to operate below 400 kb/s, and most microcontrollers operate at several megahertz. Therefore, it is important to set the for loop to count to a high number so that the bus isn’t too fast. It is also important not to change the data and the clock pins at the same time because this may create timing issues. Instead, change the clock pin, delay, change the data pin (if necessary), delay, and so on.

The disadvantages of bit banging are that while the processor is communicating on the I2C bus, the microcontroller can’t do anything else. This is because the processor is busy executing empty for loops to intentionally delay the I2C signals. However, if you communicate on the I2C bus for only short periods of time, this con may be more than acceptable for your project.

Another technique is more complicated. First of all, if you don’t have an operating system running on your microcontroller, your only option will be to use a bit banging technique. However, high power microprocessors often have a reduced version of Linux which is loaded onto them. To communicate with I2C, you may create semaphores or threads, which are executed repeatedly on a timer. This is generally a better approach than bit banging because it allows the processor to schedule other tasks in between changing or reading the GPIO pins. However, this is only useful if you have an operating system with a scheduler. If you are unsure whether or not you have an operating system, chances are you do not have one. In either case, bit banging is the simplest approach to use I2C with GPIO pins.

Posted under Technology

This post was written by admin on September 25, 2008

Tags: , , , , ,

Weight loss with Hypnosis, is it a scam?

In the capitalistic world of our, people look high and low for new ways to make money; unfortunately for us, these methods are all too often illegitimate. Some people even resort to scams designed to get your money.

For this article, I am going to focus on the weight loss with hypnosis scam. The scam is very simple and thrives on people’s desire to lose weight, and therefore be more attractive. First, let me say that weight loss is a complex subject involving physical, biological, physiological and psychological sciences. Ultimately, it all boils down to this simple rule: if you burn more calories than you intake, you will lose weight. The difficult part is either increasing the calories you burn, or decreasing the amount of calories you intake. Often, people try to lose weight over a period of years with little success. This often leaves us with a feeling of desperation, which makes us even more susceptible to scams. With this in mind, observe the following advertisement:

The people who created this advertisement are indeed very clever. “Lose weight with hypnosis” immediately catches your attention. Because hypnosis is such a non-standard method for weight loss, the advertisement immediately reassures you with a 100% guarantee. Notice how the advertisement gives 45 days to claim this guarantee, which is very interesting. Weight loss in the short term is very common, especially with people interested enough to spend money at a seminar to do it. Unfortunately during the long term, people often gain the weight back, but it is too late to have your money refunded.

Take a look at what the hypnosis scam is promising; no dieting, no hunger, and no cravings. Note how it is quite possible to lose weight without diet, hunger or cravings, as long as you burn more calories than before. This can be a change in lifestyle, or simple exercise.

The scam explained:

Enough time has been spent talking about the advertisement, now it is time to talk about the scam. Quite simply, you pay 60 dollars to attend a seminar. During the seminar, you will allegedly experience two hypnotic sessions. These sessions, magically, will reduce your consumption of sweets and your cravings. The cold hard truth is that these claims are outright false. There are no studies which have been accepted by the American Medical Association which support the theory that hypnosis can reduce cravings. The truth is that there are real, physical, biological, and chemical causes which result in cravings. Hypnosis does nothing to reduce your caloric intake, and does nothing to increase the number of calories burned. There’s really nothing else to this scam. You pay the scam artists money, and they give you false hope by trying to lure you into a state of ‘hypnosis.’ Obviously, any psychological affect people feel as a result of the seminal are likely to wear off quickly, resulting in repeat customers.

Is this a big scam? You bet! In the advertisement, they claim that over 500,000 people have attended their seminars. Let’s do a little math. $59.99 * 500,000 = $29,995,000. If the advertisement is true, and the average price is $60, then the people running this phony weight loss program have made thirty million dollars. Do yourself a favor and lose weight the right way. Don’t fall into tricks like involving hypnosis.

Posted under Avoiding Scams, Saving Money

This post was written by admin on September 24, 2008

Tags: , , ,

Fake videos promoting the HHO Scam explained

To sell a product successfully, people need to know about the product to begin with. This is equally true for scams. The HHO scam is highly successful for many reasons. One of the reasons the HHO scam is successful is because of its use of pseudo scientific lingo coupled with people who aren’t properly educated in science, at least in the fields of chemistry, electricity and thermodynamics. The advertising methods used by the HHO scammers depend on the fact that most people in the US do not have engineering or science related college degrees.

Confusion about hydrogen

Hydrogen is the most common element in our galaxy. Hydrogen has many interesting properties and is used in many different ways by many different types of technology. First, let me briefly explain the technology behind HHO.

HHO in motor vehicles – Massive amounts of electricity is used to separate hydrogen and oxygen molecules from water. This gas is fed directly into the gas lines leading to your car engine. The new oxygen levels trick your car’s onboard computer into running lean. This damages the engine, but also increases your miles per gallon. If you want to destroy your car engine, or have a car which is going to die within a year anyway, HHO may actually save you some money.

Hydrogen in fuel cells – Unlike the HHO scam, fuel cells is a promising technology. The majority of this technology was developed by NASA in preparation for the Apollo program. Hydrogen in fuel cells is a vastly different technology than HHO. The idea behind fuel cells is that a device recombines hydrogen and oxygen to form water and electricity. This electricity is most often used to drive an electric motor. Even though fuel cell technology has ABSOLUTELY NOTHING to do with HHO, the scammers promoting HHO post videos of fuel cell cars, and then proceed to claim that the cars are using HHO ‘technology’ when, in fact, nothing could be further from the truth.

HHO torches – This technology is similar to HHO in the respect that the gas combination of hydrogen and oxygen is burned to produce a flame. Like HHO, these devices use electrolysis to separate hydrogen out of water. Unfortunately, the similarities end there. There are many sites claiming to make your car run on water, when in fact it is still running on gasoline. HHO torches don’t use gas at all, but just use massive amounts of electricity. The reason these torches are not mainstream is because it is often cheaper for companies to buy and operate regular welding torches, rather than pay for electricity. Of course, the HHO scammers don’t care. They continue to publish videos on Youtube and other sites claiming that cars can run solely on HHO gas just like the torches. The truth is that your car’s alternator can’t supply enough electricity to create enough hydrogen to even operate a lawnmower, much less a car.

Solar power – Solar power has nothing to do with hydrogen or HHO, but that doesn’t stop scammers from posting videos about solar powered cars, and then continue to say that the cars operate using HHO. This is one of the most egregious lies from people promoting HHO just to make a quick dollar.

In summary, there are very different technologies listed above which have nothing to do with HHO. However, HHO scammers post video after video of these devices and claim that HHO is being used in the video. Does this sound like legitimate advertising to you? The answer is no. Its false advertising at best and blatant lying at best.

Why are there so many videos promoting HHO on Youtube? The answer is simple. Most of the major HHO websites have an affiliate program. When you sign up for an affiliate program, you are encouraged to post bogus videos about HHO on Youtube over and over again, and include your affiliate ID in the video comment section.

Posted under Avoiding Scams, Saving Gas, Saving Money, Technology

This post was written by admin on September 17, 2008

Tags: , , , , , , ,

Voting discouragement


If voting by mail makes you anything like the bear in this picture, then count me out!

Normally, I post articles about how to save money in general, how to save gas, and some information about various scams both on and on the internet. However, today, I felt like making a humour post, so I hope you like it :p

Posted under Off the wall

This post was written by admin on September 17, 2008

Tags: , , , ,

Intelligent video advertisements coming to your grocery store

It’s official. Grocery stores are starting to install electronic video screens in their isles in an effort to advertise products as you walk by. Within the last week, some Safeway stores have started installing these intelligent video advertisements in its stores all across Silicon Valley. Not only are do these advertisements have video screens; they also come complete with speakers and even motion sensors.

That’s right, the new video advertisement units in Safeway stores detect when a person is walking by. That is how it intelligently decides when to play an advertisement, and when to make audible noise. The first time I’ve seen one of these systems was today, as I walked in an isle which was fairly empty. All of the sudden I heard a noise, and sure enough, I saw a video screen playing an advertisement for cleaners.

Are we headed towards a dark future where advertisements profile people on the fly and select appropriate advertisements? The answer is almost certainly yes. It is only a matter of time before these systems can distinguish men from woman, and even features of individuals. In theory, these systems could soon determine if you are a man without a wedding ring, or a man who is balding so it can tailor advertisements specifically for you. Safeway has taken the very first step by putting motion sensors on their computerized advertisements in grocery stores.

Posted under Shopping, Technology

This post was written by admin on September 13, 2008

Tags: , , ,

El Cheapo, the cheap way to program a PIC microcontroller

If you ever wanted to do a project involving microcontrollers, the first thing you need is a microcontroller, and programmer. Many commercial PIC programmers exist. These programmers cost anywhere from 25 to 250 dollars depending on how many different PICs are supported and how greedy the manufacturer is. In my other article, I gave a great review for the Microchip PIC32 starter kit, which includes the chip, programmer, and debugger. Best of all, it connects to your computer via a USB port, which is excellent since all modern computer have USB. The PIC32 starter kit only costs 50 dollars, which is more than reasonable.

However, there is a cheaper alternative if you are truly trying to save money on your hobby project. The cheapest way to get a PIC programmer is to make one yourself! The design is called El Cheapo, mainly because all the components together cost less than 10 dollars. Luckily, El Cheapo is extremely easy to make. Schematics of the programmer may be found by their original creator here.

What does this programmer look like? Here are some pictures I’ve taken of my El Cheapo programmer which I built.

Unfortunately, the El Cheapo programmer connects to your computer via an LP-25 printer port, which many computers do not have because it is now obsolete. If you’re thinking about building a PIC programmer yourself, be sure that you have a printer port on your computer. Otherwise, it’s best just to get a starter kit from Microchip which has a USB connection.

Posted under Saving Money

This post was written by admin on September 13, 2008

Tags: , , , , , , ,

The cheapest, best microcontroller for hobbyists

Have you ever wanted to do a cool microcontroller project, but found yourself confused as to which controller to get, which programmer to get, or what software to get? Maybe you wanted to do a microcontroller, but found out that it’s simply too expensive. Well, today you’re in luck, because I’m going to review the perfect microcontroller for nearly all hobby projects.

When I first started looking for a suitable microcontroller for my project, I ran across Radioshack’s BASIC stamp microcontroller. The things were awfully small, had very few GPIO pins, had very little compute capability, and were extremely expensive. Overall, I would not recommend BASIC stamps to anyone unless you have a serious desire to avoid learning assembly language. For me, learning is half the fun!


So what is the absolute cheapest, overall best microcontroller starter kit? The answer is Microchip’s new 32 bit pit starter kit! Microchip’s PIC series of microcontrollers have been extremely popular for over a decade, but never have I seen a cheaper starter kit available.

First things first, this is pretty cheap and can save you a lot of money and frustration. It comes with the microcontroller, programmer, debugger, and software. Best of all, the kit only costs fifty dollars, which is extremely cheap for starter kits. One of the best things about this kit is that it connects to your computer via USB. Most kits connect to your computer with serial and printer port connections. Unfortunately, most modern computers built today do not have either of these interfaces because they are extremely outdated. When I started programming with microcontrollers, I used a PIC16F84, and I build an El Cheapo programmer myself. I managed to get a project and programmer built for fewer than 20 dollars. Unfortunately, my new computer does not have a printer port, so I can not use the El Cheapo PIC programmer anymore. Instead, the best is to buy a new kit which is USB capable.

The actual microcontroller itself has a wide variety of features and interfaces which can suite virtually any project. Whether you need GPIO, SPI, I2C, UART or RTCC, the PIC32 has them all. It runs at 80 Megahertz which is fast enough for virtually any hobby projects as well. I highly recommend this kit to anyone who wants to build a hobby project with a microcontroller.

Posted under Saving Money, Shopping

This post was written by admin on September 12, 2008

Tags: , , , , , , , ,

How the HHO scam works

Have you ever seen or heard about websites offering to sell you plans on how to make your car run on water? A general rule of thumb is if something sounds too good to be true, it is. This goes double for websites on the internet trying to sell you something.

Now back to the issue at hand. How does the HHO scam work, and why does it persist so strongly? What has made the HHO scam one of the largest scams operating on the internet today?

There are several key elements which allow the HHO scam to work. As gas prices rose sharply in recent history, people got desperate. Very few people planned on buying gas at $4.50 a gallon when they bought their vehicle. Scams thrive on desperation. The more desperate a person is, generally speaking, the more susceptible that person is to scams which promise to make that person’s life easier. The unexpectedly higher cost of gasoline and diesel introduced stress into people’s lives. These people, along with me, started looking for cheap easy solutions to save gas money. Of course, scams thrive in this type of environment.

Another key element of the HHO scam is panic and speculation. When gas was over $4 a gallon, people were speculating on how high the gas prices would go during the summer of 2008. Indeed, there were news reports and blog posts of people predicting prices of 8 dollars or more. Of course, this hasn’t happened yet, and gas prices are falling again. But the fear and speculation that gas would rise much more in the very short term forced many people to panic, and become more susceptible to scams promising to make their vehicles more fuel efficient.

The perfect storm had finally risen. People were hurting and the pump and feared the future prices of gas, which forced many to look for solutions. The original HHO scammers picked up on this immediately. One very successful strategy for scams is the use of fake science, or pseudo science. I have a master’s degree in science and engineering, so it’s fairly easy for me figure out what scientific explanations are valid, and which are using fake science, pseudo science, or good old fashioned invalid logic. The HHO scam’s success depends on people’s lack of understanding or misunderstanding of scientific principals. The list is too long to write here, so I will write another article about some of the fake science used in the HHO scam. For now, let me cite one example. HHO involves the production of hydrogen gas and oxygen gas from water. Many scam artists have posted Youtube videos with anything even remotely related to hydrogen, and then provide a link to their website to sell you plans and kits. Specifically, a car which uses a hydrogen fuel cell to create electricity in order to drive has absolutely nothing to do with HHO. However, the scam artists post videos about the hydrogen fuel cell car, and say the car is using HHO when nothing could be further from the truth. You can see how easy it is for someone to think that the car uses HHO because it uses hydrogen, but this is not the case.

Scams do not exist where there is no money to be made. Unfortunately, the HHO scam involves thousands of scammers all around the world. The scam is ingeniously designed so that the head scammers make millions of dollars for free. Here is how it works. There are a large number of websites selling electronic copies of a plan to build an HHO system. Below are some websites for example:

The list is practically endless. These websites all have affiliate programs. The programs give commission in the range of 30% to 70%. This way, the people who own and operate these websites can actually get other scammers to work for free. One of the reasons this scam is so widespread is because people are attracted by the affiliate programs, and these people proceed to advertise the websites with their affiliate ID. Every time someone makes a purchase for bogus HHO plans, the affiliates and the website operators make cold hard cash. The people who operate these websites don’t have to work another day in their life as long as the websites are up and running.

That will do for this part of my series on why HHO is a scam, how it works, and more. In this article, I have explained why the HHO scam, also known as Brown’s gas scam, works. I explained the necessary conditions which created an atmosphere where the scam would flourish. I’ve explained how people are convinced that HHO works by use of pseudo science, although I will write a separate article with more examples of exactly that. Finally, I have explained why so many scammers have jumped aboard the HHO affiliate programs, and why these websites receive so much attention. Every time someone purchase plans for an HHO system, the scammers win.

Posted under Avoiding Scams, Saving Gas, Saving Money

This post was written by admin on September 12, 2008

Tags: , , , , , ,

American Express is robbing you!

Recently, I got a letter in the mail offering me an American Express Delta SkyMiles credit card. Right away, you know there will be trouble:

Dear <your name>:

You’ve been experiencing the benefits of Cardmembership carrying a Card on someone else’s account. Now, we’d like to invite you to get a Gold Delta SkyMiles Card, with no annual fee for your first year – that’s a savings of $95. You’ve earned the right to get your own Card and Award Travel! – And you’ll be the Basic Cardmember, so the spending you do will count toward your own excellent credit history.

Okay, did you notice anything in that paragraph? That’s right; the annual fee for the card is $95 dollars. Every single year, you have to pay for the privilege of carrying one of their credit cards, which is outrageous! Credit card companies make billions of dollars because they have a very simple business plan. When you use your credit card and don’t pay it on time, they charge you an extremely large interest fee. All the credit card companies have to do is loan you money, which costs them nothing. That is why most credit cards have no recurring fees whatsoever…the companies can afford it.

So why would anyone intentionally opt to pay recurring fees just for having a credit card? Well, it turns out that there is another part of the story for the American express card. By using the card in your day to day life, you earn sky miles. When you have enough miles, you can get a free or near free plane ticket. This sounds like a good deal, right? Well, yes and no. For most of us, we don’t spend enough money fast enough in order to actually come out positive. That is, if you don’t use the card a lot, the annual recurring fee is going to cost you more than you would ever save by getting a free plane ticket. If you have a very good salary and spend several thousand dollars a month with the American Express Delta SkyMiles card, then it may be a good idea. If you don’t use your credit card that much, the American Express Delta SkyMiles card will ending up costing you a lot of money in the long run. The only responsible thing to do is avoid any sort of credit card with a recurring fee of any kind.

Posted under Avoiding Fees, Avoiding Scams, Hidden Fees, Saving Money, Shopping

This post was written by admin on September 11, 2008

Tags: , , , , , , ,