17 Nov 2011

Building a battery pack for 35W HID canister light - part 1

I had a bit of luck recently and got a 35W HID canister light from a friend for a good price. His was broken and he had already bought a new one, so I had a go at it. The lamp and driver curcuit seemed to be working, but the battery pack was dead. Anyway, building a battery pack should be a doable build, so I bought it from him.

Canister lights are high powered lights often used by divers, a very popular choice is to use 21W HID bulbs (HID - High Intensity Discharge - the same type of bulbs used in modern cars as head lamps). The one I got is a quite powerful 35W version (some people even use 50W versions - butmostly for video lights).

(download)

The original battery pack was basically 6 rectangular Li-Po 10 Ah cells, connected in 2 series with 3 cells each (and balance charger circuits + undervoltage/overvoltage protection). They were similar to these from batteryspace.com (which also sells exactly the same protection circuit). The original pack gave the light about 5.5 hours runtime, I thought about making a similar pack - but I rarely need that much runtime. Most of the dives I do are only 45-60 minutes long. Instead of going the dangerous Li-Po road (check out youtube, these things explode and burn if handled incorrectly)

.. and the batteries in the videos are usually much smaller than the large 20 Ah pack the canister originally had. I decided to go with the much safer NIMH (nickel–metal hydride) cell route. NIMH are much less energy dense per unit of weight, but much easier to handle and doesn't need elaborate protection circuits. Having a heavy canister is actually good for diving, it just replaces weights I would have to bring in my belt anyway. I looked around for different cells that could work for my canister, 4/3AF (1.2v 4500 mah) seemed interesting, but in the end I settled on Sub-C 1.2v 5000 mah cells from Tenergy (Propel).

(download)

My goal was to build a pack with about 10 Ah of umph at 12 volt.. So 2 series (10 cells each) in parallel would give me 10 Ah 12 volt. Having large parallel series can however be a problem.. if one cell in a series short circuit internally, then the other series would dump all it's power to it (massive overload). To avoid this I plan to isolate the series using a beefy schottky diode, and also charge them seperately.

(download)
I built the pack using 6 rows of 3 batteries (soldered together), and the final two batteries added to the middle. Cut out some plastic lid for top and bottom, and then heat shrink wrapped it all. At the moment I've used some old JST connectors, but I'm waiting to get XT-60 connectors as the JSTs are running a bit too warm for comfort when the light is on.

Acc62

For charging I bought two pretty cool microcontroller based chargers from Hobby King: Turnigy Accucel-6. They charge pretty much everything you throw at them - and they only cost $23 each!

Img_0765

I've just finished some runtime tests (HID lamp submerged in the kitchen sink), the series have been running for about 1h20m each now. I have not received the diodes yet, so no parallel connection. Anyway, I should have at least 2 hours and 40 minutes of runtime - probably even more (you shouldn't discharge the cells below 0.9v, but there are still around 1.1v left). I'm guessing I should be able to get 3 dives out of this thing when it's fully charged.

Next step is to add XT-60 connectors, diodes, and try it out on a dive :)

15 Sep 2011

Algorithmic bluetooth tenderloin

K7im7189-up
We had a tapas night at my place recently with all the usual suspects such as bacon & dates, blue cheese & shrooms, etc.. In addition to this Magnus brought over a large piece of beef tenderloin because he wanted to try out my SousVide-O-Mator. To cook a steak medium-rare the temperature to aim for is 54.5°C, while medium is reached at 60°C. We wanted it closer to medium-rare than medium. The machine was set at 55°C, and left until it would converge on the set temperature. We added the beef (and a bell pepper for some reason.. just to experiment I guess..) and waited. A couple of hours later (you can find the safe temperature vs time (pasteurization time) for your meat over at Douglas Baldwin's site).

The end result is what you see in the picture (not the best picture though, but we wanted to eat it - no time for posing..), we seared it quickly in a pan to kill surface bacteria and to get that nice brown maillard effect. Evenly pink, very moist and very tender.. :)

(download)

I've added bluetooth to my controller thanks to a $6 module I found at goodluckbuy.com, this means that I can control it wirelessly and follow temperature graphs from my macbook.

 

17 Aug 2011

SousVide-O-Mator

K7im7155

Sous Vide (french for under vacuum) is a cooking technique where food is sealed in airtight plastic bags and submerged in a water bath held at a specific temperature. Cooking sous vide usually takes a long time, but it has the advantage that the food is cooked perfectly evenly, you are able to heat a steak to the exact same temperature through out the entire piece of meat. A cut through a normal steak cooked on a pan usually reveals a gradient going from brown/gray to pink/red in the middle - less heat penetrate to the middle, so when the inside is medium rare the outside is usually well done++. A cut through a sous vide cooked steak looks more like the above - constant color and consistency through out the entire steak (the steak is normally finished (very quickly) in a frying pan to caramelize and kill any surface bacteria). The result tastes really great, and it's hard to mess up - you can leave a steak in the water bath for hours without any problems. Cooking in a bag preserves so much of the moisture in the meat, and the long cooking time breaks down a lot of the connective tissue - leaving you with a perfectly cooked steak that is super-moist and tender enough to eat with only a fork.

 

Sous-vide BabyTop

Photo by FotoosVanRobin - CC BY-SA 2.0

 

A professional sous vide setup costs at least >$1000, so it's a bit out of reach for the normal home cook - except for the DIYers.. It's not that hard to build yourself if you put your mind to it. What you need is the following components:

  1. Water bath with a electric heater.
  2. Some method of circulating the water.
  3. A way of accurately regulate the heater based on water temperature
  4. Some way of plastic bag packing you meat.

Water bath with heater is easy enough, there are tons of items out there that does this - slow cookers and rice cookers for example. I use a simple rice cooker, the cheaper/simpler the better (we're going to cycle it's power on/off, a dumb cooker will behave better facing a power loss). To circulate the water I use a simple ebay aquarium pump (payed $9.90 for mine). To pack the meat in airtight bags you can either buy a cheap vacuum-packer or simply use zip-lock bags (fill your sink with water, add meat to bag, submerge bag in water but keep the opening above waterlevel - pressure from the water will press out all the air, seal the bag..) 

That's the easy part, the hard part is regulating the heater to accurately hit a specific temperature. A simple thermostat won't do, because of the long dead time in such a system - you end up with a cycle overshooting and undershooting the target temperature - this is a job for a real PID controller (proportional–integral–derivative controller)


A PID-controller monitors a system and tries to bring it to a specific state by providing a output value. For example, monitors the temperature of a water bath and tries to bring it to exactly 60 degrees celcius by regulating a heater. The forumula consists of three terms, first the gain - how hard to press the pedel to accelerate to a certain speed based on the current speed. The second part is an integral, looking back, how fast where we changing when we applied this much pressure to the pedal in the past.. Third term is a derivative trying to predict the future, when do I need to stop accelerating to be able to make the next turn.

Implementing such a formula seems straight forward and only requires a few lines of codes - but there are surprisingly many things to concider and special cases to deal with when implementing it - read more about it at Brett Beuregard's blog. Brett has made a nice library for atmel microcontrollers (arduino based), you can find it here: PID v1.

So what I have done is to make a microcontroller based PID controller. It's based on an Atmega 328p chip running the arduino bootloader, it has three buttons and an 4x20 character LCD to handle user interaction. And a DS18B20 one wire temperature sensor to meassure the temperature of my water bath and a SSR (Solid State Relay) to cycle the power of the rice cooker on and off.

It's a fairly simple build, all of the components can be bought cheaply on ebay or electronicsshops like futurlec.

If the video doesn't work, click here: 

See schematic and pictures of the setup below:

Bill of materials:

  • Atmega 328p (futurlec)
  • 3 Buttons (ebay)
  • 20x4 LCD (ebay)
  • Solid state relay (ebay - Futek) - you might need a heatsink, i use the metal plate in my enclosure.
  • Contrast potmeter
  • LED
  • 16 mhz crystal / ceramic resonnator
  • Basic resistors, capacitors, transistors
  • Enclosure, preferably with metal backplate (ebay..)
  • 220 IEC input and output sockets (futurlec..)
  • DS18B20 temperature probe (ebay..)
  • Stripboard (ebay)

In total I think it cost me around $30 to build it (not including the pump and rice cooker), not too bad. You could easily make it cheaper by using simpler items - do you really need a 20x4 LCD? 

The source code is available at Bitbucket, please feel free to use it for whatever you want: https://bitbucket.org/seikeland/sousvide/overview

Note that the schematic doesn't include power curcuit and programming headers.

I've built the controller into a simple case (w/ metal backplate) I found on ebay. If you have a powerful heater you should concider adding a heatsink to the SSR, they can get hot when switching large currents. With the metal-backplating, my 350W rice cooker never even make the SSR go above room temperature. See pictures of the case and setup below:

(download)

Future work:

  • It needs a bit of calibration (the gain, integral and derivative) to avoid initial overshoot and small ocillations when changing load.
  • Add bluetooth, I have a small bluetooth to ttl module I can connect to get wireless serial (to interface it with pid controller gui)
  • Add internal power supply, should be enough space in the box for a 5v transformer.

Stay tuned for more posts on how to calibrate the beast :)

Also, check out eGullet for more information about cooking Sous Vide (temperature tables.. recipes.. safety concerns..)

20 Mar 2011

MSP430 Coffeetimer

The MSP430 is a familty of cheap microcontrollers from Texas Instruments featuring ultra low power usage. TI offers a devkit with everything you need to get started (USB-based development board and 2 microcontrollers from the value line) called the MSP430 Launchpad. The killer - it's dead cheap - $4.30 for two microcontrollers and the launchpad including shipping (fedex!). You can also probably manage to get a few MCUs for free as samples. TI is probably selling the kit at a loss really trying to get into the hobbyist market, which is primarily dominated by the Arduino (and to a lesser degree Atmel in general and Microchip Pic). I was very impressed by the power usage, a guy managed to run them for 10 weeks as a clock on a couple of capacitors (granted - 10F caps).

(download)
Anyway, I have a 1 hour safety timer connected to my coffee maker (one of those devices that tick down and cut the power after one hour). Being a really cheap device from a low cost "wallmart" like shop I guess it was no surprise when it broke. It doesn't tick down anymore, seems like the motor burned out - it's mostly mechanical with a disc rotating one revolution and then cut the power by physically hitting a switch. I liked having the extra safety this device provided - and wanted a new one. Figured it was a good chance to learn some MSP430 programming. Turning the coffee maker on and off using a relay would be pretty simple, but I really don't want to fuck with 220V mains and leave it without supervision (which probably also voids my home insurance).

I have a few radio controlled Nexa power switches (which are CE certified), so I hooked up one of the MSP430 microcontrollers from the launchpad kit to a remote with a few transistors. Programmed the microcontroller to sleep and wait for a interrupt from small push button, on interrupt it turns on the coffee maker (via the remote - connected with two transistors) and starts a timer. The timer blinks a led every now and then before turning off the coffee maker one hour+ later. Put the whole thing in a small ikea plastic container with 2 AA-batteries, which should last severals years if the MSP430 is as power efficient as they say.

(download)

There's a few gotchas when programming the MSP430s, for example the watchdog timer.. The MCU features a watchdog that resets the device after a short time (VERY anoying..), unless you disable the timer - it's on by default. Other than that it was more or less straight forward. You can either use the supplied eclipse-based code composer from texas instruments (proprietary and windows only) - or the open source msp430-gcc toolchain (runs on both linux and mac).. Code written in the code composer will probably not compile using msp430-gcc, there seems to be different syntax for defining interrupts - and intrinsic functions often have different names and functions depending on which compiler you use. I've tried both, the TI software nicely integrates a debugger that can step through lines and instructions in the IDE as they are running on the chip - Spy-Bi-Wire (pretty awesome feature for a $4.30 pricetag). For the open source toolchain you can use mspdebug to open a network port where you can connect using gdb.. providing you with more or less the same features, but it's way more cumbersome to use gdb than a IDE-integrated debugger.. But then again, I don't often use a debugger (even for normal software - my method of debugging often involves throwing prints everywhere), so I guess having to not run the proprietary IDE in a virtual machine is worth the loss of the IDE integrated debugger.

Also, setting up the internal timers required reading quite a lot of TI documentation, more so than other microcontrollers I've tried. The community using it is also small and there are few libraries available. But anyway, got it running - and now it turns on and off my coffee maker.

In conclusion, I don't think TI will make that big of an impact on the hobbyist market with this, the alternatives are easier to use, have better documentation, usefull libraries and less cumbersome development tools. But then again - it's a really cheap way to get started on MCUs.

Posting the coffee timer code as a future reference, maybe some of the boilerplate code can be useful for others as well.

 

17 Mar 2011

Moved the blog..

Moved the blog to the hosted posterous.com blogging engine, keeping Wordpress updated for a rarely used blog is a pain in the ass and a potential giant security hole (swizz cheese comes to mind..).

10 Jul 2010

På nye windowseventyr i nettbokland

Jeg kjøpte meg en liten nettbok nettopp, av typen 10" Asus EEE PC 1005-PE sak. Tanken er å ha den som reise-pc, noe lite og lett på rett over en kg som også proklamerer 14 timer batteritid (om dette stemmer gjenstår å se, men det virker ganske lovende så langt). Selv med reiseforsikring må det være sinnsykt kjipt å miste primærlaptopen (som dessuten begynner å få ræva batteritid), så da slo jeg like greit til og skaffet meg en sånn.

Jeg har aldri prøvd Windows 7 før, så jeg tenkte jeg skulle gi det en sjanse, den kommer tross alt med det ferdig installert. Så jeg starter maskinen.. og taster inn opplysninger etterhvert som den spør om det, maskinen starter på nytt.. vi er på start nummer to.. den driver med noe så spennende som "Initializing.." i over 20 minutter før den starter på nytt.. vi er på start nummer tre.. Windowslyden sprer seg gjennom rommet, skrivebordet synes! .. og den tar en ny omstart.. maskinen starter for 4. gang..

Endelig er den oppe å går etter 4 starter og 40 minutter med venting fra jeg trykket på knappen - og dette er før windows update har fått tatt sine runder, en herlig positiv brukeropplevelse å bli møtt med for en stakker som meg som er vant til OS X:)

Men før jeg får sukk for meg så skjer følgende, en "SUSPICIOUS ACTIVITY DETECTED"-popup fra Trend Internet Security (sparket i gang av all den preinstallerte bloatwaren som ligger i bakgrunnen og nå skal oppdatere seg). Jeg får 4 slike på kort tid. Her er jeg altså en blodfersk bruker i win7-land og får skumle sikkerhetsadvarsler om japanske eboklesere i trynet, man kan bli paranoid av mindre - eventuelt helt motsatt :p (Er det rart folk bare trykker NEXT/ALLOW på alt uten å lese noe som helst? man blir jo møtt med dette fra første stund).

Neste steg.. bli kvitt Trend og alle bloatware-vennene, det er maaange av dem..

Chicken Invaders 2 got to go! + minst 20 andre.. Når dette endelig var unnagjort var tiden kommet for Windows oppdateringer.. 30 stk av dem.. hurra :) Mer venting og reboots. Litt krasjing fikk bloatwaren tid til også før jeg hadde fått avinstallert den:

Og, når jeg først er i gang, hvem kom på dette fantastiske GUI-designet for BIOS updates? Han burde jo fått en pris :p

Etterpå var turen kommet til installering av faktisk nyttige programmer, dette er heldigvis veldig lett. På Ninite.com krysser man av hvilke programmer man vil ha: Chrome, Gtalk, Spotify, Foxit, uTorrent, osv. Selve installen skjer helt av seg selv, ingenting å trykke på. Veldig bra :)

Så etter timesvis med oppdateringer, bloatware fjerning og installering så er endelig maskinen klar til bruk og jeg må si jeg sitter igjen med en elendig brukeropplevelse. Dette klarer andre platformer å gjøre mye bedre - men ja, det er jo i hovedsak PC-produsentene sin feil, de får betalt for å fylle maskinene sine med skrot (som igjen gjør dem billigere) - men det gjør jo igjen at brukeren sitter igjen med en mye dårligere opplevelse av maskinen enn det den kunne vært. Når man er inne på dårlige brukeropplevelser, visste du forresten at en av begrensningene i Win 7 starter er at man ikke har lov til å endre bakgrunnsbilde? Helt fantastisk! Og det er faktisk gjort rimelig gjennomført også, bakgrunnsbildet ligger på disken, erstatter man innholdet så går visst ikke det heller pga sjekksum-sjekk..

Maskinen virker forøvrig grei nok, iallfall for prisen :) Hele denne posten er skrevet på den, tastaturet var litt uvant i starten, men begynner å sitte i fingrene nå - samme type chicklet tastatur som man finner på nyere mac'er - bare i mindre størrelse og litt andre lokasjoner på noen av tastene. Stille, blir ikke det stor varm, og win 7 starter er nok noe av det bedre microsoft har funnet på de siste årene ja. Får heller komme tilbake til hvordan den er etter litt bruk. Antagelig bytter jeg nok ut win7 med en ubuntu eller lignende, men batteritiden er visstnok mange timer kortere der foreløpig.

Oppdatering: Høyttalerne er ræææva, gjør fysisk vondt i ørene av diskanten :p Og oppgavelinjen i win7 er alt for stor, spesielt på en netbook..

30 Nov 2009

Festival of Light

24 Oct 2009

Fløibanen fisk

Filmet litt med den her Pentax K-7 saken, her er fløibanen med fisheye (da10-17) Fløibanen - Fisheye ride. from Stian Eikeland on Vimeo.
8 Sep 2009

Some masters stuff..

25 Jul 2009

Dra til sjøs.. Piratkart, det er fali det..

Så et par skikkelig latterlige påstander før jeg dro på ferie, men har ikke hatt tid til å kommentere dem før nå.. sjøfartsdirektoratet advarte nylig i aftenposten mot bruk av piratkopierte sjøkart på GPS.

"Folk laster ned sjøkart fra nettet, og ofte er det snakk om digitale kopier av godkjente kart. Disse kan være svært unøyaktige," skal visstnok en luring i sjøfartsdirektoratet sagt. "Med et piratkopiert kart nedlastet fra internett kan GPS-en gi beskjed om at man er midt i et sund, mens man i virkeligheten kan være 10, 50 eller 100 meter nærmere land."

Øøøhm, say what? DIGITALE kopier av GODKJENTE kart blir unøyaktige? Nissene i intertubene er litt kreative når de tegner av det originale godkjente kartet? Jeg skjønner jo godt hva som er poenget her, folk stoler for mye GPS. Både til sjøs, i bil og på fjellet. GPS gjør feil, dårlig signal kan plassere deg unøyaktig, batterier går tom for strøm, veier endres, osv. Det finnes mange eksempler på folk som har krasjet i grøfta fordi GPSen har fortalt dem at de skal svinge til høyre. Så ja, enkelte mennesker stoler for mye på teknologien og glemmer å følge med selv, men hva i alle dager har dette med piratkopiering å gjøre? En digital kopi er like god som originalen, skjær forsvinner ikke fordi kartet ble lastet ned fra the piratebay istedenfor å kjøpe det på cd i butikken.

Jeg vil dessuten påstå at det er mye bedre med et OPPDATERT piratkopiert kart fra i år, enn det orignale som fulgte med GPSen da man kjøpte den for 4 år siden. Kart til GPS er latterlig mye dyrere enn papirkart, jeg vil tro de færreste gidder å kjøpe nye hvert år. Hvis sjøfartsdirektoratet (aka staten) er så utrolig opptatt av at folk skal ha nøyaktige originale kart; så sitter de allerede på løsningen. Frigi statens kartverk sin kartdatabase, denne har nøyaktige kart som de kan kvalitetskontrollere selv, det norske folk har allerede betalt for det. Mye bedre enn å komme med latterlige påstander som om at sjøkart lastet ned fra nettet er farlige.

Piratebay senker skip.. bokstavlig talt..