I2C For Hackers: The Basics

You only really need two data wires to transfer a ton of data. Standards like UART, USB2, I2C, SPI, PS/2, CAN, RS232, SWD (an interface to program MCUs), RS485, DMX, and many others, all are a testament to that. In particular, I2C is such a powerful standard, it’s nigh omnipresent – if you were to somehow develop an allergy to I2C, you would die.

Chances are, whatever device you’re using right now, there’s multiple I2C buses actively involved in you reading this article. Your phone’s touchscreen is likely to use I2C, so is your laptop touchpad, most display standards use I2C, and power management chips are connected over I2C more often than not, so you’re covered even if you’re reading this on a Raspberry Pi! Basically everything “smart” has an I2C port, and if it doesn’t, you can likely imitate it with just two GPIOs.

If you’re building a cool board with a MCU, you should likely plan for having an I2C interface exposed. With it, you can add an LCD screen with a respectable resolution or a LED matrix, or a GPS module, a full-sized keyboard or a touchpad, a gesture sensor, or a 9 degree of freedom IMU – Inertial Measurement Unit, like a accelerometer+compass+gyroscope combination. A small I2C chip can help you get more GPIOs for your MCU or CPU, or a multi-channel motor driver, or a thermal camera, or a heap of flash memory; if you’re adding some sort of cool chip onto your board, it likely has an I2C interface to let you fine-tune its fancy bits.

As usual, you might have heard of I2C, and we sure keep talking about it on Hackaday! There’s a good few long-form articles about it too, both general summaries and cool tech highlights; this article is here to fill into some gaps and make implicit knowledge explicit, making sure you’re not missing out on everything that I2C offers and requires you to know!

Continue reading “I2C For Hackers: The Basics”

Hack On Self: Sense Of Time

Every now and then, a commercial product aims to help you in your life journey, in a novel way, making your life better through its presence. Over the years, I’ve been disappointed by such products far more often than I have been reassured, seeing each one of them rendered unimaginative and purposeless sometimes even despite the creator’s best intentions. The pressures of a commercial market will choke you out without remorse, metal fingers firmly placed on your neck, tightening with every move that doesn’t promise profit, and letting money cloud your project’s vision. I believe that real answers can only come from within hacker communities, and as we explore, you might come to see it the same way.

This is the tip of the iceberg of a decade-long project that I hope to demonstrate in a year or two. I’d like to start talking about that project now, since it’s pretty extensive; the overall goal is about using computers to help with human condition, on a personal level. There’s a lot of talk about computers integrating into our lives – even more if you dare consult old sci-fi, much of my inspiration.

Tackling a gigantic problem often means cutting it down into smaller chunks, though, so here’s a small sub-problem I’ve been working on, for years now, on and off: Can you use computers to modify your sense of time?

Continue reading “Hack On Self: Sense Of Time”

Embedded Python: MicroPython Toolkits

Last time, I talked about how MicroPython is powerful and deserving of a place in your toolkit, and it made for a lively discussion. I’m glad to see that overall, MicroPython has indeed been getting the recognition it deserves – I’ve built a large number of wonderful projects with it, and so have people I’ve shown it to!

Sometimes I see newcomers dissatisfied with MicroPython, because the helper tools they initially pick don’t suit it well. For instance, they try and start out with a regular serial terminal application that doesn’t fit the MicroPython constraints, or a general IDE that requires a fair bit of clicking around every time you need to run your code. In particular, I’d make sure that you know your options no matter whether you prefer GUI or commandline – both have seriously nice tools for MicroPython use!

The main problem to be solved with MicroPython is that you have a single serial port that everything happens through – both file upload and also debugging. For ESP8266/32-based boards, it’s a physical serial port, and for chips like RP2040 and ESP32-S* where a hardware USB peripheral is available, it’s a virtual one – which makes things harder because the virtual port might get re-enumerated every now and then, possibly surprising your terminal application. If you want to upload a program of yours, you need to free up the serial port, and to see the program’s output, you will need to reopen that port immediately after – not a convenient thing to do if you’re using something like PuTTy.

So, using MicroPython-friendly software is a must for a comfortable hacking experience. What are your options? Continue reading “Embedded Python: MicroPython Toolkits”

Over-molding Wires With Hot Glue And 3D Printed Molds

We’ve said it before and we’ll say it again: water always finds a way in. That’s particularly problematic for things like wire splices in damp environments, something that no amount of electrical tape is going to help. Heat shrink tubing might be your friend here, but for an electrically isolated and mechanically supported repair, you may want to give over-molding with a hot glue gun a try.

The inspiration for [Print Practical]’s foray into over-molding came from a video that’s making the rounds showing a commercially available tool for protecting spliced wires in the automotive repair trade. It consists of a machined aluminum mold that the spliced wires fit into and a more-or-less stock hot glue gun, which fills the mold with melted plastic. [Print Practical] thought it just might be possible to 3D print custom molds at home and do it himself.

His first attempt didn’t go so well. As it turns out, hot glue likes to stick to things — who knew? — including the PETG mold he designed. Trying to pry apart the mold after injection was a chore, and even once he got inside it was clear the glue much preferred to stay in the mold. Round two went much better — same wire, same mold, but now with a thin layer of vegetable oil to act as a release agent. That worked like a charm, with the over-mold standing up to a saltwater bath with no signs of leaking. [Print Practical] also repaired an iPhone cable that has seen better days, providing much-needed mechanical support for a badly frayed section.

This looks like a fantastic idea to file away for the future, and one that’s worth experimenting with. Other filament types might make a mold better able to stand up to the hot glue, and materials other than the ethylene-vinyl acetate copolymer found in most hot glue sticks might be explored. TPU over-molds, anyone? Or perhaps you can use a printer as an injector rather than the glue gun.

Continue reading “Over-molding Wires With Hot Glue And 3D Printed Molds”

Hackaday Podcast Episode 282: Saildrones, A New Classic Laptop, And SNES Cartridges Are More Than You Think

In this episode, the CrowdStrike fiasco has Hackaday Editors Elliot Williams and Tom Nardi pondering the fragility of our modern infrastructure. From there the discussion moves on to robotic sailboats, the evolving state of bespoke computers, and the unique capabilities of the Super Nintendo cartridge. You’ll also hear about cleaning paintings with lasers, the advantages of electronic word processors, stacking 3D printed parts, and the joys of a nice data visualization. They’ll wrap the episode up by marveling at the techniques required to repair undersea fiber optic cables, and the possibilities (and frustrations) of PCB panelization using multiple designs.

Check out the links below if you want to follow along, and as always, tell us what you think about this episode in the comments!

As always, the Hackaday Podcast is available in DRM-free MP3 for offline listening.

Continue reading “Hackaday Podcast Episode 282: Saildrones, A New Classic Laptop, And SNES Cartridges Are More Than You Think”

A painted RC plane made of cardboard. It has an orange propeller and camo-esque markings along with concentric blue, white, and red circles near the wingtips.

Cardboard R/C Plane Actually Flies

Many makers start by building mock-ups from cardboard, but [Alex-08] has managed to build an R/C plane that actually flies, out of cardboard.

If you’ve been thinking of building an R/C plane from scratch yourself, this guide is an excellent place to start. [Alex-08] goes through excruciating detail on how he designed and constructed this marvel. The section on building the wings is particularly detailed since that’s the most crucial element in making sure this plane can get airborne.

Some off-the-shelf R/C parts and 3D printed components round out the parts list to complement the large cardboard box used for most of the structural components. The build instructions even go through some tips on getting that vintage aircraft feel and how to adjust everything for a smooth flight.

Need a wind tunnel instead? You can build that out of cardboard too. If paper airplanes are more your thing, how about launching them from space? And if you’re just trying to get a head start on Halloween, why not laser cut an airplane costume from cardboard?

Programming Ada: Implementing The Lock-Free Ring Buffer

In the previous article we looked at designing a lock-free ring buffer (LFRB) in Ada, contrasting and comparing it with the C++-based version which it is based on, and highlighting the Ada way of doing things. In this article we’ll cover implementing the LFRB, including the data request task that the LFRB will be using to fill the buffer with. Accompanying the LFRB is a test driver, which will allow us to not only demonstrate the usage of the LFRB, but also to verify the correctness of the code.

This test driver is uncomplicated: in the main task it sets up the LFRB with a 20 byte buffer, after which it begins to read 8 byte sections. This will trigger the LFRB to begin requesting data from the data request task, with this data request task setting an end-of-file (EoF) state after writing 100 bytes. The main task will keep reading 8-byte chunks until the LFRB is empty. It will also compare the read byte values with the expected value, being the value range of 0 to 99.

Continue reading “Programming Ada: Implementing The Lock-Free Ring Buffer”