IoT Enabled Thomas The Tank Engine

This month the popular “Thomas the Tank Engine” toy celebrated its 70 anniversary. As a fun project, [tinkermax] wanted to bring this traditional toy into the age of IoT, while preserving its physical appearance and simple charm.

He used a model called the “Diesel” which seemed big enough to house the electronics, but proved otherwise once he inspected the innards. He needed to fit in an ESP8266 module, an accelerometer breakout, some discrete parts, a nifty analog multiplexer, and a 14500 3.7V LiPo. Once done, he was able to control its speed remotely over WiFi, with an auto “throttle-boost” that kicks in when the accelerometer senses that the train is going uphill, and has remote monitoring of battery state, engine load, inclination and track vibration – all in real-time using MQTT over WiFi. It’s quite a demonstration of the power of these super-cheap WiFi modules that are powering the current wave of IoT innovation.

The train motor works off a single 1.5V battery, so [tinkermax] tried a couple of boost converters to get the ESP-12 to work. But the modules were a tad bigger, and couldn’t provide the high peak current needed by the ESP-12. So he used a 14500 3.7V LiPo battery instead. A series diode drops the LiPo voltage to a circuit friendly 2.9V ~ 3.6V range. The ADXL345 accelerometer is used to measure “pitch” to detect going up and down a hill, “roll” to check for tilt or tip over and vibration to identify track defects. It communicates with the ESP-12 using a special Lite-SPI library that he wrote.

Two analog measurements are performed. One uses a resistor in series with the PWM driven motor to measure its current, with a low pass filter to smooth out PWM noise. The other is a resistor divider network used to monitor battery voltage. But the ESP-12 has just one ADC channel. Instead of adding another ADC module, [tinkermax] used a neat device – the FSA3157 – which allows two analog inputs to be channeled to a single output much like a SPDT switch. One PWM output is used to control motor speed and a second one to pulse a LED.

The sensor data is streamed 5 times a second over the MQTT protocol to a Raspberry Pi based MQTT broker. Finally, a JavaScript webpage receives the MQTT messages and plots the data graphically. One upgrade he would like to implement is speed measurement, to allow constant speed drive. If you have any ideas on how to extract that information from an accelerometer, chip in with your comments below. Check out his build log in the short video below. And if you’d like to see how all of this can be used in the real world, check this other video where [tinkermax]’s colleague gives a run down about a commercial enterprise IoT cloud platform hooked up to Thomas the Tank Engine.

Continue reading “IoT Enabled Thomas The Tank Engine”

Hot Swappable Raspberry Pi Rack

The Raspberry Pi has inspired many a hacker to take the inexpensive (~$35) microcomputer to the enterprise level. From bitcoin miners to clusters, the Raspberry Pi has found itself at the heart of many large-scale projects.

On hackaday.io [Dave] served up his own contribution with his Raspberry Pi Rack. Inspired by enterprise blade servers, he wanted to house multiple Raspberry Pi boards in a single enclosure providing power and Ethernet. The spacing between the blades and the open sides allow for each Pi to cool without the additional power and cost of fans.

Starting with an ATX power supply and Ethernet switch, Dave created a base that housed the components that would be shared by all the Pis. Using a 3D model of a Pi he found online, he began working on the hotswap enclosures. After “dozens of iterations” he created a sled that would hold a Pi in place with clips rather than screws and slide into his rack to connect to power and Ethernet.

Like most projects, some mistakes were made along the way. In his write up [Dave] describes how after printing the bottom plate he realized he hadn’t accounted for the holes for the Ethernet cable runs. Instead the cables run along the back wall in a way he now prefers.

You can find all the details and download the 3D models on his project page.

Eye-Controlled Wheelchair Advances From Talented Teenage Hackers

[Myrijam Stoetzer] and her friend [Paul Foltin], 14 and 15 years old kids from Duisburg, Germany are working on a eye movement controller wheel chair. They were inspired by the Eyewriter Project which we’ve been following for a long time. Eyewriter was built for Tony Quan a.k.a Tempt1 by his friends. In 2003, Tempt1 was diagnosed with the degenerative nerve disorder ALS  and is now fully paralyzed except for his eyes, but has been able to use the EyeWriter to continue his art.

This is their first big leap moving up from Lego Mindstorms. The eye tracker part consists of a safety glass frame, a regular webcam, and IR SMD LEDs. They removed the IR blocking filter from the webcam to make it work in all lighting conditions. The image processing is handled by an Odroid U3 – a compact, low cost ARM Quad Core SBC capable of running Ubuntu, Android, and other Linux OS systems. They initially tried the Raspberry Pi which managed to do just about 3fps, compared to 13~15fps from the Odroid. The code is written in Python and uses OpenCV libraries. They are learning Python on the go. An Arduino is used to control the motor via an H-bridge controller, and also to calibrate the eye tracker. Potentiometers connected to the Arduino’s analog ports allow adjusting the tracker to individual requirements.

The web cam video stream is filtered to obtain the pupil position, and this is compared to four presets for forward, reverse, left and right. The presets can be adjusted using the potentiometers. An enable switch, manually activated at present is used to ensure the wheel chair moves only when commanded. Their plan is to later replace this switch with tongue activation or maybe cheek muscle twitch detection.

First tests were on a small mockup robotic platform. After winning a local competition, they bought a second-hand wheel chair and started all over again. This time, they tried the Raspberry Pi 2 model B, and it was able to work at about 8~9fps. Not as well as the Odroid, but at half the cost, it seemed like a workable solution since their aim is to make it as cheap as possible. They would appreciate receiving any help to improve the performance – maybe improving their code or utilising all the four cores more efficiently. For the bigger wheelchair, they used recycled car windshield wiper motors and some relays to switch them. They also used a 3D printer to print an enclosure for the camera and wheels to help turn the wheelchair. Further details are also available on [Myrijam]’s blog. They documented their build (German, pdf) and have their sights set on the German National Science Fair. The team is working on English translation of the documentation and will release all design files and source code under a CC by NC license soon.

Hackaday Links Column Banner

Hackaday Links: May 24, 2015

A few months ago, we heard about a random guy finding injection molds for old Commodore computers. He did what the best of us would do and started a Kickstarter to remanufacture these cool old cases. It’s the best story on retrocomputing this year, and someone else figured out they could remanufacture Commodore 64 keycaps. If you got one of these remanufactured cases, give the keycaps a look.

Remember this Android app that will tell you the value of resistors by reading their color code. Another option for the iOS crowd was presented at Maker Faire last weekend. It’s called ResistorVision, and it’s perfect for the colorblind people out there. An Android version of ResistorVision will be released sometime in the near future.

A few folks at Langly Research Center have a very cool job. They built a hybrid electric tilt wing plane with eight motors on the wing and two on the tail. It’s ultimately powered by two 8 hp diesel engines that charge Liion batteries. When it comes to hydrocarbon-powered hovering behemoths, our heart is with Goliath.

A bottom-of-the-line avionics panel for a small private plane costs about $10,000. How do you reduce the cost? Getting rid of FAA certification? Yeah. And by putting a Raspberry Pi in it. It was expoed last month at the Sun ‘N Fun in Florida, and it’s exactly what the pilots out there would expect: a flight system running on a Raspberry Pi. It was installed in a Zenith 750, a 2-seat LSA, registered as an experimental. You can put just about anything in the cabin of one of these, and the FAA is okay with it. If it’ll ever be certified is anyone’s guess.

Raspberry Pis And A Video Triptych

A filmmaker friend of [Thomas] mentioned that she would like to display a triptych at the 2015 Venice Art Walk. This is no ordinary triptych with a frame for three pictures – this is a video triptych, with three displays each showing a different video, and everything running in sync. Sounds like a cool engineering challenge, huh?

The electronics used in the build were three Raspberry Pi 2s and a trio of HDMI displays. Power is provided by a 12V, 10A switching supply with 5V stepdown converters for the Pis. The chassis is a bunch of aluminum bars and U channel encased in an extremely well made arts and crafts style frame. So far, nothing out of the ordinary.

Putting three monitors and three Pis in a frame isn’t the hard part of this build; getting three different displays all showing different videos is. For this, [Thomas] networked the Pis through an Ethernet hub, got the videos to play independently on a RAM disk with omxplayer. One of the Raspberry Pis serves as the master, commanding the slaves to start, stop, and rewind the video on cue. According to [Thomas], it’s a somewhat hacky solution with a bunch of sleep statements at the beginning of the script to allow the boot processes to finish. It’s a beautiful build, though, and if you ever need to command multiple monitors to display the same thing, this is how you do it.

Notification Cube

LED Notification Cube Is A Good First Project

Two years ago, [Matt] made a move away from his software hacks and into the physical world. He was part of a pilot program to provide mentorship to children as part of the Maker Education Initiative. This program gave him access to 3D printers, CNC machines, and laser cutters within the New York Hall of Science makerspace. [Matt] chose to build an illuminated notification cube for his first physical project. The idea being that smart phones have so many alerts, many of which are unimportant. His project would help him to visualize and categorize each alert to better understand its importance.

The brain of the system is a Raspberry Pi. [Matt] found a Python library that allowed him to directly control an RGB LED strip based on the LPD8806 chip. He wired the data pins directly to the Pi and used an old 5V cell phone charger to power the LEDs. The strip was cut into smaller strands. Each face of the cube would end up with three strands of two LEDs each, or six LEDs per side. [Matt] found a mount for the Pi on Thingiverse and used a 3D printer to bring it into existence. The sides were made of frosted laser cut acrylic. The frosted look helps to diffuse the light from the LEDs.

Over time [Matt] found that the cube wasn’t as useful as he originally thought it would be. He just didn’t have enough alerts to justify the need. He ended up reprogramming the Pi to pull weather information instead, making use of the exact same hardware for another, more useful purpose.

Raspberry Preserve – A BitTorrent Sync Client In A Mason Jar

[Matt Reed] used a few off-the-shelf parts and built a Raspberry-Pi based BitTorrent Sync client to help backup files. What makes it stand out is the idea of using a Mason Jar as the enclosure and the nice build finish. Mason Jars have long been used to preserve food. [Matt] wanted to use the Mason Jar to help preserve family memories.

Basically, he just stuffed a Raspberry Pi inside a jar with some LED’s and put BitTorrent Sync on it. He started off with a nice, square piece of wood and mounted the lid on it. Holes were drilled to fix the four LED’s and faux crystal drawer pull knobs. The Pi was connected to power and Ethernet and the LED’s wired up. The software is quite straightforward – just install BitTorrent Sync on the Raspberry Pi. He wrote a Node.js script to constantly check if BitTorrent Sync is transferring any data, and if it is, blink the LED’s so it looks cool. If no data is being transferred, the LED’s just glow solid red. Once it is plugged into power and connected to the internet, any photo or video (or any file for that matter) that is put inside a special folder called “Preserve” on any of his devices, gets sync’ed and copied to the “Raspberry Preserve” – preserved for posterity.