Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: I hacked my son’s Duplo train to go faster using my voice (gitbook.io)
211 points by RedGreenBlack on June 2, 2022 | hide | past | favorite | 34 comments


I highly recommend the accompanying youtube demo video [1] - but only if you enjoy a hacker dad singing fausetto to propel his son's toy train faster around the track.

[1] https://www.youtube.com/watch?v=t65X-cs55qM


Almost sounds like the Sprach Zarathustra. Almost. https://www.youtube.com/watch?v=Szdziw4tI9o


you forgot the "Also". Not having it is like calling Nietzsche's novel "Spoke Zarathustra".


My bad! Thanks for the correction. Unfortunately, can't edit now.


This video is amazing.


This is completely and utterly useless and something I have absolutely no interest in or need for in my life.

I love it. The video is even better than the blog post IMO.


The headline read to me as if he used his voice, alone, to hack the toy train. Which would be pretty cool


Yeah but there's an emacs binding for that.

(M-x voice-hack-mode)


This is so cool and so cute at the same time! Love it! Maybe an alt mode could adjust speed according to the frequency of making a "tschk" sound. :)


We have this same train set. The app that goes with it is pretty cool; you can set up a track in real life and then make the same track in the app, and it will follow along, with little mini games at certain spots, etc. The app train and the real life train stay in sync.


Cool. What is the feedback mechanism to keep them in sync?


Bluetooth


Are there sensors that tell the controller where the train currently is, on the track?


The train has a sensor (probably a very simple color sensor) on the bottom that can read the little marker pieces that you place on the track to trigger various functionality. It also knows the approximate speed.

It's a relatively inexpensive toy aimed at young children. You shouldn't expect too much from it.


So "your son" got a Duplo train for "his birthday". I see what you did there!


I was in the same situation and ended up writing a browser based controller for the Duplo train using the Web Bluetooth API. It works best on mobiles in portrait mode and you can find it here: https://legotrain.netlify.app/

The source is a single HTML file that also contains the JS. Just view source and modify if you're interested in taking this further. What's cool is that the protocol allows you to receive readings from the train and not just send commands. Also, it allows you to drive the train faster than you can via the official mobile app.


Again thanks for the comment. I updated the repo and created this site: https://benna100.github.io/duplo-train-voice-control/


Uhh this is super nice. I did not even know there was a Web Bluetooth api. That's dope. Then I can drop all of the nodejs stuff and also run it from the phone that's a lot nicer. Thanks for the share!


Great, now I am further interrupting what I should be doing to see if similar work exists for our Intellino train.


was anyone else hoping when he said Windows wouldn't cut it he was going to start talking about Linux? Just kidding of course (kind of). Sounds like a fun project.


Sadly Bluetooth support on Node is a mess and has been so forever. Noble is the only BLE library, and the original creator abandoned it years ago. The community forked it and has been maintaining it since then, but it's still got a lot of the baggage from the original, particularly that it's near unusable on Windows. I've considered rewriting one of my projects in another language just to get away from Noble.


So coupling it with Google Voice / Alexa would be also possible and trigger the start


Why do Duplo trains replicate steam engines instead of contemporary railway technology?


They also have one that imitates a diesel loco: https://www.lego.com/en-us/product/cargo-train-10875 but it's out of stock.

The train base is actually the same as the Duplo truck base so you can put a truck body on it if you wanted.

And as to the answer, steam train go Choo Choo.


What was the kid’s reaction?


He is not that old so he was just excited that it could drive around haha


Great job! Now apply it to a roller coaster


Lego had https://www.lego.com/en-us/product/roller-coaster-10261 which wouldn't be hard to combine power functions' bluetooth with.


I have that set - and it’s fantastic. It comes with instructions to integrate a motor into the mechanism to bring the roller coaster cars to the top of the first hill.

Gravity does the rest - the cars aren’t powered.


There is no LEGO-branded BlueTooth controller for Power Functions. Only infrared. (Some third party controllers exists though).

However LEGO Power Functions is replaced by LEGO Powered Up which is BlueTooth controlled. The same system controls products branded LEGO Technic, LEGO Boost, LEGO Ideas, LEGO Robot Inventor...


> hacked

> using open source library that has all required apis


Please don't pick the most provocative thing in an article or post to complain about in the thread. Find something interesting to respond to instead.

https://news.ycombinator.com/newsguidelines.html

https://news.ycombinator.com/showhn.html


Hacker news isn't about Security hacking, it's about hacker culture, or as someone on Wikipedia puts it [1]

> The act of engaging in activities (such as programming or other media) in a spirit of playfulness and exploration is termed hacking.

[1] https://en.wikipedia.org/wiki/Hacker_culture


So you write your code in 1s and 0s and don't use programming languages written by others?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: