Archive | February, 2012

The economics of electronics

19 Feb

The economics of electronics

I loved doing my first LED cube prototype and I want to take it to the next step - towards a feature complete version. For this I will need a chip to hold the software and control two RGB LED's as well as the sensor that I'll be using for user input. I've looked at specialized PWM chips that can control the different channels of RGB LEDs but in the end it's both cheaper and easier to just use the chip that the Arduino platform is based on - the Atmel 328's.

If you buy more of these, the price improves a lot. If you order enough, you'll actually get it near half the price of just a single one and this seems to be a rule of thumb for electronics in general. This is the difference between mass production and one-offs. If you sell enough of anything, you can make a lot more money.

MintDuino on the cheap

So what do you need to make your own Arduino then? Some time ago I picked up a MintDuino from MakerShed. It's a fully working Arduino - delivered in an Altoids tin (pictured above). This version comes with a breadboard, but how much would it cost just to get just the electronic components used? The content of the MintDuino box is almost the same as this list on the Arduino site that tells what you need to build your own minimal version.

So - what would it cost to build this using todays prices from Mouser.com? Here's the list for 1, 10,100,1000 and 10k units:

  1 10 100 1000 10000
22pF capacitor 0.249 0.249 0.195 0.143 0.104
22pF capacitor 0.249 0.249 0.195 0.143 0.104
ATMEGA328-PU 3.05 2.95 2.52 2.30 2.15
16Mhz crystal 0.529 0.455 0.27 0.227 0.208
7805 regulator 0.652 0.563 0.49 0.276 0.220
10 uF capacitor 0.109 0.073 0.06 0.055 0.046
10 uF capacitor 0.109 0.073 0.06 0.055 0.046
220 Ohm resistor 0.02 0.02 0.02 0.01 0.01
220 Ohm resistor 0.02 0.02 0.02 0.01 0.01
10K Ohm resistor 0.02 0.02 0.02 0.01 0.01
5mm LED (red) 0.086 0.079 0.063 0.052 0.044
5mm LED(green) 0.086 0.079 0.063 0.052 0.044
Tactile switch 0.162 0.14 0.097 0.078 0.071
 
Total price in $ 5.34 4.97 4.07 3.41 3.07

* I've since learned that apart from the lower price the ATMEGA328P-PU uses less power, thus the extra P in it's name. These are about $2.5 extra a piece, but probably worth it given the lower power consumption.

So - if you manage to sell 10k units, these will cost 57% of buying a single one. I dunno the price of the breadboard and the printed Altoids-tin, but it would seem that Makershed has a decent profit from this. It's still worth the money to their customers since they don't have to source the components and it's a great little project - in a tin. Keep in mind that the list above is just the MCU and the power regulator bits. You'll certainly need a few more bits to actually make something, but it's still facinating that you could build an almost complete microcontroller for just $3.

I don't know for sure, but I think it's sort of a rule of thumb that with the added packaging and parts, most kitmakers should have at least a 100% profit on what they sell. In other words - if it seems to the end user that the parts are about the same price as they would have to pay themselves to make the same, they may just as well buy it from you. So to use the example above - $6 would appear to be cheap for $3 worth of components. You could probably make good money selling it for more such as the neat $13 Diavolino kit despite the fact that a fully soldered Arduino Duemilanove only costs $15.

UPDATE: by August 2013, the prices in the table above have improved a lot, so the ATMEGA above would now be almost a dollar less for volumes above 100.

LED cube electronics

In my case, I won't need the 5mm LED's and the tactile switch in the list above, but I'll need a few other parts. I'll need the tilt-switch to turn the cube on/off, two 10mm diffused RGB LEDs, coin cell battery holders and an input solution. I'm not sure if the vibration switch from Sparkfun will do the job, but I'm quite sure that I can solve it with some sort of touch-chip. These are fairly cheap, but they'll require more testing. Should be fun!

So with all the parts I'll need (apart from the PCB) the electronics for each cube would cost $11 if I make just one, $9.35 if I make ten or if the unlikely happens and I have to make 10k of these - the electronics will only cost $5.55 per cube. I doubt that'll ever happen, but it's still fascinating to do the maths. Plus - if it did - I'd probably outsource the whole thing. I just can't see myself solder even a hundred of these by hand...

They do look pretty though, don't they? wink

Making a Blinky cube

17 Feb

Making a Blinky cube

Inspired by various LED cube projects, I wanted to see how long it would take to prototype a small interactive toy. The basic idea is to make a plastic cube that displays beautifully diffused light and uses a simple way to turn on and off. Tapping the cube with a finger could be a good way to do this and it also makes it possible to start different "color cycle programs".

Making the cube

My friend Jim at VariousArchitects (VA) has this really nice Makerbot standing around in our office. It would be a shame not to play with it a little? Maybe I could even find a complete cube on Thingiverse?

Turns out that nobody had done something similar, so I had to make the model myself. Through the years I've played with different 3D programs and lately I've used Modo a lot. After fiddling a while in both Modo and Sketchup, Kyrre @ VA suggested that I try Rhino. My friends @ pivot.no have always been big Rhino proponents and after some initial fiddling, I really started to like the software! Poor Kyrre had me pestering him with noob questions all eve, but the result turned out quite nicely?

Breadboarding the prototype circuit

Next I needed to make a small test circuit to see that I could fit the electronics. The final version will use some sort of ATMEL chip, but since the hardware is still on it's way (switch from Sparkfun and RGB LED's from Evil Mad Science) I had to just throw something simple together that would show me how the LEDs worked with the materials.

Using my newly aquired knowledge about the 555 timer, I set up a small breadboard circuit that toggles two LEDs. I added a couple of 10k pot's so I could change the blink speed. Looks like this would work fine?

Making it smaller

I can't fit a breadboard in the cube, so I made a copy of the circuit on a little piece of perf-board that I thought would fit inside the cube. It took a couple hours to fit it all, but I only had one incorrect solder (the 555 was the wrong way, duhh) so it wasn't all that bad. It also turned out quite small.

The blue dials are the pot's that'll adjust the blink-rate and the black tube on the top is a tiny switch that'll turn the circuit on/off based on the physical orientation.

Putting the pieces together!

Kyrre had printed the bottom of the box that evening so when I came to the office the next day - all that was missing was the lid and some batteries for the circuit. While the lid printed, I mounted two 3V coin cell batteries together (the 555 needs at least 4.5 volts to run) using some Gaffa-tape and wait for the lid to finish printing. The lid required that the Makerbot made some "supports" - extra plastic that you remove when the print is finished. I'm amazed by how easily these supports came off and the pieces looked really good! Now it was time to fit it all together.

The result

Below you can see a video of the completed bits. The LEDs are not very visible inside the box while it's daylight but they look lovely when it's dark. The video is a little blurry since I just used my iPhone, but it shows the result quite well. Very happy with it given that it's only taken about 1.5 days to get this far! Makes me feel comfortable taking the project to it's next step - using RGB LEDs that can run different programs and turn on/off with just a tap.

Thanks a bunch to Kyrre for helping me with Rhino and the printing and to Jim for letting me play with his toy! I've also uploaded the 3D model to Thingiverse in case anyone needs something similar. I've also posted some more pictures of this on Flickr for anyone curious to see more.

 

Arduino Companion - now out on Apple App store

17 Feb

Arduino Companion - now out on Apple App store

I knew about it, but it's facinating to experience firsthand the "Time To Market"-difference between Apple and Google. On Android, you can push things live on Market in a matter of minutes. Getting approval from Apple took 7 days. During that time I have received my first batch of feedback from Android users. I've gotten four 5-star reviews on Market, plus one 1-star review. The guy with the 1-star review didn't manage to install AIR on his handset for some reason. It hurts a bit to get a review like this when you're spending lots of time making something for the community to use for free, but it's better to know about the issue than not.

And - as my friend Paulo pointed out - export your app using Captive Runtime for Android. That'll include the correct version of AIR inside the app so the user never has to worry about it. It'll increase size, but reduce frustations so I'll certainly do that for the next version. Winter holidays and FITC Amsterdam is coming up now, but when I'm back I'll start working on the app again. I'll rebuild the views -system since I now know how I want it to work and I'll also add some more features. The plans are: a capacitor calc, a Volt/Ampere/Resistance/Watt calc and the first bits of a Hardware Reference!

Racing along with Make:Electronics

15 Feb

Racing along with Make:Electronics

Finally had a long day without other interuptions than snowboarding and dinner. Not shabby! Made the quiz-engine in Experiment 21 and even modified the layout so it was more user friendly. A tad annoyed that there's no breadboard-friendly SPDT-switch (single toggle between two states) in Make:Electronics Kit 2. I had some lying around, but it'd be nice if the kit was really complete and everything working. The two dead 5V relays yesterday were also annoying.

Experiment 22 was just a quick primer, but experiment 23 was a good reminder about how super-easy it is to use microcontrollers rather than IC's to solve a problem. While it's possible to represent a dice with 7 LED's using clever wiring, a counter chip and a NOR chip, it would take much more effort to take this to a complete LED dice kit. It's much, much easier to solve such tasks with a small computer like this one from SpikenzieLabs. It's still useful to see how this would be solved before, so I'll complete all the experiments as there's always something to learn from them.

Have also started to publish images of the finished and working experiments on my Flickr account as seeing pictures there saved me a couple times when I started out. A tiny effort that can help others a lot. Below is video's of todays projects.

Make:Electronics - Experiment 20

14 Feb

Make:Electronics - Experiment 20

Lot's of stuff to do other than play today, but I managed to finish experiment 19 - a "code lock" based on the 74xx series of chips. This part of the training is sort of a "repeat" in that I've read it so many times during school, however building circuits with it makes it a lot more fun. I couldn't complete the project entirely as the relays I got from Make didn't work at all (same for others) but the main part works like it should.

Really looking forward to tomorrow - I should manage at least two more experiments! :-D

Make:Electronics, experiment 18

13 Feb

Make:Electronics, experiment 18

Was able to spend about half the day on electronics today and did experiment 18 from Make:Electronics. Nice to learn about counter chips (4026) and 7-segment displays, but I really didn't want to do all the cabling for setting up 3 of these as I got the point. Hooking it up to a 555 timer went easy and I later added a pot and some resistors so I could adjust the speed just as I wanted. I also spent a lot of time just playing with components and measuring to see how things worked and how precise my meter was.

In the evening I got sucked up, browsing the Sparkfun and Seeedstudio sites for component bits I was missing and ended up ordering a bunch of stuff while I was at it. Anyone running an online electronics shop should learn from these. Having a "wishlist" feature made me order almost twice as much as planned...

Reading specs carefully before ordering...

Among the things I ordered were two RainbowDuino's from SeeedStudios. I already have two 8x8 RGB LED panels from them, but after a lot of browsing I realized that none of the chip vendors offer a good solution for driving these. I wonder why there's no I2C or SPI chips that do PWM for more than 24 channels? The best circuit I could find were the TLC5951 from TI and I would have to use eight (!) of these $5 SMD's just to drive one of the panels. Since they're SMD you would also have to make your own PCB, so it's much easier to just get the premade $25 solution from SeeedStudios.

Some time ago, I browsed the Sparkfun site and saw these awesome rubber buttons. I was SO bummed out when I got the shipment and realized that I had only ordered the rubber part - not the PCB, electronics, plastic covers or RGB LEDs. In a few days I'll have the complete 4 x 8 button pad here - at the total price of $136 and not the $19.90 that I initially thought. Now I'll just have to figure out what to use it for wink

Oh - and please do check out my brand new App - Arduino Companion!

Arduino Companion - my first app for devices is out

10 Feb

Arduino Companion - my first app for devices is out

Tonight I finally pushed the app out to Android Market and Apple's AppStore. It's already live on Market, but I guess it can take both days and weeks for it to hit the App-store? I hope others will find it as useful as I do. The idea of an offline Reference came about when arduino.cc experienced some server issues in January 2012. When I looked around for a way to browse the Arduino reference, I figured I could make something better than what was already available. I also had need for a Resitor calculator, so I've added that as well. That one I use many times a day thanks to my newfound hobby.

Making the app

I have lots of plans for new features I want in the app, but feel free to suggest improvements or new features in the comments. All sorts of feedback is very welcome! The app is pure Actionscript. I made parts of the app using Flex initially and the speed/responsiveness was nowhere near what I wanted. The data for the reference is structured using Expressionengine for easy editing/export. It took about 1,5 weeks to take the app to it's current state and more than half the time was spent on testing. Getting one app to work well across multiple screens is really quite a mess, so I hope I've tested enough?

The only known bug is that my Asus Transformer will report incorrect sizes when the app is rotated. It actually swaps the values for rotated and default orientation around? I only have this Android tablet to test on, so if you have an Android tablet and a few minutes to test - please do so and leave a message here. Apart from that bug, it works like a charm on iOS and Android. I haven't tested it on Playbook as I'm yet to receive from RIM the one I won just before GotoAndSki.

I'll probably spend some time getting it published to the other app stores as well such as Amazon, Nook and maybe also smaller ones like Samsung Apps. Any other suggestions?

Other apps?

While this is the first one that has been  published, I've also worked other AIR-based apps for devices. Next out will be my game project MineGunner and start to play with Genome2D. I had to take a break from that when I discovered that I needed hardware to get it where I wanted. The demos I saw of Stage3D / Genome2D at GotoAndSki totally blew me away! Who will need more than 6000 sprites running at 60fps on an iPad? Not me! :-D

Make:Electronics, experiment 15

07 Feb

Make:Electronics, experiment 15

Took a break from the app-project for a day with Make:Electronics. Experiment 15 builds on Experiment 11 where you make an alarm/siren using just transistors, resistors and capacitors. This part takes this a step further by adding reed-switches to detect a broken circuit (i.e. door opened) and then sound the alarm until the alarm is reset. Quite time consuming project, but loads of fun!

First you build the circuit on a breadboard, then you transfer it to a circuit board and finally you mount it in a box. Since I had taken apart the noisemaker circuit, I had to rebuild that first. I then added the new part - a relay that stays energized if the alarm is triggered. I then moved it all over to the circuit board, soldered up piece by piece, added power and - lo and behold - it worked on first try! Was a little proud there smile

Next up was mounting it in the case and that part certainly took longer than expected. I planned the layout in Illustrator, printed it out and stuck it to the box for drilling. I didn't have an awl, so I used a nail to punch indicator holes before drilling. This caused the case to almost crack, but I kind of saved it. Drilling holes and mounting components were quite easy, but on the next part I stumbled. Might be because it was too late at night (had such a blast that I forgot time!) but I couldn't make the circuit work as intended.

This morning I had another peek at it and I measured that the switch in the kit worked differently from the one in the book. Oh well. The cabling from the day before was a mess as well, so I wanted to clean it up. I added some header pins from my Arduino kits and some F/F breadboard cable for both the power socket and from the circuit board to the lid with all the switches & LEDs. Keeping things tidy like this made it so much easier to get things right. I guess hardware just like software - plan well and keep it tidy and you won't stumble.

The alarm is really retro. I remember my aunt having such alarms in her office 30 years ago. It's not really burglar-proof either as all you need to do is to cut the power, but I'm certain that the kids will have heaps of fun with it :-D