How To Mash Up BLE, NodeJS, And MQTT To Get Internet Of Things

We’re living in the world of connected devices. It has never been easier to roll your own and implement the functionality you actually want, rather than live with the lowest common denominator that the manufacture chose.

In a previous article I walked though a small python script to talk to a BLE light and used it to cycle through some colors. Now I want to delve deeper into the world of Internet Connected BLE devices and how to set up a simple Internet-Of-Things light. With this example in hand the sky’s the limit on what you can build and what it will be able to do.

Join me after the break as I demonstrate how to use NodeJS to bridge the digital world with the physical world.

Continue reading “How To Mash Up BLE, NodeJS, And MQTT To Get Internet Of Things”

Fail Of The Week: Solid State Relay Fails Spectacularly

A lot of times these days, it seems like we hackers are a little like kids in a candy store. With so many cool devices available for pennies at the click of a mouse, it’s temptingly easy to order first and ask questions about quality later. Most of the time that works out just fine, with the main risk of sourcing a dodgy component being a ruined afternoon of hacking when a part fails.

The stakes are much higher when you’re connecting your project to the house mains, though, as [Mattias Wandel] recently learned when the solid-state relay controlling his water heater failed, with nearly tragic results. With aplomb that defies the fact that he just discovered that he nearly burned his house down, [Mattias] tours the scene of the crime and delivers a postmortem of the victim, a Fotek SSR-25DA. It appears that he mounted it well and gave it a decent heatsink, but the thing immolated itself just the same. The only remnant of the relay’s PCB left intact was the triac mounted to the rear plate. [Mattias] suspects the PCB traces heated up when he returned from vacation and the water heater it was controlling came on; with a tank full of cold water, both elements were needed and enough current was drawn to melt the solder build-up on the high-voltage traces. With the solder gone, the traces cooked off, and the rest is history. It’s a scary scenario that’s worth looking at if you’ve got any SSRs controlling loads anywhere near their rated limit.

The morals of the story: buy quality components and test them if possible; when in doubt, derate; and make sure a flaming component can’t light anything else on fire. And you’ll want to review the basics of fire protection while you’re at it.

Continue reading “Fail Of The Week: Solid State Relay Fails Spectacularly”

Circuit VR: Measuring With LTSpice

Usually, with Circuit VR we look at some circuit in detail with simulation — usually LTSpice. This one will be a little meta because I wanted to look at a capability in LTSpice which ironically is very useful, but not often used. Along the way, though, we’ll look at why you get maximum power transfer when your source impedance matches your load impedance. This is something you probably already know about, but it is interesting to look at in simulation if you know how to coax LTSpice — no pun intended — into showing you a meaningful graph.

The circuit is super simple. An AC source and a 50-ohm resistor stand-in for a 40-meter ham transmitter. With 100 volts into a 50-ohm load. So far, so good.

Continue reading “Circuit VR: Measuring With LTSpice”

Friday Hack Chat: Hacking For Mental Health

Quite often we see applications of hacking and DIY in the medical field. From 3D printed prosthetics to hacked insulin pumps, there’s a wide variety of stuff you can do, but what about psychology? That’s what our Hack Chat this Friday is all about.

Our guest for this week’s Hack Chat is Curt White. He’s been building medical devices for years, and when he’s not doing that he’s creating interactive installation art and costumes. At work he’s a device and sensor developer at the Child mind Institute MATTER Lab where he designs and researches wearable medical devices for children with mental health issues. He’s currently working on gesture detection using wearables, machine learning optimized for microcontrollers, and building and fixing prototypes.

For this hack chat, we’ll talk about how mental health can be addressed by building things with a focus on wearable devices and sensor data. How are wearables challenging the outdated and arbitrary classification of psychiatric disorders, and what is the potential for audio, EEG, and fMRI to help us progress beyond checklist diagnosis? We’ll also talk about:

  • Hacking for mental health
  • Addressing the intangible with the tangible
  • Working with medical researchers
  • The fact that you don’t need an IRB if you don’t accept federal funding, or are working in Belize.

You are, of course, encouraged to add your own questions to the discussion. You can do that by leaving a comment on the Hacking For Mental Health Event Page and we’ll put that in the queue for the Hack Chat discussion.join-hack-chat

Our Hack Chats are live community events on the Hackaday.io Hack Chat group messaging. This week is just like any other, and we’ll be gathering ’round our video terminals at noon, Pacific, on Friday, August 24th. Need a countdown timer? Go go go

Click that speech bubble to the right, and you’ll be taken directly to the Hack Chat group on Hackaday.io.

You don’t have to wait until Friday; join whenever you want and you can see what the community is talking about.

Ask Hackaday Answered: The Tale Of The Top-Octave Generator

We got a question from [DC Darsen], who apparently has a broken electronic organ from the mid-70s that needs a new top-octave generator. A top-octave generator is essentially an IC with twelve or thirteen logic counters or dividers on-board that produces an octave’s worth of notes for the cheesy organ in question, and then a string of divide-by-two logic counters divide these down to cover the rest of the keyboard. With the sound board making every pitch all the time, the keyboard is just a simple set of switches that let the sound through or not. Easy-peasy, as long as you have a working TOG.

I bravely, and/or naïvely, said that I could whip one up on an AVR-based Arduino, tried, and failed. The timing requirements were just too tight for the obvious approach, so I turned it over to the Hackaday community because I had this nagging feeling that surely someone could rise to the challenge.

The community delivered! Or, particularly, [Ag Primatic]. With a clever approach to the problem, some assembly language programming, and an optional Arduino crystalectomy, [AP]’s solution is rock-solid and glitch-free, and you could build one right now if you wanted to. We expect a proliferation of cheesy synth sounds will result. This is some tight code. Hat tip!

Squeezing Cycles Out of a Microcontroller

Let’s take a look at [AP]’s code. The approach that [AP] used is tremendously useful whenever you have a microcontroller that has to do many things at once, on a rigid schedule, and there’s not enough CPU time between the smallest time increments to do much. Maybe you’d like to control twelve servo motors with no glitching? Or drive many LEDs with binary code modulation instead of primitive pulse-width modulation? Then you’re going to want to read on.

There are two additional tricks that [AP] uses: one to fake cycles with a non-integer number of counts, and one to make the AVR’s ISR timing absolutely jitter-free. Finally, [Ag] ended up writing everything in AVR assembly language to make the timing work out, but was nice enough to also include a C listing. So if you’d like to get your feet wet with assembly, this is a good start.

In short, if you’re doing anything with hard timing requirements on limited microcontroller resources, especially an AVR, read on!

Continue reading “Ask Hackaday Answered: The Tale Of The Top-Octave Generator”

All The Badges Of DEF CON 26 (vol 2)

There were so many amazing unofficial badges at DEF CON this year that I can’t possibly cover them all in one shot. I tried to see every badge and speak with every badge maker — like a hardware safari. Join me after the jump for about fourteen more badges that I saw at DEF CON 26!

If you missed the first batch, check those badges out too — there’s even a Badgelife Documentary that you need to add to your watch list. Okay, let’s dig in.

Continue reading “All The Badges Of DEF CON 26 (vol 2)”

The Forgotten Art Of Riveted Structures

If you are in the habit of seeking out abandoned railways, you may have stood in the shadow of more than one Victorian iron bridge. Massive in construction, these structures have proved to be extremely robust, with many of them still in excellent condition even after years of neglect.

A handsome riveted railway bridge, over the River Avon near Stratford-upon-Avon, UK.
A handsome riveted railway bridge, over the River Avon near Stratford-upon-Avon, UK.

When you examine them closely, an immediate difference emerges between them and any modern counterparts, unlike almost all similar metalwork created today they contain no welded joints. Arc welders like reliable electrical supplies were many decades away when they were constructed, so instead they are held together with hundreds of massive rivets. They would have been prefabricated in sections and transported to the site, where they would have been assembled by a riveting gang with a portable forge.

 

So for an audience in 2018, what is a rivet? If you’ve immediately thought of a pop rivet then it shares the function of joining two sheets of material by pulling them tightly together, but differs completely in its construction. These rivets start life as pieces of steel bar formed into pins with one end formed into a mushroom-style dome, probably in a hot drop-forging process.

A rivet is heated to red-hot, then placed through pre-aligned holes in the sheets to be joined, and its straight end is hammered to a mushroom shape to match the domed end. The rivet then cools down and contracts, putting it under tension and drawing the two sheets together very tightly. Tightly enough in fact that it can form a seal against water or high-pressure steam, as shown by iron rivets being used in the construction of ships, or high-pressure boilers. How is this possible? Let’s take a look!

Continue reading “The Forgotten Art Of Riveted Structures”