Os meus primeiros 3 módulos MFL (Módulo Ferrovia LEGO) junto dos restantes módulos da PLUG no Tomar BRInCKa 2015:
O módulo ao centro tem dois desvios motorizados, bem como um «desengatador» no troço de recta entre as duas agulhas. Toda a electrónica está disfarçada por baixo das linhas.
O módulo da direita consiste numa plataforma rotativa motorizada e controlada por um LEGO Mindstorms EV3 correndo ev3dev (uma variante de Debian para o EV3). Sobre o carril um pequeno comboio controlado por SBrick (bluetooth).
O módulo da esquerda, quase 100% da minha marida, começou com uma pequena cascata no nosso presépio do Natal anterior.
A montagem no BRInCKa 2015 não ficou completa por isso todas as demonstrações são manuais, controladas por mim. Neste video gravado em casa é o computador (LEGO Mindstorms EV3) a fazer tudo sozinho:
O que faltou montar e que permite a automação plena? As componentes RFID – por baixo do pequeno comboio há um identificador RFID do tamanho de uma moeda que permite identificá-lo e em certa medida seguir-lhe a posição. Na montagem do video existem dois leitores RFID (USB) por baixo da linha (um no extremo direito e outro junto ao sistema de desengate). O EV3 utiliza esses sensores para perceber se o comboio está nos sítios certos antes de passar à acção seguinte.
I never played with IR before but got curious. I love the idea of remote controlling something. But not manually, it has to be programmatically so one can use it for automation or robotic purposes. So after some weeks I found the LIRC definitions for LEGO Power Functions IR and used it to remote control LEGO from my laptop via the audio output.
Then it was the anniversary of one the kids and he asked granny for a major upgrade of their DUPLO train track:
So I thought it would be great if they could control the train back and forth… and ordered a used DUPLO Train Locomotive Base (5135c01)from BrickLink.
Opening it was difficult but I managed to do it without breaking anything, thanks to these two previous brave pioneers:
(their locomotives are from a different set but the idea is the same)
The locomotive has a pair of free wheels at front and another pair drived by a motor and some gears at back where there is also a piezo buzzer, a printed circuit board and a pair of wires comming from the batteries holder. There are also two rubber buttons that press some small metal rings against the surface of the PCB to act as switches – the smaller one, hidden in a small hole, makes the sound of fuel being pumped into the tank when the fuel hose is inserted, the bigger one controls starts/stops the train but also indirectly controls the sound of the locomotive (when in movement) and the sound of the breaks (when stopping).
The PCB has 6 wires soldered at points labeled J1 to J6:
J1 and J3 – buzzer
J2 and J4 – batteries
J5 and J6 – motor
As the batteries holder is for just 3 AA batteries, the board works with 4.5V. Not much but enough for a LEGO Power Functions IR receiver or a Vengit SBrick.
We could just dessolder the wires at J2/J4 (power) and J5/J6 (motor), get a LEGO Power Functions cable, cut it in half and solder the tips from one half to J2/J4 and the tips from the other half to J5/J6. But that will make the buzzer useless.
As the buzzer is controlled by an IC on the PCB, I choose to keep the power lines going to the PCB (J2/J4) and deriving from there to the Power Functions cable (but still dessoldering J5/J6). This way, when the batteries are inserted, both the remote and the PCB are ON so the two buttons maintain their functionality. This gives us as an unexpected possibility: we can also use the PF cable to power the train instead of using 3 AA batteries – with special caution because LEGO PF batteries or LEGO 9V batteries give more than 4.5V so some reduction has to be done, like adding some 1N4001 diodes or a voltage regulator… but a USB 5.0V battery pack will be perfect.
Since I didn’t want to drill or cut the plastic, I managed to pass the PF cables through the start/stop button hole (before soldering it) but later found out that it was to tight for the rubber button – so no more «tchoo-tchoo!» nor breaks (some may consider this a feature, not a bug).