Archive | April, 2019

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!


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.


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.


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.


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 :)


Custom PCB’s with Fritzing

27 May13

Custom PCB’s with Fritzing

If you've played around with Arduino, you have most probably seen these nice and clean images of circuits that have the Fritzing logo on them? Fritzing is a PCB design program that I really enjoy working with. It's visual, intuitive and very easy to get started with.

At Bitraf (the hackerspace where I have my office) most of the other electronics geeks have a preference for CadSoft's EAGLE PCB design software. It's an impressive program, but it's also one of the least intuitive pieces of software that I've ever used. It's made by engineers - for engineers. While I have an engineering education, I'm not designing enough electronic circuits to feel comfortable with Eagle.

I've now used Fritzing on three different commercial projects and I'm quite sure I'll use it on many more. Here's one of my breadboard prototypes, with the finished PCB from Fritzing (the white board) to the left of the breadboard. As you can see, it simplifies the prototype quite a bit:

I did this project for my friends at and you can now view the installation at Oljemuseet in Stavanger. The plan was to make a PCB with a LED driver chip that could drive 2.3" segments. We only needed 7-segments, but we loved the colors emitted by these that can be bought from Evil Mad Science. They also had suitable MBI 5026 driver ICs and we love Evil Mad and their work.

The initial plan was to hook up 2 x 12 segments and then use an Arduino to fetch the numbers to display from a web service. The numbers were to constantly show the current number of people on the earth as well as the number of tonnes CO2 released thus far this year. During the project, we switched to using Rasberry Pi's instead since the Arduino network stack isn't exactly asynchronus and that made the numbers freeze while fetching updated data. Was great fun to use Python for a project!

How Fritzing is different

As opposed to Eagle and KiCad, Fritzing starts where YOU do - on a breadboard / perfboard. You just place the components in Fritzing, just as they are in your prototype. This breadboard view (step 1 below) is  unique to Fritzing and it makes it incredibly easy to make professional looking PCB's. The next step (2) is to create the schematic. I normally don't spend time on this unless I need to publish schematics, but I rather move straight on to the third view - the PCB layout (3) like in this example.

This is how the circuit above looks in Fritzing:

(Click to zoom)

I normally route the PCB by hand and it's a really swift process compared to how it's done in other software. Any cable that is connected in the breadboard view (1) must be routed on the PBC (3). If it's not, you will get errors when you run the "Design Rules Check" (DRC). This ensures that your circuit is electronically sound, but it does of course not compensate for human errors. If you forgot to add a connection in the Breadboard view, it will be missing in the other two views as well.

When you're happy with the PCB, you can either export to images (great for showing how to connect circuits), the Gerber format RS-274X (for PCB production) or as PNG/PSD for manual etching. You can also export a Bill Of Materials (BOM) so others can see what they need to build your circuit. Very nifty!

Fritzing Fab

The company behind the Fritzing software also offers a PCB creation service called Fritzing Fab. Here you just upload your Fritzing file, set the amount to order, pay and 10-14 days later you'll receive a white envelope with your own PCBs. These are not the thickest quality available, but they're solid enough for mounting with screws. They're two-layer boards in white with a brown/grey silkscreen and you can put pretty much any graphic you want on the designs.

Since the program exports to Gerber, you're not limited to using the Fritzing Fab service, but if you want high quality and stylish looking PCB's this is a very good option. It's not the cheapest PCB service out there, but I absolutely love these white PCBs. You can order just a single PCB to test a design, so there's no minimum. The more PCB estate you use, the less the price. It's not shabby at all for German-made quality. Another thing that can be a crucial factor when comparing to other PCB services, is that Fritzing can cut the board to any shape, with any number of via's and mounting holes for no extra cost. Other low-price services will not even make mounting holes or break up the boards.

Drawbacks of Fritzing

Anyone that have used Eagle or KiCad will say "Fritzing isn't professional enough" since it looks too simplistic, but that's just plain wrong. The software is very capable with two key exceptions that may be important to some.

  • The Auto-router is just crazy. It can spend forever without finding obvious routes from A to B. If successful, the routes look pretty weird. They're not something you'd be proud of showing to others.
  • While there are a decent set of standard components in the package, there's many components that are missing when it comes to SMD parts. Apparently it's quite hard to design new parts, so that limits people from creating more

There's a couple other minor annoyances as well:

  • It closes the entire program if you close the last sketch
  • I still haven't made an etchable PCB that worked well, but I'm sure that'll improve with time.

For me, Fritzing solves most of my PCB creation, but as soon as I want to use SMD parts, I'll have to change to Eagle. I do however think it's a great software to create your first PCBs with. I've now placed 4 orders with them and I'm sure I'll place many more.

Advantages of Fritzing

For a noob making his/her first PCB, Fritzing is ideal.

  • Great user interface
  • Easy to use
  • WYSIWYG breadboarding to PCB is so much better than making schematics
  • Constantly updated and improved
  • Custom PCB shapes with the Fab service is also a big plus (for me at least)

You can find the Fritzing file attached (Open Hardware licensed). Below is a picure of the final installation of the project that these were used in - mounted inside a big sculpture of the earth.


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

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 - 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 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 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 (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.


Heated Build Platform for Ultimaker

19 Jun12

Heated Build Platform for Ultimaker

Note: updated description available here! While this is written for the Ultimaker, it should also work the same for any RepRap printers with similar RAMPS electronics.

One thing I disliked with using a Makerbot was it's dependance on printing with ABS plastic. ABS comes from fossil fules and is thus a limited resource. PLA usually comes from Corn and is thus fully renewable and to some degree also biodegradable. This was one of my main reasons to get a Ultimaker in the first place, but then it dawned on me that the 60 degree celcius melting point for PLA was going to be a problem for many of my projects. I had to make my Ultimaker capable of using both plastics: PLA for prototyping and ABS for lasting models.


When you are printing with PLA, all you need is some blue painters tape to print on. ABS however, won't stick to that. In addition - ABS requires that you keep the model warm while printing and ideally it should be allowed to cool off slowly to avoid cracks due to the material shrinking. How warm the heated build surface should be will vary a little based on the plastic, but I found these tables in the Makerbot Wiki a good reference. 110-120 celcius seems to make the ABS that I use stick well.

You can also use a heated surface for PLA, but then you keep it at about 70 degrees celcius. A nice plus when printing PLA on a heated surface is that it requires virtually no force to remove the model once the surface has cooled. What I needed was a Heated Build Platform (or HBP for short).

What and Where

How does one make such a thing? The RepRap wiki has many suggestions but after reading through all the links, there was one design that really appealed to me. It's basically a PCB that barely has any components, but rather lots of copper. When power is applied to the PCB, the copper turns hot - just like in an electric oven or a hair dryer. 

This PCB was designed by Josef Prusa and it's a perfect size for the Ultimaker (20 x 20cm). It also has a feature that I appreciate - it's made for 12 volt operation so no need to mess with AC electricity that could kill you! There are many similar methods used in various industries today and if I didn't want to use 230v, I'd probably get the SRFG-808 from this site (GBP 44).

Josef's design is called MK1 but the wiki also contains an alternate version here is a derivative version with a hole in the center. This one is called MK2. These both work the same, but there's really no need for the hole in the middle. This description should work for both though. After reading some warnings and sad stories from people that bought "cheap" PCB copies on Ebay, I decided to get a MK1 from a reputable supplier that would also give a little back to the creator of the PCB. I didn't find any good tutorial on how to set the heated bed up, so I figured that I'd write how I did it for others to find.

The nice thing about shopping from companies like Ultimachine is that they know what else you need. I also picked up a 100k Thermistor with PTFE sleeving from them to measure the temperature. I also picked up some 100mm Kapton tape for covering the print surface. You can also use thermistors with 10 or 200k resistance or a thermocouple based on AD595. Thanks to Daid's great Marlin Builder, you can adjust your Ultimakers firmware to reflect the correct hardware. Speaking of Daid - if you're not using his Cura software for your Ultimaker - you're missing out Big Time. To me it's been the difference between a good purchase and a bad one!

The Power Supply that comes with the Ultimaker cannot drive both the machine and a heated bed. Due to this, most others have gone the path of adding an additional power supply. Some have even replaced the existing one, but due to the limited space beneath the Ultimaker I had a hard time finding one that could both fit inside as well as provide a decent airflow to keep things cool. What I ended up getting was an external power brick that could deliver 12.5Amps of 12 volt. The PCB only pulls 10A maximum so I figured that would be sufficient. Having two power bricks isn't "sexy", but it does not require any big changes to the Ultimaker's stylish wooden body and it does not add more noise. Also - they had one at my local computer supply store, so I could just pick it up. It's a little pricey at GBP100 / $150 but I still like the solution.

So I had the heating element, a way to power it and a way to measure the temperature. Now I just needed a way to turn it on and off when required. I was thinking of building my own solution, separate from the Ultimaker. The Streacom PSU had both 5v and 3.3v so I could easily add an Arduino Mini to control the heated bed. I would need a screen or at least one 7-segmentd display, some buttons for control and with this I could even pimp my Ultimaker by letting this control some RGB LEDs. Yeah. That's what I'll do! I ordered a bunch of components from Adafruit and Sparkfun, but as I waited for these it started to annoy me that I couldn't combine this with the Ulticontroller.

I started digging and it turns out the Ultimaker PCB had lots of what was needed. There's a connection for the thermocouple and a PWM output with a solid MOSFET… I wonder if that couldn't drive a standard relay for a car? I picked up a 30 amp relay at my local car supplies and it worked like a charm with the 19 volt output of the Ultimaker. I got great help from this Instructable measuring the Relay. The relay cost $6.50 and I also got a nice socket for $4 that I could use for simple mounting and replacement (if required).

This is how the end result looks and below is a tutorial on how to do this yourself.

Bill of Materials

Here's the list of components I've used:

  • MK1 PCB. See RepRap wiki for suppliers. ($50 from Ultimachine)
  • 100k Thermistor ($2.75 from Ultimachine)
  • Streacom 150 watt external PSU ($150 at my local PC store)
  • 360 watt industrial type PSU from Ebay ($50 with shipping)
  • Relay + relay socket with cables. Make sure it's a 5-pin one, so it's both open/closed. ($10.50)
  • ATX 24 to 20 pin conversion cable ($8 at a local computer store)
  • 25 x 25cm plywood piece, 10-12mm thick, as flat as possible ($2 at a woodshop)
  • 24 x 24 cm sheet of 4 mm glass with 4 holes spaced 209mm apart ($30 at my local glass-shop)
  • A 4.7k resistor
  • A few 3mm o-rings (rubber gaskets) that fit the holes in the glass sheet
  • Four 4-6cm, 3mm bolts
  • Some 3mm nyloc nuts, washers and other spare parts that came with your ultimaker
  • Kapton tape


  • multimeter
  • basic soldering kit
  • Drill
  • Having an Ulticontroller is a huge plus for reading the temperature

Alltogether, the cost for my heated bed was about $150. I also could have saved a little by not getting holes made in the glass but rather use bulldog clips like Josef Prusa did. That would have saved a few dollars as well, so the total cost could have been as low as $100. Also note - these prices are from Norway ( = everything is expensive) so your bill will probably be lower than mine.


So - how to put this together then? It's not hard at all and I've also made some custom 3D parts to make it easy to mount the hardware.

1. Print the adjustment screw pieces

Printing these before removing the old build platform will save your fingers later on!

2. Drill 8 holes in the plywood square

Make 4 holes (3mm) that match the position of the adjustment screws of the original build platform. Then make 4 holes that match the position of the holes in the PCB. Make sure you drill all these very precisely or it won't fit.

3. Remove the old platform

Remove the acrylic and unscrew the screws. Save the screws as you'll use these later.

4. Mount the new adjustment screws

Take one long screw, one nyloc hex nut and one plastic screw-handle (eye-shaped) and put these together. These provide a solid adjustment screw for the bed and the screw-handle makes them much easier and precise to use than the hex-wrench. Once all four are put together, screw them into the delrin holes - but this time screw them in from the bottom. Using an electric screwdriver/drill is recommended. Tiresome!

5. Mount the PCB on the Plywood

For this, you can use the old "adjustment" screws. I put a hex-nut between the Heater PCB and wood, and another hex above to keep things in place. On top of this, I added a washer. In the picture below I've also added the springs from the old setup. Don't do this. It was just an experiment. O-rings are smarter.


6. Mount the Thermistor

It is nice to have a way to measure the temperature before you hook the Heater PCB to it's power. There are two things to do here. First you need to solder a 4.7k resistor on the Ultimaker's PCB. Unscrew the Controller PCB and take it out of the machine. The resistor should be added where it says R4 on the Controller PCB.

Next, make two wires that are about 70 cm long. These should be of the standard, thin type used in the rest of the machine. Guide the cables down through the rear, right cable duct. Connect these to the outer two pins on the connector marked "Temp 3" (as shown in this picture). Next, put the fan-thingie back on the Ultimaker Controller PCB. If you forget this, you'll easily destroy it.

Connect the other end of the wires to the Thermistor. I used a 2-pin terminal block as the thermistor can be hard to solder due to it's ability to withstand high temperatures. Now it's time to turn on the Ultimaker and test it! To do this, you'll need a custom firmware version. I assume you already use Cura for slicing and printing your models? Then you already know that Daid makes some great software! Making the custom firmware is really easy with his Marlin Builder script. Be careful to not adjust anything you don't know what is… Under "Heated bed temperature sensor", select the sensor you got. There are several 100k thermistors in the list, but if your isn't listed (or even marked in any way) just go with the "100k thermistor" option. If you have the Ulticontroller, check that one off the list as well and click the "Build Marlin" button.

At the top of the page there will now be a download link for a ZIP with the windows install file (that I used), as well as the .HEX file itself. Once the firmware is updated, it's time to test! If you have the Ulticontroller, you should now see another temperature reading and if you touch the temperature sensor, the display should change to reflect that you are (hopefully!) warmer than your surroundings. If you want to test it at higher temperatures, stick the thermistor to the printers extruder-head and set a new temperature with the Ulticontroller.

PS: Don't worry about the heat damaging the thermistor. It should be rated for more than 300 degrees and you should not go above 240 to avoid blocking your print head with burnt filament… Just test that the temp is fairly correct up to 110-120 as that's the highest you'll need to go.

7. Mount the relay

Solder a couple of wires (about 80 cm) to the heater PCB. According to this chart, these cables should be no less than 1.3mm thick to carry 10 amps safely. I used 2mm to be on the safe side, but that's probably not required. Guide the cables down through the rear, right cable duct as you did for the thermistor. Don't pull all the cable to the bottom as you'll want to be able to move the Build platform up and down without pulling the wires.

Next up is the Relay. I used an automotive relay since I know that they are made to withstand a lot of power and they are dirt cheap. Any relay rated above 10A(mperes) should be fine as long as the voltage is more or less the same as the 19v the Ultimaker will output. Autos use 12v and are rated for 30A so that should work for most relays.

Measure the relay according to these instructions and make a note of what color the different cables are and what they should do. If you got a relay like the one I got (5 cables), there will be_

  • Two cables where you apply power to close the relay (connected to the Ultimakers output)
  • The two cables that will be connected when the relay is closed (external power goes through here)
  • One unused cable

In the linked tutorial, the first two are referred to as COM and NO. On the relay that I was using, these are referred to as 86 and 85:

Between these, you should be able to measure a connection but the resistance should not be very high. Connect these to the Heated Bed output, close to your Ultimakers power jack.

On my relay (see below) the pin marked 30 is common and pin 87a is the normal position. When I measured these and found a fairly high resistance (as indicated in the tutorial). That meant pin 30 amd 87 should connect when the relay became energized. So by simply connecting one of the cables for the heated bed through pin 30 and 87, the Ultimaker would toggle power on/off as required.

8. Prepare the ATX connector

It's not much that you need to do with the power supply itself, but you'll need to tweak the ATX conversion cable a little. Start by cutting off the 24-pin side of it and then remove the wires you don't need. Since the PSU has some amperes to spare and it's easy to keep the 3.3 and 5v cables, I saved some of these in case I want to add an Arduino for some custom lighting or something. According to what I've read, the pins in the ATX connector are rated for 6A each, so to safely use 10A I connected two grounds and two 12 volt together. 

Yellow = 12v, red = 5v, orange = 3.3v, black = ground (ref)

9. Testing time

Make sure you re-attach the fan over the Controller PCB and then flip the Ultimaker over to normal position. Now you can test if you connected it correctly by setting the heated bed temperature to something above room temperature.

If you are using the Ulticontroller, just select the Heated bed from the menu. If you don't have the Ulticontroller, you will need something that can connect to the printer and send it commands. Both Printrun and ReplicatorG can do this. In Printrun, there's a separate window for entering commands directly. In ReplicatorG, you just make a new file, type the command into the gcode-tab and then send it to the printer as you would when printing. The command to send is:

M140 S70.0

This should set the temperture of the bed to something near 70 degrees. When the Ultimaker reads the Thermistor to be too cold, it will apply power to the Heated Bed output and close the relay. When the relay closed, I could measure a decent resistance from pin 30 to 87, but no longer from 30 to 87a. The connection was confirmed! My next step was connecting it all to the Heatbed PCB, place the thermistor on the Heated bed and test the complete setup.

Note: Since 1.5.4 of the electronics, the Ultimaker has a 55A MOSFET on the heater connection. This should be sufficient to switch the power to the bed directly, but I don't know enough about electronics to confirm this. Using a relay is within my scope of knowledge, it's totally clean and also separates the two completely in the case of an error. It would be great if someone wiser than me could comment if direct switching is now possible!

I tested thoroughly and measured with an IR thermometer what components became hot as the bed heated. On the tiny PCB that distributes and converts power became hot after 3 hours continous heating. It's the square, black component that becomes warm - about 70 degrees. I made a mounting bracket for attaching it to the bottom of the Ultimaker and on this one, I added screw-holes for a 20mm PC fan. These can be bought in any computer supply store. They operate at 12 volt and it keeps the ATX connector at room temperature even when the bed is constantly on for 10 hours or more.

10. Mount it all on the Ultimaker

Once you are sure the electronics work as intended, you can wrap up the build. First, secure the electronics in place beneath the Ultimaker. For this purpose I've made some more printed parts. Make sure that the holder for the ATX-plug-holder is printed in ABS and not PLA (so it handles heat better). You just slide this one onto the connector and screw in place a 20mm fan. Connect the fan directly to the 12v lines on the connector, drill the one missing 3mm hole under the Ultimaker and fasten the holder with some of the 3x10mm spare screws that came with the machine as well as some nylock nuts.

Next, mount the power jack. This requires some drilling to get perfect, but I'm quite happy with the result.

When this is in place and the cables have been adjusted a little, it doesn't look too messy beneath:

You can see the connections more clearly in this image (click for full rez):

I mounted the 4.7k resistor on some header pins to see if I could get more precise temperture readings by tweaking the resistor values. In the end, I ended up going with the 4.7k anyway so I should probably remove the headers and solder it permanently.

Put the plywood/pcb on to the adjustment screws. Cover the glass plate with kapton tape and put it onto the PCB. Adjust the height of the Heater PCB screws, so the top is flush with the glass surface. Add o-rings (rubber gaskets?) between the 3mm screw and the glass. This ensures that the glass lies steady, but still can expand a bit as it gets hot.

Next we need to make sure the bed is entirely level. The standard rule about being able to pull a sheet of paper between the print head and the surface applies. Move the print head around the entire surface to make sure it does not touch the glass/kapton surface.

Adjust the length of the wires for the Heater PCB and the Thermistor. Make sure to leave some centimeters of wire so that the platform can move all the way up/down without pulling the cables.

That's it. Set the temperature of the bed depending on your plastic type and print away!

The result

The Heated Bed works just as intended and I'm very happy to have it all working. Before doing this, I thought that the constant clicking of the relay would drive me crazy bt it's really no problem. The printer itself is so loud that it's merely a drop in the ocean. The setup has been working non-stop for almost two weeks now. For PLA printing, it's simply fantastic. Models stick like glue when the platform is at 70 degrees, but come loose very easily when the platform cools off.

For ABS, it works but it's not perfect. It takes about 10 minutes to get up to 100 degrees. This is decent, but quite a long time. To get to 110, it's even longer and I can just barely go beyond that. The thing is that I need the bed to go to 110 and maybe also 120 for the ABS to stick properly. Now, it works fine for models that have a large area of contact, but smaller models often come loose since the plastic isn't sticking well enough. Due to this I'm now experimenting with closing the gap around the build surface using high-temperature silicone. This looks good so far, but I'll update here once I get to test a little more.

Update June 23rd 2012:
Closing the gap around the Heater PCB gave no measurable effect! Have to say I'm a bit stunned by that one. It takes just as long to get up to temperature and it's just as hard to go higher. I guess that means that my Power Supply is too weak. I'll test this with a computer PSU and update here later.

Update July 25th 2012:
Tried with a 450 watt PSU (12V/16A) and found no noticable difference. Could it be that I need to bundle the two 12V lines? Thinking aloud: 12V * 16A = 192 watts. Multiplying this with two seems like an idea, but I'll need to find documentation on how this PSU (KDM-1UFX425) is built then. I don't want to start a fire...

Update 3 August 2012:
Turns out that my idea of maintaining some distance between the glass and the PSU wasn't such a good idea after all. When testing with a different PSU today, the glass cracked since the glass was bigger than the PCB and thus wasn't heated equally. I have a spare 20 x 20 cm glass that I'll fix to the PCB with bulldog clips like all others do. I have those already.

Update 5 August 2012:
Turns out I simply did not have enough power. Instead of using the 120 watt Streacom PSU, i will be using a 360 watt industrial type PSU (12V / 30A) that I got from Ebay for about $40 (plus shipping). You can see this PSU in the image below. The drawback of this one is that I sort of have to deal with 220 volt, but it's quite well protected so it's not scary in any way. I will also have to print some feet for the Ultimaker before mounting this permanently as it's a little too tall (5cm), but it'll fit nicely just behind the front of the machine. This PSU also has the extra power to drive LED's and such so I can now "pimp" my Ultimaker a little more ;-)



RGB LED - Common Cathode or Common Anode?

05 Mar12

RGB LED - Common Cathode or Common Anode?

One of this things I initially found odd about electronics is how it's not really about the 5V plus and ground, but rather the difference between plus/minus. Some components like diodes and electrolytic capacitors will only allow power to flow one way, so direction matters when you're ordering your RGB LEDs.

For my cube project, I've gotten some nice, diffused 10mm RGB LEDs but I didn't really pay attention when I ordered them, so when I started playing around tonight I was fumbling with what to apply to wich LED leg. So for future reference - here's the rule:

  • A RGB Common Anode LED should have it's longest leg (leg 2) connected to the 5V pin on your Arduino (Current sink)
  • A RGB Common Cathode LED should have it's longest leg (leg 2) connected to the ground pin on your Arduino (Current source)

In both cases, you'll connect the R, G and B legs of the LED to IO pins on your Arduino through some suitable resistor (200-330 Ohm) to not burn out the LED. So when should you get what version? Your Arduino can drive a couple of RGB LEDs, but you only have 7 PWM channels and you can't draw more than 40mA from each of these. If you want to drive more LEDs using for example shiftout, you'll need custom driver chips like the TPIC6B595N (that I've used before). This chip can only SINK power, so you should use it with Common Anode LEDs. In other words, a little research may be required.

Most of the tutorials you'll find out there are for Common Cathode RGB LEDs, but I eventually found one showing the Common Anode setup as well.


The economics of electronics

19 Feb12

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 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? ;-)


Making a Blinky cube

17 Feb12

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 @ 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.