Skip to content
Aug 24 14

4x4x4 3D RGB Charlie Cube by Stavanger Makerspace

by Finn Espen Gundersen
Cube_upside_down

Over the last two Sundays, Stavanger Makerspace hosted meetups to build 4x4x4 RBG LED Arduino-controlled “charlie cubes”. A charlie cube, originally designed by Asher Glick and Kevin Baker, uses a minimum of components and can be made very cheap by using just an Arduino nano.

Charlie-cube projects abound on the internet, but the amount of soldering points suspended only by thin wires often leads to misaligned results. Our intrepid member Kjetil Eik, known for impressive 3D prints on his sturdy Felix, thought we could do better. He designed and printed tools and jigs to straighten out what would otherwise have been a crooked crowd. He also designed a PCB to avoid the messy breadboard.

Download the 3D print gcode files for the LED jigs:LED_jig_gcode.zip and LEDjig_2_gcode.zip

Download the the PCB layout for Fritzing and have it delivered by dirtypcbs.

 

Jigs_and_pcb

The tools are, from top left and clockwise:

  • Hats for the top LEDs, to be used during soldering to perfectly align the top LEDs in a grid, as well as keep them together during transport.
  • Base platform for the PCB and Arduino. The arduino and all solder points are hidden underneath the PCB. It has just one small hole in the side for the USB cable.
  • PCB designed with the program Fritzing.
  • Jig to hold an RGB LED in the center hole while the leads are bent to match the grooves on the star’s arms.
  • Tool to help remove stuck LEDs from the soldering jig
  • Soldering jig to hold 4 LEDs and two wires while soldering. This is used twice for each “tower” to solder wires pairwise. This kind of jig is essential in a charlie cube project.

Apart from 3D printed tools and the PCB, the parts needed are:

  • 64 RGB LEDs
  • 1 Arduino Nano v3 (+ USB cable)
  • 2 Single row angled SMT male header w/spacing 2.54mm (1/10″)
  • 7m Steel wire

 

DAY 1: PREPARATIONS

LEDs

LEDs are an essential part of any hobby electronics project. This project has plenty. Full colour!

Bending_LED

The star-shaped jig for bending LEDs improves efficiency and alignment. An interesting observation is that the LED can be inserted in any orientation. The only unbendable rule for lead bending is the order: up, left, right, down. By the 64th LED, you have reached an amazing speed.

Next comes wires.

Steel

Ordinary fence wire won’t line anyone’s pockets, but works perfectly. It needs a bit of straightening out before it can be trusted with the task we have in mind, though. The process is simple: pull firmly, without yanking, and watch it stretch. Best done in pairs.

Cutting_wires

Cut to measure. Length is not too important, just keep it over 10cm.

Wires

Three people made about 700 of these. We got the hang of it after about 100.

In addition to LED bending and wire stretching, we had USB cables, Arduinos and 3D-printed jigs for 10 people.

Kits

DAY 2: ASSEMBLY

4 LEDs and two wires goes into the soldering jig. The topmost LED can be put in at any orientation, but each LED downwards must then be rotated 90 degrees clockwise. Bring out the old soldering iron and link the connections before the heat makes the wire dig itself into the plastic jig (according to our jig maker, this never happens to him).

LEDs_in_jig_1

Then, use the removal tool, turn the LEDs 180 degrees and repeat for the other leads.

 

Removing_LEDs_from_jig

It helps to have the PCB rigged with the Arduino and 4 temporary connectors, to confirm the non-presence of dud soldering joints.

Testing_LED_uncut

When happy, clip the wings.

Testing_LED_cut

The 16 towers with a total of 256 soldering joints is a great way to improve soldering skills for novices. For everyone else, it is a great way to test one’s patience.

Before assembly, solder the SMT header to the PCB. This is where the Arduino Nano will go. The reason for using surface mount headers is to avoid visible solder joints on the top.

To assemble, put the PCB in the base and stick all 16 towers in it without soldering. Take care to ensure that all towers are oriented the same way by matching the orientation of the topmost LED. Put the hat on top and turn it all upside down. It is now possible to adjust the height/level of the PCB and make sure it is completely flat. Also make sure that all towers are fully extended into the hats and not suspended in the air.

Then solder the last 64 joints and hope for the best.

Cube_upside_down

As a last step, cut the protruding wires, and.. Voila!

I can’t wait to make som impressive sequences for this, watch this space for the obligatory scroll text program next.

Apr 14 14

American Netflix on any device without VPN or site-wide DNS changes – using pfSsense

by Finn Espen Gundersen
Netflix Mad Men

It seems like everyone is finding ways to watch American Netflix content. While it is easy with one of many plugins on the computer, it gets harder on devices such as iPad or PS3 and even more so on Chromecast with its hard-coded google DNS. Some people will also want a solution for the home router, covering all devices at once.

The most common fix is to get a VPN. Usable from the computer, iPad, Chromecast or a sufficiently advanced router, a VPN routes your traffic through a server in the US. The main drawback is speed. Most VPN providers are over-subscribed and, in general, it will be hard to get Super HD streaming – at least with any stability and on more than one device. You will also want to separate your other browsing traffic from the VPN to avoid the speed loss, and avoid having all websites think you are from the US. All in all, a solution with drawbacks.

Another common fix is to get a custom DNS provider such as unblock-us.com or unotelly.com. After the extremely easy sign-up you just change your DNS server settings to point to theirs. The custom DNS will return the addresses to their own US-based servers (reverse proxies) for all Netflix-related lookups. All other traffic flows normally.

This avoids the speed loss of a VPN as the actual streaming goes directly from Netflix’s servers to your home. It also does not affect your other web traffic. Usually a cheaper service than a VPN, this seems like the perfect solution. It does, however, have a slight security implication: the DNS provider can see all your lookups and could in theory log or divert some of it.

What we want is to divert only relevant lookups to the proxy provider’s DNS. This is accomplished in pfSense by adding a domain override in the DNS Forwarder. The web gui for the domain override adds wildcards, so an entry for netflix.com will also cover all subdomains. We accomplish our task by adding the following to Services | DNS Forwarder | Domain Overrides and making sure the box “Query DNS servers sequentially” is checked:

netflix.com 208.122.23.23
netflix.net 208.122.23.23
rhapsody.com 208.122.23.23
pandora.com 208.122.23.23
hulu.com 208.122.23.23

The IP address is for the DNS server of unblock-us. Only the first two lines are necessary for Netflix, the others are for Rhapsody, Pandora and Hulu.

For the unbehaving Chromecast, with its hard-coded Google DNS, we are forced to add a NAT rule to reroute all DNS requests. In Firewall | NAT | Port Forward, add a new rule with these settings:

RDR: Unchecked
Interface: LAN
Protocol: UDP/TCP
Source: IP of your Chromecast
Source port: any
Destination: any
Destination port: DNS (53)
Redirect target IP: the DNS server of unblock-us or similar service
Redirect target port: DNS (53)

Chromecast pfSense NAT

All in all this is a perfect solution. Switching regions can be done either in the DNS provider’s web interface, or by disabling the pfSense settings.

Apr 6 14

Altibox med egen ruter med pfSense

by Finn Espen Gundersen

De fleste som har Altibox fiber-bredbånd og vil bruke egen ruter hjemme setter Altibox-ruteren i bridge-mode. Men det er unødvendig å ha den som et ekstra ledd mellom deg og internett. Du kan like gjerne kople din egen ruter eller server rett på linjen.

Denne trengs ikke

Denne trengs ikke

Om du ikke har vært Altiboxkunde alt for lenge så har du en mediekonverter foran ruteren som leveres av Altibox. Da kopler du deg direkte i mediekonverteren. Har du ikke en mediekonverter er jobben litt mer innfløkt fordi du må direkte på fiberen med f.eks egen mediekonverter.

Mediakonverter

En PC med to nettverkskort, hvorav kortet som skal være WAN støtter VLAN (det gjør de fleste) er alt som trengs. Jeg bruker en HP Microserver med et ekstra nettverkskort og pfSsense. HP Microserver sitt innebygde nettverkskort støtter VLAN. Boksen har heller ingen problemer med de høye båndbreddene man kan få hos Altibox. Vil du bare teste så fungerer det helt fint å starte pfSense fra USB-pinne uten å installere.

Internett leveres på VLAN 102 og den offentlige IP-adressen kommer med DHCP. TV leveres på VLAN 101. Takk til første poster i denne posten for disse opplysningene. Det er mulig rettskriving ikke er posterens beste side, men han vet hva han snakker om.

Når pfSense starter spør den først etter evt VLAN. Svar ja og oppgi VLAN-tag 102 på WAN-kortet. Om WAN-kortet heter bge0 skal deretter WAN bindes til bge0_vlan102. LAN bindes til det andre kortet.  Videre innstillinger kan gjøres i pfSense webinterface på http://192.168.1.1/.

pfSense Altibox

pfSense setter som default opp ruting og NAT mellom WAN og LAN og henter adressen på WAN-kortet via DHCP automatisk. Det er overraskende lite jobb å få dette til, jeg hadde satt av godt med tid til frustrasjon, men opplevde ingen. Ingen endringer på Altibox sine selvbetjeningssider er nødvendig. Det er heller ikke nødvendig å sette MAC-adressen på WAN-kortet til samme MAC som Altibox-ruteren. Alt bare virker.

Har du kommet så langt som dette så får du til ruting av TV-signalet selv. Når du først er i gang, så gå for Altibox IPv6 i tillegg.

Altibox burde dokumentere denne fremgangsmåten på egne sider. Det gir ikke mer supportkostnader enn for bridge-mode-brukerne (“eget ansvar, plugg tilbake ruteren vår før vi hjelper deg”), men ville gitt Altibox som brand mye geek-cred. Og det er slike som velger bredbånd for venner og slektninger.

 

Dec 29 13

Keep iPad/iPhone iOS keyboard up between input fields

by Finn Espen Gundersen
Keeping it up: no longer a problem

The iPad and iPhone has more than a few quirks web developers need to handle. One of them is being quite insistent on when to show and hide the on-screen keyboard. The default iPad behaviour, in all iOS versions, is to drop the keyboard between input fields, and to deny programmatically showing the keyboard on focus changes. It is only shown when the user taps an input field.

While this is adequate for most situations, it can be really frustrating in cases of several fixed-width input fields in a row.

Here is how to circumvent this behaviour and give your site’s user interface a more natural flow. This solution works for wide and short input fields alike, flawlessly moving the user from zipcode to phone number, or from character to character between multiple single-letter input boxes. Compare entering words on lexical word finder (without this technique) to entering words on this wordfeud help site (with this technique).

We rely on two tricks to make this work. First, we keep the user in the same input box all the time, just changing the position and appearance as we move along. Second, to keep the code changes small and localized, we take advantage of the fact that we can change the id of an element.

In this way, even as we are moving the same input field along, we are changing it’s id (and size, location etc as well) — to avoid having to change the existing program logic of the page. The entire time, all input fields will have the correct id’s, even though we have been moving the same field along all the time. We also do not introduce any extra fields to put above the real/existing ones (a trick seen in some other solutions).

This has the additional advantages of always leaving the page in a consistent state should the user choose to unfocus and do something else in the middle of filling out the form, as well as being supported in all browsers – avoiding an iOS-only workaround.

The code snippet with a live functioning demo is hosted on jsFiddle.net and should be fairly self-explanatory. It shows both the regular and iOS-friendly version.

Most of the magic lies in replacing the common step nextfield.focus(); to move from one input field to the next, with the function moveon_ipad(fromfield, nextfieldid) and realising that there is no previous field to blur (i.e. removing any blur-specific code when moving along, although it stays in for the event when the user clicks elsewhere).

In the demo, each field has a different background colour to allow you to see how the field moves along in the iOS-friendly version while they all stay put in the plain version. In practice, the background colours would be the same (or one of the properties the moveon_ipad function swaps), so the user would not notice any difference.

While the live demo uses jQuery1.9.1, the code is very short and easily adaptable. The demo also uses absolute positioning to ease the movement, but this is not a requirement.

Dec 22 13

Karamellpudding Sous-Vide

by Finn Espen Gundersen
Karamellpuding sous vide

Det er vinter og tid for karamellpudding. I år lages den sous vide. Det er foreløpig vanskelig å finne konkrete fremgangsmåter på web, men fortvil ikke, etter litt prøving og feiling er oppskriften her — og resultatet blir perfekt hver gang. Oppskriften fungerer også fint for vanlig ovn.


For 5 personer trengs:

3dl sukker til karamell (blir mer enn nok)

————

1dl sukker til pudding

6dl melk

3dl fløte

1 vaniljestang

————

8 egg

Men det kommer som regel flere, og alle liker karamellpudding, så jeg lager dobbelt opp. Karamellpuddingen lages like gjerne av laktoseredusert melk og laktosefri fløte.

Karamell er varmt og karamellpudding krever flere omganger med oppvarming og nedkjøling. Dette er en kjempeanledning til å skaffe litt utradisjonelle kjøkkeneredskaper som sveisehansker og IR-termometer.

Gloves and temperature device

Steg 1: Karamell

Mens man før trodde sukker smeltet, så har man nå funnet ut at smeltende sukker har en prosess som ligner mer på nedbrytning og som foregår i området 160-185°C. Rask oppvarming gir et høyere smeltepunkt enn sakte oppvarming. Dette kan vi utnytte for å få perfekt karamell. Ved for høy temperatur blir karamellen mørk, brent og bitter. Bruk svakere varme, god tid og få den lysere brun og tyktflytende. Noen små klumper av sukker gjør ikke noe, de løses likevel opp senere i prosessen, men sjekk at det ikke er store klumper av sukker igjen i blandingen.

Smeared caramel

Bruk en sleiv til å smøre karamellen rundt i formen. Her bør det gå fort, for karamellen stivner raskt. Sveisehanskene sørger for at ingen brenner seg selv om karamellen er varmere enn kokende vann. Man kan ordne seg litt bedre tid ved å forvarme formen. Få karamellen opp langs kantene, men det er ikke viktig akkurat hvor langt opp den kommer.

Siden jeg lager dobbelt opp blir det to brødformer.

Steg 2: Pudding

Kok opp sukker, melk, fløte og vanlijestang i en gryte. Som alltid ved oppkok av melkeblanding så brenner det seg fort så rør ofte. Automatisk sauserører gjør jobben og avlaster kokken.

Automatisk rører

Etter et kort oppkok må blandingen avkjøles. Mens man venter passer det å røre sammen eggene.

Eggs

Blandingen må være under 60°C før eggene helles i for å unngå at eggene koagulerer.

IR device

Steg 3: Blandings

Mixture and caramel

Så er det bare å helle i formen.

The pour

Og plassere i maskinen. Plast på toppen gjør at det ikke regner på puddingen fra taket av maskinen.

In the sous vide basin

Melkeblandingen hever koaguleringspunktet helt til 79°C. Vi må derfor over 79°C for å få blandingen til å stivne. Jeg bruker 83°C i 2t 10min. Det betyr ikke så mye om vannbadet er forvarmet eller ikke siden ingenting stivner før 79 grader likevel, men tiden regnes fra maskinen når riktig temperatur.

Sous vide temperature

Går man for ovn plasseres formen i vannbad også der, men da 125°C i 2,5t. En fordel med sous vide er at man unngår den snerkete toppen (som blir bunnen ved servering) på den ferdige puddingen.

Selv om det ser elegant ut med form som flyter i maskinen, så lønner det seg å tilpasse vannmengden slik at formene står selv. Når puddingen stivner kan det nemlig hende det ikke skjer like raskt over alt. Dermed kan formen ende med å stå høyere i den ene enden underveis i prosessen og vips tar den inn vann og synker. Er du heldig skjer det ikke for tidlig og man kan bare helle av vannet.

For at formene skal kunne stå, men maskinen likevel ha nok vann, plasseres noen avstandsstykker i bunnen. Til overs IKEA-vinkler fungerer fint. Uten nok vann i maskinen vil den ikke klare å holde temperaturen jevn.

Den ferdige puddingen avkjøles og settes i kjøleskap ca ett døgn — gjerne lenger. Løsne sidene fra formen før servering, hell av karamellsaus i mugge, og snu formen raskt på et fat.

Karamellpuding sous vide

Serveres med pisket krem! Nyt den!