Hackaday.com recently ran an article called "Arduino vs. Phidgets - Dev Time Trials" which brought to attention a blog post by Ken (?) called "Hardware Protoyping Speed Test: Phidgets vs Arduino" which I thought was a rather fair set of tests for comparing development speed and costs for three simple projects. My objective is to run these same tests using the Gadgeteer rapid prototyping system and report my results.
Of course, like any article of this sort there are always going to be some lively comments from the readers regarding the validity and bias of tests. I fully expect that this article will generate plenty of its own.
Like [I suspect] Ken, I am not being paid to write this article and have not gone to every length to make everything as objective and scientific as possible simply because I am not interested in spending more than a few nights with these tests and producing the video. However, I do feel that my tests are in line with the tests that Ken performed. Ken introduced us to Phidgets as an alternative rapid prototyping system for hardware. His tests showed that Phidgets is indeed a faster development system than Arduino. However, as he and the readers of the article pointed out there are several negatives to going this direction including:
Cost - the Phidgets projects were considerably more expensive than the Arduino projects.
PC Tether - Phidgets must be connected to a PC at all times.
Proprietary
What is Gadgeteer and why use it?
My favorite hardware system for rapid prototyping is Gadgeteer. Much like Phidgets, it uses modular components combined with software to provide a system which makes it possible to prototype extremely quickly. In these tests I will demonstrate this. I am also a big fan of Arduino and regularly use it in projects. However, for rapid prototyping I haven't found anything better than Gadgeteer. I have never used Phidgets myself. Any statements about the platform come from Ken's article.
Gadgeteer also addresses the concerns numerated above with Phidgets. You will see that the project costs when using Gadgeteer was only nominally higher than that of Arduino. Considering the productivity gains, I believe it to be worth the investment.
Gadgeteer is microcontroller based. So, a PC is only needed for programming and debugging. Once that's done, you can untether it and power it from any DC source as you can with Arduino.
Gadgeteer is open source and is based on the open source .NET Micro Framework (NETMF) project. Most of the modules and some of the mainboards are also open hardware & software. Vendors can extend the core framework and add their own proprietary software to mainboard firmware. However, no proprietary functions were used in my tests.
The Tests!
For more information about the tests, I encourage you to read Ken's article. I'm going to focus this post on just showing my results and detailing concerns I uncovered when necessary.
Some people may complain here that I didn't manually wire up an LED & resistor as Ken did in his tests. I say that defeats the purpose of rapid prototyping. One of the main advantages of Gadgeteer is that I don't need to know how to wire up circuits in order to quickly make something that works.
One thing I felt was an error in Ken's tests were that he didn't use the same servo in both tests but instead used a slightly more expensive Phidgets branded servo for the test of the Phidgets board. Since the brand of servo really shouldn't matter, I thought it would be a more fair comparison to exclude the cost of the servo from the prices and assume that the same servo was used in every test since they all basically function the same way.
The results...
Some of the readers of Ken's article complained that he use "libraries" in his tests and I anticipate some will complain that I did the same. To that I'll respond "you betcha!". Built-in module drivers that have been written and tested specifically for a known module circuit that are easy to wire in via drag & drop programming is another big reason that rapid prototyping with Gadgeteer is so much faster. Even if you have the libraries available to you in Aduino, you are going to have to locate them and figure out how to include them in your project which takes time that you do not have to spend with Gadgeteer.
Here we can see that as the complexity of a project increases, the development time saved by Gadgeteer really pays off. It's also important to note that the cost of the Gadgeteer solution is only slightly higher than that of the Arduino solution and almost four times cheaper than the Phidgets solution.
OVERVIEW
Here I've plotted a summary of the results from the three tests. The Y axis shows development time and the bubble size shows cost. It is evident from this comparison that Gadgeteer makes a very good choice when choosing a rapid prototyping system.
Some readers of Ken's article commented that Phidgets was faster but due to the cost it wouldn't be useful for creating final projects. As you can see in the cost comparisons of the Gadgeteer & Arduino solutions, Gadgeteer solutions can make very good options for many final projects. In fact, I have consulted with a company in the past that is doing this very thing in a commercial product. Certainly, if a company's volume gets high enough then it makes sense to convert to a custom PCB solution. But if you are a start-up with more ideas than engineers then a Gadgeteer based solution is a very viable option.
Although at times it may sound like I'm getting paid to write this article, that is not the case. I am just a really big fan of the Gadgeteer prototyping system and I'm excited to show you why. There's much more power including rich debugging, inline help, and the full power of Visual Studio that these tests do not even begin to demonstrate.
For more information, I encourage you to follow my blog and Gadgeteerin' YouTube channel for more information. For up to the minute news about Gadgeteer, follow me on Twitter as @Gadgeteerin.
You can find all source code used in the video here.
Momentary buttons are probably one of the most common components in most projects. Unfortunately, most buttons are not made to be inserted into a breadboard. Most do line up and some will work if you are very nice to them. However, the pins are normally curved and very short so their ability to connect with the breadboard is very marginal and can lead to problems that may at first seem like issues with your microcontroller or the button itself. More than likely the issue is really just that the button isn’t making good contact with the circuit.
To eliminate this problem from my projects, I use the following process to make the buttons breadboard friendly. I recommend keeping a set of these specifically for breadboarding to save you time down the road. However, if you need to you can certainly reverse these modification later to use the buttons in your final product.
Basically, what I do is attach extensions to the “pins” coming from the button so that they fit tighter and deeper into the breadboard. This is certainly not an original idea. Many before me have done the same. However, since I was making up several of these recently I decided it would be good to document and reference later for others getting started in electronics.
I start by getting a piece of male pin headers – one for each pin on the button. Hold the plastic housing with your fingers or a pair of pliers and then using some needle nose pliers, pull the pins out of the plastic. These pins are much more rigid than just wire and are easier to insert into the breadboard without worrying about them bending. Once you have the pins out, find the holes on a spare breadboard that align with the pins of your button and insert the new header pins into these holes. Only push them in far enough that they are secure and try to make sure they are all sticking up the same height. We use this technique to ensure that when we solder the pins to our button that they will line up perfectly with the breadboard.
Next, we will place the button on top of the standing pins and align it so that the buttons pins are on the outside of the new pins. We’ll next add some alligator clips to hold the two parts together to be soldered. So, don’t be overly concerned about getting everything perfect at this point. You may need to bend the pins on the button out just slightly to make them easily fit on the outside of all the new pins.
Using the alligator clips, secure one corner on properly. Make sure that the new pin extends as high up on the button’s pin as possible so that we get good contact at least on the top & bottom of the button pin. If there is a curve or loop in the button pin, don’t worry about trying to straighten it. It will not be a problem. That gap will easily fill in with solder. Once you get one of the clips on then do the opposite corner and then the other two pins.
Now that you have everything secure, it’s a simple process of soldering all the pins together. You may accidentally solder your clips to the pins. This is not a problem. A simple touch of the soldering iron will cause it to release without undoing the main solder joint if done quickly. Be careful, the clips can get hot quickly in this process.
Now you have a button perfect for use in a breadboard that you can depend on to give you a good connection to the rest of your circuit and loosen with use.
This same technique can be applied to many types of components with similar types of connectors that are not necessarily breadboard friendly.
Enjoy and please share your projects or suggestions in the comments!
I’ve been working on designing a .NET Gadgeteer DaisyLink module for a project I’m working on and ran into a limitation of the GHI Extender module that I thought warranted an improvement (aka “hack”). I’ll detail the steps I took to convert a GHI Extender module into a DaisyLink Extender module in this post.
In case you’re unaware of what DaisyLink is…in a nutshell, it’s a way to chain together Gadgeteer modules so that you only have to use a single socket. An example of such a module is the GHI Smart Multicolor LED module. On a DaisyLink module there are two sockets – the upstream socket (the one going toward the mainboard) and the downstream socket (the one going away from the mainboard).
The communication for DaisyLink happens using the I2C protocol and a neighborhood bus. It isn’t the intent of this post to explain in detail how DaisyLink works. For that info, see the .NET Gadgeteer Module Builders Guide. However, I mention this because the neighborhood bus is the reason for this hack. All the pins in the two sockets on a DaisyLink module can be passed straight through from one socket to the next except the neighborhood bus (socket pin #3). This pin has to be activated/deactivated independently as this is the mechanism that the mainboard uses to identify which module it is communicating.
The GHI Extender module is in my opinion the most useful of all Gadgeteer modules since you can basically do anything with it. Before I started understanding how DaisyLink worked, I always assumed that the Extender module had two sockets on it so that it could be used to develop DaisyLink applications since I otherwise see no application for the other socket except as a way to tie two cables together. The pins on the two sockets are directly connected together and to a header on the edge of the module. As I mentioned above, this is a problem since I need to be able to control the value of pin #3 independently on each socket. So, it’s time to pull out the soldering iron!
If you flip the Extender module over and rub the solder mask a little to polish it, you will see the circuits. I’ve highlighted in green the circuit for pin #3 that goes to both sockets and to the header pad. Note that the left-most junction is where the circuit connects to what we will refer to from now on as the downstream socket. We’re going to add an additional pin to the header called “P3*” (since * is used by Gadgeteer to denote downstream sockets) and make the header labeled “P3” only connect to the upstream socket pin #3.
We’ll begin by using a box cutter or Xacto knife to scrape the solder mask off the circuit on both sides of the junction we want to bypass.
Next, we’ll use the box cutter to make four deep cuts through the copper circuit we just exposed and then we will remove the sections. The cuts to make are shown in red on the picture to the right. Remove all the copper between each set of parallel cuts.
Now that pin #3 of the downstream socket has been isolated, we need to connect the two circuits that we just cut back together so that the upstream socket pin #3 will be connected to the “P3” header. Start by using the box cutter to scrape a little more of the solder mask off the copper on the right side of the top circuit we cut and below the bottom circuit we cut. Now, take a thin wire and solder it to the two pieces of exposed copper. If you have some Kapton tape to stick down the wire while soldering, it will make it a lot easier. However, you can manage it w/o if necessary. It also helps if you tin the wire with some solder before attempting to connect it to the PCB. You will probably not get a large bead of solder to stick to the tiny piece of copper. As long as you get enough so that the wire is secured that will be sufficient.
We’re done on the back side of the PCB. Next we’ll attach the male headers to the board. Although the module has 10 header holes, we will need a section of header that has 11 male pins. To make it easier to solder every square, put the header into a spare breadboard and put the Extender module on top. I also like to put an extra piece of header underneath the module on the other side to give it some support and help ensure it stays flat.
Take a small piece of thin insulated wire and strip a very small amount off one end and tin it with some solder. We’ll solder this to pin #3 of our downstream socket. Note that in the picture on the right, pin #1 is in the bottom left corner of the socket. All the even numbered pins are in the top row and the odd numbered pins are on the bottom row. So, pin #3 will be the second pin on the bottom row. It will greatly simplify soldering if you have a tiny alligator clamp that you can clamp the wire to the PCB so that the exposed end of the wire is lying on top of the pad for pin #3 as is shown in the picture. If you have a flux pen, it would be a good idea to add a little flux to the SMD connectors before soldering. However, if you take care and get it done in one heating you should have no problems w/o additional flux. Use your soldering iron to heat the wire and pad so that the reflowed solder connects the two together. You may need to add a tiny amount of additional solder. Just be careful not to bridge any of the other pads. Solder the other end of the wire to the extra header pin.
Let it cool a few seconds and then you can remove it from the breadboard. Take caution when removing it as the extra header pin could easily snap off if torqued side-to-side.
Finally, to help protect the uninsulated wire we added to the bottom side of the board I created a label in Excel and printed and taped it to the underside of the board to help label the extra header in case some day years from now I forget why it’s there.
Now that I have a good way to prototype, it’s time to go finish my new DaisyLink module! Thanks for stopping by.
This is a series of posts I’m doing as I go from working out of a collection of unorganized boxes and bags to something more productive and efficient using Plano 3449 boxes.
Tonight I decided to take on the next chapter in “Operation: Organize my Parts!” (OOP). Since I didn’t want to start a very large project, I decided to move my electrolytic capacitors into some Plano 3449 boxes. I’ve been using the little Ziploc bags that they came in when I bought them and that’s not such a bad solution. However, I had all of the little bags of caps crammed into one larger Ziploc bag and that was inconvenient to have to pull them all out and sort through them every time I needed one.
Since electrolytic capacitors are considerably larger than resistors, the envelope method I used to organize my resistors wasn’t practical. So, I decided that I’d give each capacitor value it’s own compartment in the Plano box. Currently, I only keep 10 different values so this isn’t bad since it will only require two boxes to store them all.
To label the compartments to make the values easy to identify, I added a new worksheet to the Plano 3449 – Electronic Organization file. I created a page of labels that can be used to print something similar to the envelopes used before except that for these the paper is folded and taped so that one of the labels is visible from the bottom of the box and one is visible when the box is open. This makes it very easy to find the right box and to identify the parts when the box is open.
This solution has worked very well and will save me a lot of time in the future that would have been spent rummaging through Ziploc bags. If you want to use this solution, download the Excel file and use the “Electrolytic Capacitor Labels” worksheet. I hope this solution helps someone else as much as it has me.
I finally did it. I threw in the towel. I finally reached the point where my loss of productivity forced me to stop and do something I’ve been threatening to do for a while. I decided to get organized. I’ve spent a lot of time out in the wood shop this year getting it organized (more posts coming!). However, the electronics lab is a different monster that I’ve been thinking about for years about how to best handle but could just never come up with that perfect unique idea. Operation: Organize my Parts (OOP) has begun.
So, I decided to think smaller. I’ve been spending a lot of time working on several different electronics projects in recent months and by far the most time consuming activity has been searching through my pile of resistors.
In truth, I started this little project over two years ago when I bought a lot of fourty Plano 3449 mini tackle boxes off eBay (for about $1 each) for this purpose. However, I took a couple years off from doing anything serious with electronics and so the boxes have just sat in a bigger box in my office. When I bought the boxes, my idea was basically to put every different value in a separate compartment. However, the more I thought about it that was a terribly ineffective use of space since a vast majority of the resistor values I have come from assortment bags and I only have 5 to 10 units of each value.
So, I started to think about how to better utilize the space within the compartments of the Plano boxes to help reduce the number of boxes required to store the complete resistor collection and to allow me to be able to quickly and easily find & store resistors when needed. To make it easy to find resistors, I knew I needed them labeled with their numeric value and sorted. To make it easy to store resistors, I knew I would need their color codes easily viewable.
The solution I finally arrived up was an envelope system that had a closing flap that contained the resistor value and the color codes such as the one on the left. The colored flap secures the envelope and also prevents accidental spilling should the box get dumped. To make the envelopes, I decided to create an Excel spreadsheet to help with the color coding. This turned out to be a much bigger challenge than I initially expected. Consider this my Christmas present to you should you decide to use it (I’ll expect a Christmas card in return! ;)
After printing out pages of all the envelope templates that I needed, it was then just a matter of sitting in front of the TV with some scissors cutting out all the squares, folding them and taping the ends. I then sorted through and identified all the resistors and placed them in their appropriate envelopes.
The rule of thumb that I've been using and which has worked very well regarding resistor inventory is to start out with a couple 1000 resistor assortments from eBay. Then as I run out of a particular value, I order 200 to replace it. 20 resistors is about all that will comfortable fit in the tiny envelopes. So, for more than that for a single value they get their own dedicated compartment within the box. I place the envelope over the divider so that it's value & color code are easily visible.
I'm now able to fit all of my resistors into three of the Plano boxes and can locate the needed one within seconds instead of minutes. It's especially nice that the boxes are clear and I'm able to view the labels through the box lid without opening it to locate the correct box. It took several nights to get it all setup and sorted but now it's very easy to maintain and I consider it well worth the effort.
A couple of issues to mention concerning the Excel spreadsheet. First, I was focused on the majority of my resistors that are 1/4W and failed to provide a way to note this on the envelope. Since I'm not willing to recreate the envelopes just to add a "1/4W" label on them, the approach I'm taking is that as I add resistors of a different Watt rating then I hand write "1/4W" below the resistor value in the empty white space and print the new envelope for the new value with the Watt value on it. If you decide to use my spreadsheet, you should add the W label on there before printing. Secondly, the data formatting abilities in Excel seems to have a limitation where it is not possible to have it hide the decimal if the format contains the ability to have decimal places. For example, if the format is "0.##" and the number is 10 then it will display the number as "10." (including the period). So, for this reason you will see a lot of extra periods on the envelopes. If you know a way to eliminate the period, please leave a comment with the solution and I'll update the spreadsheet.
I hope this post has helped someone else escape "resistor hell". Now onto capacitors...
As I’m working on the Omnimote, I decided the next article in the NETMF for Electronics Noobs series should be about how to interface a joystick with a NETMF device.
For this example, I’m using a Parallax joystick from Adafruit.com. Sparkfun has a similar joystick which should work using the same directions although the labels for the pinouts are slightly different. I prefer the one from Adafruit because it has a nice rubber feel to it and it’s pin headers fit in a breadboard. The one from SparkFun is a slippery hard plastic and requires you to buy a separate PCB in order to make it breadboard friendly. It does have the advantage of an additional push button selector built-in that the one from Adafruit does not. They both have convex tops. I would have much rather had concave tops such as you get with an XBox 360 controller but these were not carried.
A joystick controller is simply a stick connected to two small potentiometers – one for the left-right (X) motion and one for the up-down (Y) motion. To connect the joystick to the board, we will need two analog pins plus +5V and ground connections. The following table will show the labels and pins for these two joysticks.
Adafruit Joystick
Sparkfun Joystick
Arduino Compatible Pin
L/R+
VCC
+5V
L/R
HOR
Analog*
U/D+
VCC
+5V
U/D
VER
Analog*
GND
GND
GND
Any two analog pins can be used for L/R and U/D. For this tutorial, I am using Analog0 for L/R and Analog1 for U/D.
This post also serves as an announcement of a new open source NETMF library I’ve created called NETMFx. This will serve as a place for me (and anyone else who wants to contribute) to put custom drivers and anything NETMF related. My goal is to make anything in it compatible with both GHI and netduino so that the greater NETMF community can make use of it. I’ve done this by using conditional compile symbols when necessary. Be sure and check out the progress made so far in NETMFx.Joystick and NETMFx.Math projects in the NETMFx source code download.
There is also a “Samples” project in the NETMFx solution where I’ve posted a sample project called “Joystick Tutorial” that is specific to this post. I’ve done a fairly complete job of documenting the project from the code so I will not bother going into detail in this post. Feel free to contact me if you need further clarification of how to run the code once you have everything wired up.
If you’re building any type of R/C planes, copters, cars, boats or robots with your NETMF device then you’ll likely encounter the need to control a brushless motor. Controlling a brushless motor is very different than controlling a regular brushed DC motor. What makes it different is the addition of the Electronic Speed Controller (ESC).
The main reason this article exists is because the hobby parts distributors have done a terrible job of documenting these most basic of parts. You should be able to go to the manufacturer website for the ESC you purchase and get most of this info. However, my experience is that you can’t and they assume you know what you’re doing if you buy these parts. Obviously, not the case or you wouldn’t be here.
If you click on the main photo, and look closely at the ESC (the blue part in the lower left corner) you will see that on one side it has three black wires. These colors may vary from model to model. On the other side it will have two thick red & black wires. It will also have a bundle of two or three thinner wires depending on your model.
First connect the three black wires from the ESC to the three wires coming from your motor. Right now you’re thinking “which wires on the motor go to which wires on the ESC?”. Trust me, it doesn’t matter. To understand why, study how brushless motors work and you’ll understand. For now, just take a leap of faith. If you find later that your motor is turning in the wrong direction, then swap any two of these wires and the direction will change. It’s magic…
The small bundle of three wires on my ESC are colored brown, red, and orange. After quite a bit of digging, I finally found that the two outer wires are the important ones. The brown wire is ground and the orange wire is the control. The red wire in the center provides 5V power and can be used to power the microcontroller. Most people do not recommend this due to the fact that when the motor is accelerated quickly it is possible that power could be momentarily lost. This is an especially bad situation if you’re controlling a flying vehicle. It’s not so bad if you’re controlling a car or plane. If your bundle only has two wires, then you do not have the power wire.
You should wire the brown wire of the ESC bundle to any ground on your NETMF device. For this example, I’m using a GHIPanda-II. The orange wire should be connected to any PWM pin. I’m using PWM1 (I/O 10).
Next, all you need to do is connect the red & black wires from the ESC to the respective wires on your battery. If all is well, you will probably hear a series of tones from your ESC indicating that it is now armed.
NEVER TEST YOUR MOTOR WITH A PROPELLOR ATTACHED!!!
Until you have fully tested out your controls and have everything mounted securely and have a safe place to work, it is a really bad idea to attach the propellers. If you have never worked with a brushless motor with a propeller on it, you will probably be amazed at how much power they have the first time your power it up. Propellers are very sharp and will cut you.
Now that everything is wired up, it’s a simple thing to get the software going. Start by downloading Chris’ Brushless Motor ESC driver class and add it to a new NETMF project. Assuming you also used pin 10 to control your ESC, the following code should test your motor by powering it up to 20% power for about half a second and then powering it off. Push the reset button to make it go again.
public static void Main()
{
var m1 = new BrushlessMotor((PWM.Pin) FEZ_Pin.PWM.Di10);
m1.Scale = 100;
m1.SetPower(20);
Thread.Sleep(500);
m1.Stop();
}
If that works then you’re off and running. Just figure out what power your project needs and when then apply where necessary. If you need additional motors, then rinse & repeat but use a different PWM pin.
If you’re using a netduino or other NETMF device, do not be dissuaded. It’s very easy to port Chris’ driver class to your device and to make the appropriate change to the test app. Feel free to drop me a line if you need help.
Choulant asked for it and here they are - the parts used in this tutorial:
The princess is not happy… The frame for the Omnicopter is built and the motors are installed but it doesn’t fly!!! Women. They want everything “right now!”. ;) However, I later wired up one of the motors and put a prop on it and showed her what’s coming. She’s quite pleased at that. I’ll admit that I was also. I built this frame as more of a lab/test frame than a final version. It has a lot of flexibility built into it as far as arm placement goes and very little attention was taken to try and reduce weight. With 20% power given to one motor with a prop it produced enough lift to lift half of the frame and motors off the ground. Once all four motors are up and running it will have more than enough power to lift itself and probably 2-4 additional pounds. Can’t wait to have that test!
I’ll post some additional detail about the frame later. Now to build the wiring harness…