Create A Discord Webhook With Python For Your Bot

Discord is an IRC-like chat platform that all the young cool kids are hanging out on. Originally intended as a way to communicate during online games, Discord has grown to the point that there are servers out there for nearly any topic imaginable. One of the reasons for this phenomenal growth is how easy it is to create and moderate your own Discord server: just hit the “+” icon on the website or in the mobile application, and away you go.

As a long-time IRC guy, I was initially unimpressed with Discord. It seemed like the same kind of stuff we’ve had for decades, but with an admittedly slick UI. After having used it for a few months now and joining servers dedicated to everything from gaming to rocket science, I can’t say that my initial impression of Discord is inaccurate: it’s definitely just a modern IRC. But I’ve also come to the realization that I’m OK with that.

But this isn’t a review of Discord or an invitation to join the server I’ve setup for my Battlefield platoon. In this article we’re going to look at how easy it is to create a simple “bot” that you can plug into a Discord server and do useful work with. Since anyone can create a persistent Discord server for free, it’s an interesting platform to use for IoT monitoring and logging by simply sending messages into the server.

Continue reading “Create A Discord Webhook With Python For Your Bot”

High Speed Imaging Of Magnetic Fields

Some time before experimenting with MRI machines and building his own CT scanner, [Peter Jansen] wanted to visualize magnetic fields. One of his small side projects is building tricoders — pocket sensor suites that image everything — and after playing around with the magnetometer function on his Roddenberry-endorsed tool, he decided he had to have a way to visualize magnetic fields. After some work, he has the tools to do it at thousands of frames per second. It’s a video camera for magnetic fields, pushing the boundaries of both magnetic imaging technology and the definition of the word ‘camera’.

When we last looked at [Peter]’s Hall effect camera, the device worked, but it wasn’t necessarily complete. The original design used I2C I/O multiplexers for addressing each individual ‘pixel’ of the Hall effect array, limiting the ‘framerate’ of the ‘camera’ to somewhere around 30 Hz. While this would work for visualizing static magnetic fields, the more interesting magnetic fields around us are oscillating — think motors and transformers and such. A much faster magnetic camera was needed, and that’s what [Peter] set out to build.

Instead of an I/O expander, [Peter] re-engineered his design to use analog multiplexers and a binary counter to cycle through each pixel, one at a time. Basically, the new circuit uses two analog muxes for the columns and rows of the Hall effect array, a binary counter to cycle through each pixel at Megahertz speed, and a fast ADC to read each value. It is, bizarrely, the 1970s way of doing things; these are simple chips, and the controller (a Chipkit Max32) only needs to read a single analog value and clock the binary counter really fast.

With the new design, [Peter] is able to get extremely fast frame rates of about 2,000 Hz. That’s fast enough for some beautiful visualizations of spinning motors and transformers, seen in the video below. Further improvements may include three-axis magnetometers, which should allow for some spectacular visualizations similar to [Ted Yapo]’s 3D magnetic field scanner.

Continue reading “High Speed Imaging Of Magnetic Fields”

Arduino Keyboard Is Gorgeous Inside And Out

While the vast majority of us are content to plod along with the squishy chiclet keyboards on our laptops, or the cheapest USB membrane keyboard we could find on Amazon, there’s a special breed out there who demand something more. To them, nothing beats a good old-fashioned mechanical keyboard, where each key-press sounds like a footfall of Zeus himself. They are truly the “Chad” of the input device world.

But what if even the most high end of mechanical keyboards doesn’t quench your thirst for spring-loaded perfection? In that case, the only thing left to do is design and build your own. [Matthew Cordier] recently unveiled the custom mechanical keyboard he’s been working on, and to say it’s an elegant piece of engineering is something of an understatement. It may even look better inside than it does on the outside.

The keyboard, which he is calling z.48, is based around the Arduino Pro Micro running a firmware generated on kbfirmware.com, and features some absolutely fantastic hand-wiring. No PCBs here, just a rainbow assortment of wire and the patience of a Buddhist monk. The particularly attentive reader may notice that [Matthew] used his soldering iron to melt away the insulation on his wires where they meet up with the keys, giving the final wiring job a very clean look.

Speaking of the keys, they are Gateron switches with DSA Hana caps. If none of those words mean anything to you, don’t worry. We’re through the Looking Glass and into the world of the keyboard aficionado now.

Finally, the case itself is printed on a CR-10 with a 0.3 mm nozzle and 0.2 mm layers giving it a very fine finish. At 70% infill, we imagine it’s got a good deal of heft as well. [Matthew] mentions that a production case and a PCB are in the cards for the future as he hopes to do a small commercial run of these boards. In the meantime we can all bask in the glory of what passes for a prototype in his world.

We’ve seen some exceptionally impressive mechanical keyboards over the years, including the occasional oddity like the fully 3D printed one and even one that inexplicably moves around. But this build by [Matthew] has to be one of the most elegant we’ve ever come across.