Liquid Nitrogen Hop Ice Cream

Video

Made hop ice cream with some friends this weekend, using cascade hop. Left hop pellets in milk overnight, filtered out the remains, made ice cream batter the usual way, and then added liquid nitrogen while whisking vigorously.

Ingredients:

  • 3 dl whole milk
  • A couple of hop pellets
  • 2 dl cream
  • 2 eggs
  • 70 g suger
  • 1-2 tablespoons of honey
  • 7 dl liquid nitrogen

Tasted quite bitter (as expected), only the heavy beer drinkers really liked it.

Dead cheap li-ion charger – TP4056

Image

There’s a chip called TP4056 that’s quite good for charging li-ion/li-po cells. You can buy the chip really cheap, or like above – a finished board with usb power in for $1.50 (!) on ebay including shipping. I bought one, soldered on a couple of silicon wires with magnets attached to the end. Also added a plug-able tiny voltmeter (ebay, but this other one from fasttech also looks quite good). I’m not sure how the voltmeter affects the charging (as it feeds off the charging current), but I recon it should be quite fine.

Resistor valuesPer default it uses 1 amp of charging current, which is quite good for large cells, but you can modify it by changing one of the onboard resistors – lower values and you can use it for smaller cells safely.

It’s quite a decent little charger, it manages pretty close to true CC/CV (constant current / constant voltage). It does get a bit hot when charging at 1 amp, especially in the start when the voltage difference between input and output is large, but nothing too worrying.

Termination seems to happen according to spec – just around 4.20 volt.

All in all – quite happy with it. I recon the chip (or even the board) could easily be built into projects that need li-ion/po charging, or even into a battery pack. Can’t beat the price! :)

Building a home automation system – Power control (Part 3)

Just got myself a RFXtrx433 USB transceiver from RFXcom. It’s a tiny box which allows you the communicate with a wide range of home automation hardware that uses the 433 MHz band, check out the impressive list of supported hardware on their website. There is one store in Norway that sell these, and guess what, it’s in Strandgaten here in Bergen (walking distance) – http://www.smarthus.info/

There’s a guy named Kevin that have been working a nodejs library for it, available here: node-rfxcom. He’s made support for events and triggering of most of the protocols – it’s is under active development at the moment. It works quite well here for lighting2 equipment (Nexa / Home Easy based). I added support for lighting1 events (ARC – older protocol – uses code wheel), since it seems that Nexa still sell some equipment using this (the single wall button in my case).

So far I’m only using cheap Nexa plug-in modules and wall buttons, which seem to work well enough, but the plug-in modules aren’t exactly pretty. A lot of the lighting in my apartment is also hard-wired (halogen spots in the roof, no sockets), so sooner or later I’m going to have to get some real built in modules. This has to be done by a certified electrician and I want to be sure that I go for the right technology. I got a tip that insteon is planning on releasing european modules soon(tm), these are mesh-networked (bonus!). And since every receiver is also a sender/repeater I’m hoping they can be queried: “Hello lighting module A, what is your current dimming level?”

Anyway, I have the RFX unit up and running as a service on my home automation message bus now, so now it’s finally possible to subscribe for events from transmitters (ex: wall switch) and send orders to receivers (ex: plug in modules connected to lights). Subscribing to the coffee-machine and turning it off after 60 minutes, or turning off several lights/appliances if the last-man-out button near the exit door is pressed can now be done by:

Gist – 3923421

Now I need to find some suitable PIR (passive infra-red) motion sensors to use with the system, and also try to research which in wall technology to go for in the future – so that I can control more of the lighting here at home.

Flocking / Synchronization

There are a few behaviors in nature that seems really advanced, impressive and organic, that actually can be simulated on a computer using only a few simple rules. One of them is flocking – the “formation”-flying of birds or movement of schools of fish. There’s an old algorithm/simulation by Craig Reynolds called Boids (often used in screensavers and even used for modeling the flying bats in batman) that explains this pretty well. Make a few objects that react to their neighborhood according to the following three simple rules:

  • Separation – try to stay at least x units away from all neighbours.
  • Alignment – try to match the average direction of your neighbours.
  • Cohesion – steer towards the center location of your neighbours.

Flocking in paper.js
Implement the rules and depending on how you weight them you quickly get behavior that looks impressively organic. Was bored the other evening, and my coding fingers are itching since I’ve barely gotten to do any programming at work these last months – the meeting/planning vs programming ratio is through the roof. So I did a quick implementation for shits and giggles. Check it out here: http://goo.gl/eY8KY (or click the image above). I have no idea if it works with all browsers, but works with chrome at least.

There’s also a decent TED talk on the subject:

What’s it going to be used for? Notting really, but might be useful to know if I ever get to chance to program a large army of hunter killer robots with swarm capability.

The Shell – zsh, dotfiles, etc.

I decided to go for zsh again (instead of bash) as a default shell not that long ago. I’ve used it on and off before, it’s really powerful, but takes a lot of configuration to get access to all the nice features it offers. Whenever i reinstalled or changed computers I usually just returned to the de-facto bash shell.

These days configuration/plugin/themes collections like oh-my-zsh and the more recent fork prezto makes it really easy to get a a fully functional and good looking zsh up and running real quick. Git clone oh-my-zsh or prezto, activate the plugins you’re after and you got it :)

Zsh syntax highlighting

There are a few external plugins I really like as well – for example zsh-syntax-highlighting seen above. Clone and add to plugin list as describes. It offers similar shell syntax highlighting as the fish shell.

Oh, and the theme used above is from agnoster. Pretty minimal while giving a lot of information – using the powerline fonts (a series of patched fonts – a favorite among many vim users.) They’ve added pretty symbols to indicate things like branches, background jobs, root, etc. Looks a bit messy below, but that’s mostly because i wanted to try to show as many features as possible in the least amount of space.

Powerline

Works really well in iTerm2. The terminal to use if you’re on OS X.

I try to keep my dotfiles on github, that way it’s pretty easy to move between machines and keep them up to date. Nice to have access to all your aliases and settings on the machines you’re using. And whenever you’re on a new mac, to avoid going mental, just apply your collection of sane mac defaults. (“natural” scrolling my ass :p) :)

There are some pretty awesome collections of dotfiles on github – some worth checking out: holman’s, mathias’ and even whole projects like: dotfiles.github.com

Building a home automation system – The broker and sensors (Part 2)

Every now and then (when I have time..) I do a bit of work on what’s going to become my home automation system. At the moment it’s pretty basic, it’s simply events going over a message broker that small stubs of code react to. Most of it runs on my raspberry pi and a few jeenodes (atmega328 + hoperf rfm12b radio) as wireless sensors.

Everything connects to a simple message broker built on ZeroMQ – and I love it! ZeroMQ is so great to work with, it takes most of the hassle of network socket programming away leaving you to concentrate on what really matters. There is no daemons to deal with (as with most other message buses), it’s lightning fast, but doesn’t really handle persistant messaging.

At the core of the system I have this running on my raspberry pi:

-gist-

It’s very simple – just two ZeroMQ sockets – one running in a push/pull configuration, another running in a pub/sub configuration. A relay for my sensor nodes will connect to it and push it JSON formated data from the different sensors located in my apartment.

{
"nodeid": 2,
"temperature": 2.19,
"voltage": 335,
"counter": 1215,
"event": "sensor",
"timestamp": "2012-09-24T15:49:28.369Z",
"location": "refrigerator"
},
{
"nodeid": 3,
"temperature": 23.5,
"voltage": 369,
"counter": 20,
"event": "sensor",
"timestamp": "2012-09-24T15:52:08.450Z",
"location": "livingroom-bookshelf"
}

The broker will relay events such as these, the two examples are wireless sensor nodes located in my refrigerator (currently holding 2.19C and battery voltage of 3.35v) and the other one in my livingroom bookshelf (2.19C and 3.69v). The broker will receive these (and others), and send them out to subscribers of sensor events. It makes it really easy to make something that reacts to the temperature, you can connect to the broker and subscribe to sensor events in 2-3 lines of code in most languages. Example:

-gist-

As you can see, it would be very simple to expand this and create something that let me know if a battery of a sensor was running low. Or something that would PID adjust a heating source in the living room. Or something that would warn me if temperature in the fridge was running high.. or.. or.. or.. Beauty of it is that you don’t have to think about network stuff like disconnects..

I’ve made a small program in C# running on my HTPC that registers a few global hotkeys. If I press ctrl-alt-o then a small event will be sent out from the C# program, to the message bus, to everyone that subscribes to “receiver” events. There is a small program that does this and relays the message to a microcontroller, which in turn talks to my Pioneer VSX-2016av surround receiver via the SR bus I talked about in an earlier post. For example, sending events like these to the broker will toggle the power of the surround receiver and turn the volume up 5 steps.

{
"event": "receiver",
"action": "power"
},
{
"event": "receiver",
"action": "volumeup",
"count": 5
}

Quick example above, sorry for the camera shake.

It’s getting there, now I have sensor data and control over the surround receiver. The next steps will be to expand the available sensor data – I wish to add a DHT22 Humidity sensor and also a light sensor (LDR?) to the sensor nodes soon. And also maybe PIR (passive ir). I also need to add control over power soon (lighting and heating).

At the moment they are only using a DS18B20 temp sensor. When I have all the components in place I’ll make a small PCB with room for all the components, the radio and a smaller atmel microcontroller. Currently they take up a bit more space than needed.

Better WR703N Antenna mod

I blogged about a WR703N antenna mod earlier, I found some hints about a better way of doing it on the openwrt forum. There’s a (0 ohm) shunt resistor in the antenna path – labeled J1. I undid the changes I did earlier, unsoldered the J1 resistor.

With the board oriented with the wired lan to the left, I then soldered the core of the antenna wire to the RIGHT pad of the now removed J1 resistor. There is a big empty pad “north” of J1, where the antenna shield can be soldered.

K7im9483-note
K7im9484

EDIT: See Diarmaid Ó Cualain comment below, he has been getting better luck leaving J1 bridged (and instead cutting the internal antenna) – while still soldering to the same location. There are two capacitor on the antenna track on the other side of J1, which could be the reason for this.