Jan 29, 2012

DIY Proto board

With the Arduino board, I'm using the proto shields very often. It all sounds good with the exception that I often have many ongoing projects and only two proto shields. On top of that I would like to start using the ATtiny and not only the Atmega328 and the UNO board is not made for the ATtiny.

The solution? Make my how proto board of course!

I wanted the board to be compact but still contain a mini breadboard so I decided to used one half of a mini breadboard.


To make things convenient, I also wanted to use a ZIF socket to easily change the micro-controller chip(s). Here are all the parts before assembly:


Part list:
1: ZIF socket 28 pin (~$2.95)
2: 8 pin female header (~$0.50 2x)
2: 6 pin female header (~$0.50 2x)
1: 5 pin female header (~$0.50)
1: 4 pin female header (~$0.50)
1: 16MHz Crystal (~$0.95)
1: Mini breadboard (~$3.95)
2: Capacitor Ceramic 0.1uF (~$0.25 2x)
2: Electrolytic Capacitors - 100uF (~$0.35 2x)
1: Voltage Regulator – 5V (~$1.25)
1: 9V Snap Connector (~$1.25)
1: PCB board (~$1.25)
+ some wires for connecting the components.

Total cost: ~$16.0

Here's the final product.


I'm pretty happy with it because it's small, it doesn't need a separate proto shield, I can use it with either 1 Atmega328 or 1-2 ATtiny(s) and the ZIF socket makes things a lot easier when switching chips.

Jan 24, 2012

Non-Accountability Platform

Everybody is talking about platforms. Here a platform, there a platform, everywhere a platform. Don't get me wrong, I love platforms but I'm not so sure that accountability is following at the same pace.

I suspect a trend might develop, if it's not already here. Some platform developers can say anything they want about the “supposed” capacities of their platform and the application developers will get the heat of any short comings.


Here's a typical situation that explains the problem: Company A promises a platform that will do X, Y and Z. Developer D starts making product on the evolving platform with features dependant on the eventual existence of X, Y and Z. Company A delivers X on time but delivers Y too late forcing overtime on Developer D, resulting in bad feature integration. Also, in good measure, Company A doesn't even bother delivering Z which is part of a central feature of Developer D's future product. The fun part is that Company A doesn't have to publicly announce its short coming(s) because people will blame the developers for 'not using the platform the right way'. The only point of comparison for the public is the original 'promise' of the platform and, since the BIG company didn't change the specs, it must be the small developer's fault.

For contractual reasons, the developers can't say much in a situation like that, so they bite the bullet secretly dreaming of a magical land where truth and honor means something.

So... dear platform developers, please do these two simple things:

  • Don't promise impossible things
  • Publicly come clean with the 'real' specs and defend the developers

Jan 15, 2012

Arduino and Micro-SD logging

Getting started with Adafruit's Micro-SD Breakout Board in 2 minutes.

Wiring
Wiring the Breakout board is very simple.
  • Connect the 5v pin to the 5V pin on the Arduino
  • Connect the GND pin to one of the three GND pin on the Arduino
  • Connect CLK to pin 13
  • Connect DO to pin 12
  • Connect DI to pin 11
  • Connect CS to pin 10


Picture shamelessly taken from its home at adafruit.com

Programming
To use the Micro-SD you need to include the SD.h library at the top of your program.  Then add the following line of code to your setup() function:

SD.begin(10);

Now you can write something on the card:

File logFile = SD.open("log.txt",FILE_WRITE);

if(logFile){
   logFile.println(“Hello World!”);
   logFile.close();
}

Finally, while humming the MissionImpossible theme, you can power off the Arduino board, take the Micro-SD card out, put the micro-SD card in an SD card adaptor, put the SD card adaptor in your laptop and look at your new file.

Muha ha ha ha ha.

Note: I used this in my last arduino/bluetooth project.   

Arduino Bluetooth Link


In a previous Arduino project, I used the BlueSmirf Bluetooth Breakout Board to communicate with my Android phone. There was absolutely no special code on the Arduino to handle Bluetooth since, by default, the BlueSmirf is set as Slave and will accept any connection call. The phone app was doing all the work.

The next logical step was to use the BlueSmirf interface by programming the Arduino. Using a second Bluetooth board, I decided to create a link between two autonomous Arduinos. To make things interesting, I've set a couple of rules for the project. I wanted to heave the same code on both Arduinos and have the whole connection process be automatic. I also wanted the Master device to scan for other devices, retrieve the MAC address, connect and send data.  Here's the video of the final result:



My biggest issue started with the Sparkfun proto shield for Arduino. It has a built-in socket for their Bluesmirf device. Nice marketing move! This socket is hardwired to use the Arduino pins 0 and 1 for communications. It all looks good until you need to use it in the real world. Here are the pros and cons:

Pros:

  • No wiring needed to connect the Bluesmirf board.
  • No extra library needed to do serial communications.

Cons:

  • You must remove the Bluesmirf breakout board every time you need to plug the Arduino board in the computer. Why? Because of the hardwired Bluesmirf socket the Arduino board communications are mixed with the Bluesmirf interface.
  • Another consequence of the previous problem: You can't used the USB serial output to the computer to send debug info. That is really annoying when debugging your project.
  • The power is always ON for the Bluesmirf.

I'll fix this by using different pins for the Bluetooth communication using the NewSoftSerial library. I will also modify the Sparkfun Bluesmirf socket to use any communication pins and to have control on the power usage.

For more details continue reading after the break. (Warning! Geeky stuff about code and electronics)