Archive | September, 2018

Making a scale for Arduino with INA125

03 Jun13

Making a scale for Arduino with INA125

For the recent project I did at EIS (The Energy Centre at Hunderfossen Amusment Park), I needed to build a scale. As kids walk around the exhibition, they're answering questions and at the exit there is a cool-looking scale. Here you select felt-bags based on your answers and their weight decide if you got the earth (or rather scale) in balance.

I picked up a couple Load Cells from Ebay and thought they were like the many other analog sensors that I've used. It turns out that a Load Cell does output a signal, but it's really weak. To get the signal I needed, I had to find a suitable "Load Cell Amplifier". After some quick searching, I realized that these come in many flavors and industrial versions are somewhat expensive ($200 and upwards). I did some more digging and found this nice little board from LeoBodnar as well as a nifty IC: the INA125. This is an IC that does exactly the required amplification for $7.

The premade board was nice and easy to mount, but I wasn't happy with the resolution I got from it. Since it has no adjustment options, I'd have to read up on the IC, get the correct SMD components, desolder and resolder. It seemed easier to build the circuit myself and with this great article as a guide - this is the circuit I made:

My Load Cell has other colors, so signal+ cable is blue, signal- is white, 5V is red and GND is black. I've seen load sensors with colors all over the spectrum, so make sure you have this documentation before buying from Ebay. Later this week I'll head up to the Hunderfossen Amusement Park to mount this modified version that gives me pretty much all the levels I want by just changing a single resistor. Not bad!

The image at the top is the finished version with screw-terminals on a proto-board (click to zoom). Below you can see how the scale looks like up at EIS:

 

 

Project: pressure sensitive floor

28 May13

Project: pressure sensitive floor

I just came back from the most challenging physical computing project I've ever done. It's a 13 by 8 meter labyrinth where you walk in the dark and get a sensory experience based on more than 300 sensors. The main challenge was actually how much time it took to execute it, but it was such a fun project that I didn't really mind. You can now try it out yourself at Energisenteret in the theme park Hunderfossen (Troll-themed!) near Lillehammer, Norway. I don't know for sure, but I think this is the worlds first "pressure sensitive floor"? (video further down)

I've worked on several projects with the company SixSides and about a year ago, they asked me if I could build a floor that reacted to the people walking on it. The basic idea was to play back sounds of walking on other surfaces than you really were. Of course I said yes to the challenge!

Researching

My first idea was to make a button-matrix that sensed where you stepped, but after making a quick prototype I realised that this wouldn't create a very believable experience. Then it dawned on me that it would be MUCH more fun if it was actually pressure sensitive. During this project, I've played around with different conductive fabrics and it's been a blast! I really cannot praise the company PlugAndWear (Texe srl) enough. They're simply the best source of conductive fabric that I have found and they ship crazy fast from Italy to Norway (2 days!).

This is how you'll receive 14 meters of conductive fabric!

One of the many products they have is called Velostat. This material has a very unique property - it's resistance decrease with pressure. It does so in a way that if you just put a layer of Velostat in between two conductive layers, it will give you about 800 levels of pressure for an adult person stepping on it. If the person weighs more than 90Kg, you will most probably be able to read out the remaining 200 levels using the 10-bit analog inputs of an Arduino.

So I knew that Velostat was a good idea, but I needed a conductive layer both at the bottom and above and one of them should perferably lift up to ensure that there was no contact if pressure was not applied. Copper tape is a really good conductor, so I figured that I could use that as the bottom layer. It is easily taped to the floor and you can solder onto it quite easily. You can get this at multiple locations. I found mine at a shop for artists that make glass paintings.

The upper layer was more difficult. I eventually settled for the fabric called "Doubleface knitted conductive fabric" that has a polyester-thread layer and a stainless steel-thread layer that are knitted together. In my tests, this has stood up to quite a bit of physical abuse so I'm pretty sure it'll last quite long before being fully compressed. The only drawback of such a fabric is that it's really hard to work with, given how different these two layers and velostat are. I tried sowing these together, but it was incredibly hard to get the fabric to stay straight.

Prototyping

After settling on Velostat and the knitted fabric, I started prototyping and this is what I ended up with:

I tried various methods for making the sensors, but the most lasting solution seemed to be using textile tape from Tesa. Just tape together a layer of the knitted fabric ( with the steel side up) onto the Velostat. My only problem was of course that this was a manual job and I needed 300 of them. More about that later.

Above the sensors there were to be a floor of some sort. I did my test using Linoleum, but we ended up using a softer floor covering. I also used Fritzing to make a custom PCB for this (download below). It's not that it was really required, but it made the installation look professional and simplified the mounting a lot.

Building

Since my prototype was just one of the 7 strips required for a full meter, I really had no idea how much work was required before I started. I ended up spending two full weeks (14 hr days!) on making two 1 by 3 meter floors. This is how the process looked like:

First add 4mm plywood to put the sensors on, making a sort of cable-duct in between them. This ensured that the soft, silicone-covered cables were not too exposed to the constant pressure of people walking on them.

Add the copper tape…

Solder the copper tape to the 5V output of the Arduino Nano's…

Connect the cables to the analog inputs of the Arduino Nano's…

Mount the handmade sensors and secure them to the floor with two-sided tape. Then connect the analog input cables (using the grey tape) and repeat for another meter…

After this has been done to the entire floor, I put sounds on the SD cards, programmed the Arduino's with their sound-cards and mounted them along with some suitable speakers.

Result

I'm really happy with the result! The finished floor is so sensitive that I can sense a soda-bottle cap falling onto it! The sound playback happens the instance you put pressure on the floor and it really seems like you're walking on ice or other things. Selecting the correct sounds is of course a difficulty, but it's easy to adjust this. It's just files on a SD card after all.

I've also written the software so that wear'n'tear on the sensors won't affect how the installation work. They don't use the real pressure-level, but rather changes in an averaged level. If a floor tile becomes fully compressed so it no longer produces level changes, you can just rip it up and tape down another, so maintenance is easy.

The floor consists of 40 strips of 15 cm width, each with an Arduino Nano measuring up to 8 sensors. The complete installation is using 55 Arduino Nano's as well as sound cards from Gravitech. I opted for these since they're small and thus easy to mount. They're also very easy to get replacements for if that should be required.

Lessons learned

During the project I've learned a few things:

  • I now know that I should have used a much wider copper tape rather than three separate ones. Each one of these needs a soldered joint. Having just one rather than three, would have saved me 600 solder points and it would have been just as good.
  • Another thing I've learned in the project is that building a small prototype really does not cut it. You need to build a bigger prototype to correctly estimate the amount of work required. In the end I spent about 16 hours on each meter of pressure sensitive floor. My estimate was just a third of this, so since this was a fixed price project I didn't exactly become rich. If I do a similar project, I'll definitely insist on hourly pay or get somebody else to do the actual construction of the floor.
  • I'm using .OGG formatted files. MP3 files will add a few milliseconds of silence at the start of the sound and in this case, it ruined the experience. The OGG format does not have this problem.
  • The next time I design electronics that require multiple similar resistors, I'll definitely look into using a resistor-network instead.
  • Plan ahead for the carpentry and expect lot's of adjustments as the project progress…
  • Making the pressure sensor tiles took forever… Help is required if you do something like this, so a big thank you to Liv @ Sixsides for helping me out!
  • As soon as the walls are closed, it's a lot more work to get cables to the right spot, so make cable ducts that are wider than expected.
  • Arduino's are really solid for use in installations, but poor quality USB cables will affect both sound and stability.

Despite taking a long time, this has been a fantastic project! I really loved to do the whole thing from concept, research and realisation. It's so many other things one could use such a floor for, so I can easily see people building similar things as inputs for games and music. It also involved lots of other sensors (touch + distance + movement), but I'll do a separate post on those at a later time.

If anyone is interested in such a floor, I also have several ideas for how to simplify and industrialise the production of such floors, so feel free to contact me :)

 

My first PCB - a DS1307 based realtime clock

14 Mar13

My first PCB - a DS1307 based realtime clock

The last months at Bitraf has been quite hectic in terms of workshops & activities. First there was a soldering workshop that I helped put on, then a PCB design workshop and that was followed by a PCB etching workshop. I also organized our third 3D Printer Meetup there. Peter, Trygve and Carl at the hackerspace has now gotten my dad's old Roland CNC to drill all the required holes in a PCB based on the Eagle files, so it's really possible to make nice things at Bitraf these days.

My first PBC, an RTC for Arduino

When an Arduino looses power, it's clock will always start in 1970 when it gets power again. For a client project I'm working on, I needed the correct time after a power outage. It was easy to find several RTC's online and they all cost something between $5 and $10. My problem was that getting it fast would be expensive and I happened to have the most used IC for this purpose. The DS1307 used in most of these modules is about a dollar each and the remaining components are not much either. Here's the Bill Of Materials along with links to where I bought them:

1 x DS1307

1 x 32.768 Crystal

3 x 10k resistors

1 x 104 capacitor (0.1 uF)

1 x 2032 battery holder

2 x 6-header pins

All together this is about $2 in parts, even for a very modest volume. Not shabby and I highly recommend both TaydaElectronics (Thailand) and Spiratronics (UK). Both are great shops that ship quickly to places in Europe and I use them a lot in addition to ebay.co.uk.

Designing it

I looked online, but couldn't find something that others had made that was "free to use" and I had an idea: why not make it plug straight into one of the header rows on the Arduino? That way it would be real plug-and-play since both power and the analog pins used for i2c are on the same side. Above you can see how this turned out - it plugs right into the Arduino Ethernet shield.

I looked up the reference design and looked at how others had done it before and then made a first go in Eagle. After a couple fails (I forgot to "fill" with ratsnest + had counted the pins incorrectly) I got a couple nice looking PCB's.

Making it

The etching went really well and with all the helpful people at Bitraf, it's not hard to get this right. I drilled this one manually, but I'll definitely use the Roland CNC as soon as we have a good way to cut consistent PCB sizes. Here's how it looked after cleaning with Acetone:

I didn't have the required clock crystals, but I got these from Spiratronics in just 3 days. Today I soldered it up and plugged it in. Guess what - it didn't work… I looked over the PCB with a magnifier glass and cleaned up some excess solder along the traces and it still didn't work. Bummer. I went online and looked at how Adafruit did theirs and then it struck me - I had put the IC on the wrong side of the PCB.

Using it

After doing this, it worked like a charm! I used the Adafruit 1307 library and it works just as I hoped. I'll definitely make a couple more of these for other projects and so can you! Below you can find the Eagle schematic + board and here's the final stencil to use for the etching.

See more pictures of the PCB etching process on Flickr

 

Meetup Pocket Sign

08 Mar13

Meetup Pocket Sign

My brother is thinking about going back into the signage business and as he would start up his own company, he'll need to build himself a network. My favorite way to connect with people and communities these days is Meetup.com - a website that help you host meetings with ease. So - I set out on a mission to help people remember my brother and what his company delivers.

I've long wanted to do something with the neat little 1.8" LCD screen I picked up from Adafruit some months back and looking through their site I found that they also have this neat Lipo charger as well as slim, matching batteries. What if I made a small LCD-sign that he could drop in his pocket? I ordered the components and started modeling.

About a week later, the parts arrived and I modified Adafruit's example file a bit to load images one by one from the SD card beneath the screen. That gave me a simple, but effective slideshow. All my brother needs to do is to to change the contents is to make some BMP images and dump them onto the SD card. Easy!

After a few iterations I came up with this case. The part containing the battery is not the slimmest, but it's also meant to go inside your shirt pocket. I could have made it slimmer, but then I would have to sacrifice battery time. With it's 1300mhA battery pack, it lasts 2 hours on one charge and charging it takes a little less than an hour. I could have saved a little space by skipping the proto-board that lies in between the electronics and the battery, but it made mounting things and getting the USB-port right for charging. I might remove that if I do a next iteration.

The part that is visible on the outside of the pocket is much slimmer and it looks like the red and white Meetup.com logo. It took quite a bit of fiddling to get the case right. I learned that by slanting the print 28 degrees while printing, a lot less cleanup was required.

The supports came off really easy and printing the parts like this actually made them much stronger and easier to glue together in the end. I usually use PLA plastic for all my 3D printing, but for this I used ABS since it can be grinded and polished (PLA can't). Towards the end of the project I didn't quite get the time required, but it was a fairly polished thing I gave away. It took me 4-5 evenings to make this project and I think it was worth it. I could of course have bought a CD or something from a shop, but this was a personal gift that (as far as I know) nobody has. Much more fun!

Here's a shot of junior showing off the final sign and if you want to make your own - grab the files on Thingiverse and components from Adafruit.

 

A two dollar programmable FM radio

07 Jan13

A two dollar programmable FM radio

It's been ages since I posted anything on electronics, even though I keep playing to learn more. I also frequent dx.com quite a bit and a fun little thing I picked up was a $2 radio-curcuit-board. It's a fully programmable FM radio that is 11 x 11 x 4 mm in size. As usual with electronics from China, the website barely says anything about the product. You just have to buy one and see if you can make it work.

The circuit came without any documentation, but Google is your best friend. The datasheet was all in Chinese, but thanks to Google Translate I figured out that this circuit was very similar to many other implementations of the TEA5767 radio chip. These chips all have the same pin-density as ZigBee modules, so I soldered on some ZigBee-headers to make connecting it easier. As you can see from the picture above, my cables were all over the place. Below is a cleaned up sketch of how to connect the TEA5767 radio module from dx.com (click to view full size). The audio amp obviously goes in between the speaker and the TEA5767 output.

The TEA5767 can be controlled using either Serial or I2C, so it's really flexible. It's not very powerful, so you'll need an audio amplifier to hear anything. I used an Adafruit MAX98306 amp breakout that I had from a former project. I won't get any style-points for this setup, but I'm glad I got it to work almost right away. This instructable made the code part really easy. Using a 10k pot to control the frequency also highlighted that more than 10-bit resolution would be nice (for better precision) or maybe one should rather use an encoder? Good learning fun anyway. Here's a vid of it working.

 

Tutorial: making Gravitech’s MP3 Player add-on work

08 Dec12

Tutorial: making Gravitech’s MP3 Player add-on work

Gravitech is the company that created the Arduino Nano, one of my favorite Arduino's for prototyping. These are really tiny, but fully breadboard compatible. Just pop it into a breadboard and you're ready to start making things.

The obvious drawback of this size is that it can't use standard Arduino Shields, but Gravitech has made their own line of "shields" for the Nano form factor. For a recent project I'm evaluating the MP3-shield and I quickly discovered that Gravitech needs to update the links on the product page as this board can no longer use the code suggested (they've done it now).

Making it work

The reason it could use the Sparkfun example, is that it's using the same decoding chip (VS1053) as Sparkfun's MP3 Player Shield does. This is a great chip that can not only decode MP3, but also play back Ogg Vorbis, AAC, WMA and MIDI. It can even encode audio if connected correctly. 

The problem with the Sparkfun example is that the required SdFat-library has changed. There is no longer a file called "Sd2PinMap.h", so you can't do the crucial setting for selecting the SD card. To make the Gravitech MP3 Player add-on for Arduino Nano work, you have to do a few things.

Step 1: Do not download the SdFat-library

The Sparkfun example starts off by saying that you should download and install this from the official URL. Do not do this. We have an easier way.

Step 2: Do not use the Sparkfun example

Instead, use the MUCH better SFEMP3Shield library maintained by Bill Porter (and others). Click the ZIP-download button on the GitHub page (or use GIT if you know how). Unzip the files and place the two folders named "SdFat" and "SFEMP3Shield" in the "libraries" subfolder in your Arduino sketches folder. If this folder is missing, just create it yourself.

The "libraries" folder should be in the following location:

OSX: /Users/username/Documents/Arduino/libraries/

Windows: C:\Users\yourname\Documents\Arduino\libraries\

If you are using the Sparkfun MP3 shield, you can skip the next step. If you are using the Gravitech shield, we need to edit a file for it to work. Do not start your Arduino software yet.

Step 3: Edit SFEMP3ShieldConfig.h

This file is in the "SFEMP3Shield"-folder that you just copied. Open it in a text editor (NOT a word processor!) like TextMate/Textwrangler on Mac or Notepad on Windows. Locate the lines that says "#define GRAVITECH". This macro was added after I first posted this, so now it's really easy to set it up. Change this:

#define GRAVITECH 0

into this:

#define GRAVITECH 1

and save the file. That'll set up the library for the Gravitech MP3 player. What this changes is what the SD_SEL variable (for selecting the SD card) is set to a little further down the same file.

Step 4: Declare the required pins as OUTPUTs

Unless your code explicitly declares the pins of this shield as outputs, you'll get problems with "floating grounding". Some pins will flickr between 1 and 0 and this will prevent the SD card from initializing. Sometimes you'll be able to make it work by just holding the pins, but this'll be random and not repeatable.

The error you will get is something along the lines of this:

Can't access SD card. Do not reformat.
No card, wrong chip select pin, or SPI problem?
SD errorCode: 0X1,0X0

To fix it, just add these lines at the top of your code (at the start of void setup() )

  pinMode( 2, OUTPUT);
  pinMode( 3, OUTPUT);
  pinMode( 4, OUTPUT);
  pinMode( 6, OUTPUT);
  pinMode( 7, OUTPUT);
  pinMode( 8, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);

Pin 10 isn't used in the shield, but since the shield is using SPI, it should always be declared as an output.

Step 5: Play audio!

Start the Arduino software and click the Open-button. Locate the SFEMP3Shield-menu and open the example  "SMP3Shield_Library_Demo". Make sure your Board/port settings are correct and compile. Open the Serial Monitor for instructions on how to use the example. When you've got the grip on this, study the example to understand how you can implement this into your own app.

Why use SFEMP3Shield rather than the old lib?

As long as you remember to use the old fashioned 8+3 character naming convention (ABCDEFHG.ABC) this library is really good. Many of the Arduino-libraries out there are written by people that don't understand the general Arduino audience. They are overly complex in both implementation and use. The SFEMP3Shield-library is MUCH better written than the original libraries from Sparkfun. All the complex options are hidden and you're left with easy to use commands such as setVolume, playTrack, setPlaySpeed and much more. You can also access the ID3 tags of the MP3's you're using such as trackTitle, trackArtist and trackAlbum.

If you for some reason run into problems, you can find a good description of Error Codes and other troubleshooting on this page

 

 

 

How to update the official Arduino Wifi Shield

02 Nov12

How to update the official Arduino Wifi Shield

I spent most of yesterday eve at Bitraf trying to make the official Arduino Wifi Shield behave properly as there is a bug in the firmware that it comes with. One of the Bitraf members has a cool project that involves remote control of servos. He planned to use the Wifi Shield, but it kept loosing it's connection at random intervals - no pattern to it.

As I have the same shield, I tried to figure out how to download and install the new firmware from GitHub. I couldn't find any good description on how to do it, so here's how I did it on OSX. It'll be quite similar on Windows and Linux.

1st Download the files from GitHub

Go to https://github.com/arduino/wifishield and either download the ZIP, or use GIT if you're familiar with that. If you're using git, open terminal and navigate to the folder you want the repository in. Here's how I did it:

mkdir wifishield
cd wifishield/
git init
git remote add wifishield https://github.com/arduino/wifishield.git
git pull wifishield
git checkout master

The installer expects the files to be inside the Arduino-app folder. Copy wifiHD.hex, wifiHD.elf and the other files from the wifishield/firmware/binary folder into /Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/firmwares/wifi-shield/ (or where you have your Arduino app).

 

2nd Grab the Device Firmware Updater

Next is getting the software we'll be using since AVRDUDE does not work with the 32UC3-chip in the wifi-shield. Check out this page http://arduino.cc/en/Hacking/DFUProgramming8U2 for details on installing this on your specific platform. For OSX, it should have been easy like this:

sudo port install dfu-programmer

However, instead we got this:

Error: The installed version of Xcode (2.0orlower) is too old to use on the installed OS version. Version 4.1 or later is recommended on Mac OS X 10.8. So off we went to Apple to get the new version.

Apparently Apple thinks that minutes after releasing XCode 4.6 was a great time for maintenance. Yay… Some hours later, the download commenced and we got it installed. Next we had to install the XCode command line tools we were finally ready to go…

3rd Set the jumper

Plug the USB Mini cable into the shield. You should not upgrade the shield while it's mounted on an Arduino.

To program the shield, you'll need to enable a jumper. This puts the chip in DFU-mode that enables reprogramming it. There is no "J3" marking (mentioned in documentation) on the shield, but there is also only one jumper there so you can't go wrong. Just place it across the two pins and you're ready to go. If you fail to set this jumper, you'll see an error "dfu-programmer: no device present" since there is no programable device connected.

 

4th Upload!

You'll use a script from the GitHub download to do the actual uploading: https://github.com/arduino/wifishield/blob/master/firmware/scripts/ArduinoWifiShield_upgrade_mac.sh Move to the correct folder and then run the script as below:

cd /Fra PC/arduino/wifishield/firmware/scripts/ArduinoWifiShield_upgrade.sh
sudo sh ArduinoWifiShield_upgrade_mac.sh -a /Applications/Arduino.app/Contents/Resources/Java/ -f shield

Explanation: "sudo" means run as the computers registered superuser to avoid any permission-related problems. Your Mac will ask for your admin password when you run this. "sh" is short for "shell" and means that the following file-name should be executed as a script. "-a" and what comes after sets the path to the Arduino app and finally -> "-f" tells if you want to upgrade the shield-software or the main CPU it runs on. Unless something goes wrong, you'll see a message saying that says "Validating" and that it's no less than 101.44% finished :-)

 

5th Remove the jumper

Once the upgrade goes through, remove the jumper and set it on just a single pin. That's it. Not hard once you know how to do it and have all the required software installed. It's however a far cry from the simplicity we're used to with Arduino. Maybe they'll find a smoother way to solve this? Also something VERY interesting we discovered that isn't documented - if you have connection problems with this shield, make sure you don't use/set PIN 9! It's not documented as being in use, but something definitely goes on with this pin. The PIN also has it's own LED (marked L9) on the shield and it flickers weakly during use of the shield so something undocumented is going on there.

I have to say that while it's fantastic to have an officially supported Wifi shield, I don't really appreciate that it takes up the PWM pins 10, 11 and apparently 9 as well. I'd much prefer I2C or a more configurable solution like for instance the Adafruit Wave Shield offers. Marking what pins are used directly on the PCB is also a great help for users.

We also figured that the Atmega 32UC3 chips are not too expensive, but the WiFi chip on this shield is $20 even in fairly big quantities. While this makes the shield quite expensive, it's probably worth it's steep EUR 69 price. Keep in mind though - with an Arduino UNO, the total setup is 89 EUR ($115). A Raspberry PI and a wifi dongle is much cheaper. In fact - you can even get Adafruit's complete PI-kit for only $105! Have a look at the picture above comparing both solutions and you'll see that they're both small in size, so depending on your need - maybe it's not an Arduino you need?


Here's some useful links I found while researching this:
http://mitchtech.net/arduino-usb-hid-keyboard/ (good info on the DFU programmer)
http://arduino.cc/en/Hacking/DFUProgramming8U2 (Official page on installing DFU for other platforms)

UPDATE: here's a link to Massimo's writeup

 

 

JY-MCU Pro Mini (made in china)

21 Oct12

JY-MCU Pro Mini (made in china)

Some time ago I bought a dirt cheap Arduino Pro Mini clone from dx.com just to see if it worked. I didn't use it until today, but it works pretty well. It has one major drawback - it uses a non standard FTDI-connector in that it does not use the CTS-pin. It took a little time to figure out how to map this, so above is an image (click to enlarge) of the cable I made and below is the table of the pin mappings:

Adafruit FTDI Friend pin JY-MCU pin
GND GND
CTS -
VCC VBUS
TX RX
RX TX
RTS DTR

I have a Sparkfun FTDI adapter as well and this one is marked DTR instead of RTS, but it's otherwise similar. One thing to note - while the board itself is 3.3V there is no problem to use a 5V FTDI programmer with it. The board itself can run on anything from 3.3V to 12V so it's quite a flexible board. Earlier you could access the website of the makers of this board to access technical documentation, but now it's gone (or hard to find).

Now - about the ethics of buying china-made Arduino's. I feel that I can't post this without discussing it with myself a bit. I really don't like buying stuff like this from China and the reasons are:

  • You don't get any support if something fails
  • Documentation is non-existant
  • Nothing is given back to the Arduino project (like Adafruit and Sparkfun does)
  • I really should buy locally and not from Asia if possible

Buying this board was just a test, but would I buy more of these? Yes and it really comes down to price and how Open Hardware works. I recently delivered the first part of my first commercial project based on Arduino and electronics. For this project, I'll need to make something like 50 similar units that respond to a sensor.

The prototypes were based on Arduino Uno's and if I buy these locally I'll pay $43 per microcontroller. The Uno's are rather big so I'll certainly use something smaller for the production phase. If I do the project based on Arduino Pro Mini's, I'll pay $26 per MCU if bought here in Norway. I could also buy them direct from Sparkfun and with shipping, VAT and customs handling they'd be $22 apiece. Not shabby.

However, for such projects I wouldn't use off-the-shelf solutions. It's better to make custom boards specifically for the purpose and these would be something like $10 for the PCB and components - not including the soldering. I've done this several times now for personal projects, using only through-hole parts and soldering them by hand. In other words - a project like this wouldn't really be of any benefit to the Arduino project anyway, because it would simply not be the right way to solve such a project.

I really love working with through-hole and DIL parts, but of course SMD is even cheaper than that. Here's the crux - with the low price, free shipping and how the customs limit in Norway works, I can get the chinese clone-boards for less than $9 apiece. I can't even buy the SMD parts for that price, let alone solder them. Maybe the answer to this project would be to make a custom board with Arduino Pro Mini header-inserts?

Update: I'm not entirely sure, but I think this may be the website of JY-MCU? It is crazy slow so it's definitely a chinese website… If you just wait 5-10 minutes, you'll actually find what I made above at the bottom of this page.

 

Arduino Serial - a real retro-arduino

26 Apr12

Arduino Serial - a real retro-arduino

One of the worst (and best things) about learning about electronics and microprocessors is that you get obsessed with buying components. I maintain a full list of what I've ordered/received and it's quite a collection. These days I'll be up late at night scouring online electronic shops and ebay for things I need (or might need, are nice to have or even things that I really don't need at all...). It's turned out to be a fascinating hobby, but it's not really expensive either if you compare it to things like Golf, cycling, cars or other things the guys my age start buying :-)

Those that know me well, will know that I have a desire to know as much as possible about things and Arduino is no exception. One evening I was browsing around for things to buy, I stumbled onto this site called Emartee. It's a well updated site that also has some of those obscure things such as really well put together Arduino starter kits. These would be great for both a workshop as well as further explorations. These base components cover what most people need while exploring and just add a servo, a display or the sensors of your choice to get a full kit.

A retro Arduino

Some months ago, I found a Portugese shop that still offered the random colored PCB versions of the Duemilanove (2009). The Duemilanove is great to have around for burning bootloaders as this can be hard to do with the newer Uno boards. However - while browsing Emartee I found something that looked older - it said that it was a Arduino Diecimila Kit but it looked a little different. According to the Arduino overview of older boards - the Diecemilia (means 10k in Italian) was supposed to have a USB connector but this package had a good old Serial cable with it? I bought it on impulse - just to see what it was.

Today the gear I ordered arrived and boy was I surprised! In an antistatic bag there was a PCB that said "Arduino 1.0"? In the bag was no ATmega168 chip as it said on the Emartee site, but rather a Atmega8? This was fun! After some googling I now know that what I bought is a kit to build the first version of the Arduino Serial - designed in 2005. I had initially planned to relax and solder this up tonight, but I think I'll just keep it as a bit of Arduino history. I don't have a PC with the required Serial port around the house so I couldn't use it even if I wanted.

However - it's hard to find pictures of this and it's a little bit of computer history so I took some pictures of the kit and PCB and posted it on my Flickr account. Feel free to re-use! (CC)

 

Updated ADXL345 library for Arduino 1.0

13 Apr12

Updated ADXL345 library for Arduino 1.0

Today I've been playing around with SMD soldering using a tiny little touch-sensor called IQS158. I got hold of a soldering kit from Proto Advantage for MSOP-10 and started soldering away. When it came time to test it, I realized that I had never really used I2C before, only SPI. Aw bummer... How to figure out if my soldering actually works? Then I remembered that I picked up a triple axis accelerometer breakout from Sparkfun some weeks ago. I could test with that one and then base my code for the touch sensor on that?

The breakout is based on the ADXL345 chip and supports both SPI and I2C. Sparkfun only had SPI examples, but I found a link to Builder.org on the product page that had a the perfect I2C tutorial for my breakout. It was based upon a library that wasn't updated for Arduino 1.0. They have a patched version in the article, but I did my own patch to learn and posted it to a new Arduino repository on GitHub. I'll place all my code in this one from now on.

In the repository, you can also find a "bare bones" example file that is using the breakout/ADXL345, but without the entire library. This file only prints the x/y/z coordinates to Serial, but it also makes it really easy to see how much value the library adds such as detecting taps, freefall and lots of adjustment options. 

Now it's time for dinner and then I can write some code to test if the tiny IQS158 survived my SMD soldering attempt (it's next to the breakout in the picture - just 3mm wide!)