Posts in Electronics (20 found)
Daniel Mangum 6 days ago

Using a Laptop as an HDMI Monitor for an SBC

Though I spend the majority of my time working with microcontroller class devices, I also have an embarassingly robust collection of single board computers (SBC), including a few different Raspberry Pi models, the BeagleV Starlight Beta (RIP), and more. Typically when setting up these devices for whatever automation task I have planned for them, I’ll use “headless mode” and configure initial user and network credentials when writing the operating system to the storage device using a tool like Raspberry Pi’s Imager.

0 views
Stavros' Stuff 1 weeks ago

I made a really small LED panel

I bought a really small 8x8 LED panel a while ago because I have a problem. I just can’t resist a nice WS2812 LED panel, much like I can’t resist an e-ink display. These days I manage to stay sober, but once in a while I’ll see a nice cheap LED panel and fall off the wagon. It has now been thirteen minutes that I have gone without buying LED panels, and this is my story. This isn’t really going to be super interesting, but there are some good lessons, so I thought I’d write it up anyway. On the right you can see the LED panel I used, it’s a bare PCB with a bunch of WS2812 (Neopixel) addressable LEDs soldered onto it. It was the perfect excuse for trying out WLED , which I’ve wanted to take a look at for ages, and which turned out to be absolutely fantastic. As with every light-based project, one of the big issues is proper diffusion. You don’t want your LEDs to show up as the points of light they are, we really like nice, big, diffuse lights, so you need a way to do that. My idea was to print a two-layer white square out of PLA (which would be translucent enough to show the light, but not so translucent that you could see the LEDs behind it. I also printed a box for the square to go in front of: I printed the diffuser (the white square) first, held it over the LED panel and increased or decreased the distance of the square from the LEDs until the LEDs didn’t look like points, but the colors also didn’t blend into the neighboring squares’ colors. This turned out to be around 10mm, so that’s how thick I made the box. The eagle-eyed among you may want to seek medical assistance, but if you have normal human eyes, you may have noticed that there’s nowhere in the box for the microcontroller to go, and you would be correct. For this build, I decided to use an ESP8266 (specifically, a WeMos dev board), but I didn’t want to make the whole box chunky just to fit a small microcontroller in there, so I did the next best thing: I designed a hole in the back of the box for the cables that connect to the LED panel, and I glued the ESP8266 to the back of the box. YOLO. Look, it works great, ok? The cables are nice and shortish, even though they go to the entirely wrong side of the thing, the USB connector is at a very weird place, and the ESP8266 is exposed to the elements and the evil eye. It’s perfect. Here’s the top side, with the diffuser: And here’s the whole mini tiny cute little panel showing some patterns from WLED (did I mention it’s excellent? It is). That’s it! I learned a few things and made a cute box of lights. I encourage you to make your own, it’s extremely fun and mesmerizing and I love it and gave it to a friend because I never used it and it just took up space and then made a massive 32x32 version that I also never use and hung it on my wall. Please feel free to Tweet or toot at me, or email me directly.

0 views
Jeff Geerling 1 weeks ago

Qualcomm's buying Arduino – what it means for makers

Qualcomm just announced they're acquiring Arduino , the company that introduced a whole generation of tinkerers to microcontrollers and embedded electronics. The Uno R3 was the first microcontroller board I owned. Over a decade ago, I blinked my first LED with an Uno; the code for that is actually still up on my GitHub .

0 views
Christian Jauvin 1 weeks ago

Ignore Your Check Engine Light at Your Own Peril

Currently in my car I have the “check engine” light being on, but it’s ok, because I know what is the problem, my mechanic told me that it’s , and that even though it’s not ideal, it can wait while he finds the part to repair it (apparently it’s not so easy to find). There is something I don’t like about this though: if there is a NEW problem appearing, I won’t know about it, because this check engine light has only one state, and now it’s being used.

1 views
Fakeman Show 1 months ago

Reverse Engineering a 1979 Camera's Spec

I bought a 1979 Chinon CM-4 film camera in Tijuana. Film is expensive, so before wasting a roll I decided to learn exactly how this machine works — by taking apart its specs, one line at a time. So here is my three step plan Understand what I really have in my hands. Michael Butkus created a comprehensive document that covers the details and specifications of the Chinon CM 4.

0 views
Stavros' Stuff 5 months ago

I couldn't wait for a TRMNL device, so I made my own

Some time ago, my friend George linked me to TRMNL , a new battery-powered e-ink display with an associated service that generates the images that the display will actually show. It looks really well-made, and I have an irrational attraction to e-ink displays, so naturally I had to pre-order one. Their website is a bit confusing, and doesn’t entirely tell you what the things you’re buying are, which made the purchasing experience somewhat more painful than it needed to be. For example, along with the device, they sell a $20 “developer edition” license which “unlocks their API”. I expected this upgrade to give me API access so I could retrieve the image that’s displayed of my device, but that’s not actually the case, and you need a $50 “virtual device” license for that. Anyway, I did manage to preorder the thing, but it will take a few months to arrive, and if there’s one thing I’m not known for, it’s my patience. Having seen quite a few AliExpress listings in my time, I knew that the screen that TRMNL are using goes for under $50, and that I can get an ESP32 driver board for around $20. I would post links to these components on AliExpress, but they would probably go stale before the ink on your screen is dry, so I’ll post links to the Waveshare website: The display is a Waveshare 800x480 7.5” e-ink (get the black and white version, more colors are much slower) and the driver is a Waveshare ESP32 driver board . With those components, a LiPo battery, a charging board, a bit of designing, and some 3D printing, I could have my own TRMNL for under $80, or, if you factor in my time, around $5,000, which is a bargain. Plus, these would arrive much more quickly than the actual TRMNL, which is still months away, so I ordered and waited. This isn’t my first time working with e-ink displays, as I’ve made things like the Timeframe , the Weatherframe (which I never wrote about), and Calumny (which I also never wrote about), so I knew more or less what to expect. You see, the issue with most e-ink projects these days is that they mostly do one of two things: Basically the only projects I’m aware of that fetch an image from a server and display it on the e-Ink display using an ESP32 are the Timeframe (my project that I linked above), and the TRMNL, so I wanted to use what they built. My hardware setup was pretty simple, I just used the display and the driver. I don’t need a battery or a charger for this particular use case, so I just omitted those and connected my device to USB directly. This also means that I don’t need the display to sleep for a long time (because it doesn’t need to conserve battery), so I can have it refresh itself pretty often. In the future, I might connect a LiPo battery and a charging circuit to the driver, at which point I’ll figure out how to read the voltage so the former can report the latter to the server, but for now that won’t be necessary. TRMNL have open-sourced one part of their stack: The firmware that runs their custom ESP32 board. This firmware is pretty nice, it fetches a bog-standard PNG from a server and displays it onto the e-ink display, which is a really nice way to draw stuff onto the display. It also takes care of sleeping between updates (for consuming very little energy), reporting the device’s battery, etc, which is very nice to have. The only problem is that the firmware is pretty custom for their own board, and didn’t run on the generic Waveshare ESP32 driver I had. I thought, however, that if I could get the firmware to run on the generic, $20 Waveshare driver, that would be a great addition to the ecosystem, and it would make TRMNL more money, since you have to buy their $50 BYOD license to connect custom devices to their servers, so it’s a win-win. To clarify, using their firmware on your own hardware, you can create an e-ink device that works with TRMNL’s online service (the one that generates the screens to show), you just need to pay TRMNL $50 to use their service forever (“forever” is startup-speak for “an average of three years until our VCs force us to extract more money from you in the form of a subscription”) . I immediately set out programming and debugging, by which I mean “I pasted the error messages into Aider and let Gemini figure out what the hell was wrong”. The AI very quickly fixed all the stuff that was wrong, and the display sprang to life, showing the TRMNL logo! Isn’t the future amazing? Really, TRMNL’s firmware required minimal changes to work with the Waveshare driver. Most of the changes were just changing the pin numbers from one board’s to the others, as well as adapting for the fact that the Waveshare board doesn’t have a button or a battery, and uses an ESP32 instead of an ESP32-C3. If you want to use the official firmware with the Waveshare driver, the changes I’ve made are in my TRMNL firmware repo fork: https://github.com/skorokithakis/trmnl-firmware My patch has now been upstreamed! All you need to do to use this is to clone the official firmware and run ! Using TRMNL’s online service is very easy once the firmware is running on the hardware. All you need to do is buy the BYOD license, and claim the device by entering the ESP32 driver’s MAC address. Then your HACKRMNL will talk to the server, provision an API key for itself, and go to work! I 3D-printed a holder for the Waveshare display , but I saw a really nice project that uses the same display on a wooden base that I think I’ll copy instead. I’m really pleased with the final result, and I think the TRMNL itself will be even better, as it won’t have the annoying cable and will come with a better-looking case. That’s all for this build, I was really happy that I managed to get the official firmware working with generic components, and I wanted to share it with you in the hopes that it would help you with your own builds. As always, you can Tweet or BlueSky at me, or email me directly. I ended up not really liking the base that I printed above, and I decided to make a simpler, rectangular one. Since aesthetics dictated that the base be a bit bulky, I figured I might as well stick two 2,500 mAh batteries in it, for month-long battery life. Here’s the new design: Everything is hidden inside the base, and the whole device looks really sleek and minimal. It is a bit dangerous, because any slight amount of pressure at the top could cause leverage at the bottom, and cause the display to break, but hopefully I’ll be careful with it. However, I will say it’s really impressive to see a 1mm-thick pane of glass change appearance before your very eyes, and flash into new text and graphics. It’s exactly how a Kindle (or any other e-ink) display works, but it’s really impressive to see that happen to a thin sliver of glass, rather than a thick tablet. Anyway, to convert the board to work on a battery, we need to solve a few issues: Powering it via USB originally was simple, as you can see above (I just plugged the USB cable into the driver, and that was it), however batteries need a bit more care. Because e-ink displays consume basically no energy unless they’re refreshing, and the driver spends most of its life sleeping, you really need to make sure that none of your random components consume power, otherwise your battery is going to be wasted on things that don’t matter. To ensure minimal waste, a few things needed to be taken care of: First of all, the driver has two switches on it. One controls some resistor for driving the display, so you either set it to A or B, depending on what makes your display work, but that already works for me, so we aren’t touching that. The second switch can turn the USB to UART component off, so you can save power if you don’t want to connect your driver to USB. Since I’ve already flashed the firmware on it, and since I can update the firmware over WiFi in a pinch (since the TRMNL firmware supports that), I’m going to turn the switch off to save power. After that’s done, we need a low quiescent current step-down converter, to convert the 3.5 V-4.2 V of the battery to the 3.3V that our ESP32 and display need to work, without wasting current in the process. For this, I used a ND0603PC step-down converter with 260 μA of quiescent current, which should be good enough. This takes care of powering the driver. This was fairly simple, the two batteries are connected in parallel, so to charge them I used a TP4056 USB-C charging circuit. I just connected them to the “output” side of the charger, and it took care of the rest. Our device is now alive, but, like life, the hard part just began. We can’t have a battery-powered device with no way to read the battery voltage, we need to know how full our battery is so we know when to charge it. The TRMNL firmware makes that easy, as it can read the voltage out from one of the analog pins. Unfortunately, the ESP32 only supports up to 3.3 V on its pins, so we can’t connect the battery directly to it, or we’ll fry the ADC. We need a voltage divider, which fortunately is a very simple circuit, consisting of two resistors. I used two 47 kΩ resistors, to divide the voltage by two, which means the maximum voltage that will reach the pin will be 2.1 V when the battery is at 4.2 V. The TRMNL firmware read the battery level very accurately, and reported it back to the TRMNL service, so now I can see the exact battery level of both batteries (it’s always the same between the two, since they’re connected in parallel). That’s the circuit done! There are a few pin definitions to be changed in the software, but those are trivial (we basically only need to declare the pin we connected the voltage divider to, so the ESP32 can read the battery voltage). That’s pretty well explained in the code (it’s just a one-line change), so I won’t go into it here. Here’s the complete circuit I ended up with: If you want to print the base for your display, you can find the designs at OnShape . Thanks for reading this far, see you on the next post! It’s probably going to be about e-ink again, since I’ve made stuff I still need to write up. They use an ESP32 to drive the display, which is cheap and convenient, but they generate their own graphics on the ESP32 itself, making the project very ad-hoc. They use a Raspberry Pi (usually a Zero W), making the project pretty generic, as you can show advanced graphics or fetch files from remote servers, but that’s not very convenient because you now need to maintain a whole Linux device on your network.

0 views
Daniel Mangum 8 months ago

Accessing the Qualcomm Modem over USB on the RAK5010

I have recently been working with the RAKwireless RAK5010 development board. It includes the popular Nordic nRF52840 MCU for running applications on its Cortex-M4 CPU that can leverage the integrated 2.4 GHz multiprotocol support, as well as the LTE and GNSS support offered by the on-board Quectel BG95-M3 module. The micro-USB port on the board is connected to USB on the nRF52840, which allows for viewing serial output, but is not a mechanism for flashing new firmware.

0 views
@hannahilea 9 months ago

Slidey doots: Slide whistle as Trombone Champ controller

Project write-up of turning a slide whistle into a wireless controller for the video game Trombone Champ.

0 views

De-smarting the Marshall Uxbridge

This is the story of a commercially unavailable stereo pair of the bi-amped Marshall Uxbridge, with custom-built replacement electronics: active filters feeding two linear power amps. Listening to this high-fidelity set has brought me immense enjoyment. Play a great album on these near-fields, and the result is close to pure magic! Over and above the accurate reproduction of a wide audio range, the precision and depth of its stereo imaging is stunning.

0 views
Daniel Mangum 9 months ago

VPR: Nordic's First RISC-V Processor

VPR (pronounced “Viper”) is Nordic Semiconductor’s first RISC-V processor, landing in the new nRF54H and nRF54L lines of SoCs after their initial announcements in April and October of 2023 respectively. Readers of this blog are familiar with my long-running obsession interest in RISC-V (see my RISC-V Tips and RISC-V Bytes series). However, Nordic’s introduction of a RISC-V processor is particularly interesing to me as their lineup of microcontrollers is extremely popular in low power wireless domains, a common use case for Golioth customers.

0 views
Daniel Mangum 10 months ago

USB UART on the Thingy:91 X

Nordic Semiconductor recently made their new IoT prototyping platform, the Thingy:91 X, generally available. The Thingy:91 X is an upgrade to their existing prototyping platform, the Thingy:91, replacing the nRF9160 System-in-Package (SiP) with an nRF9151 SiP, the nRF52840 System-on-Chip (SoC) with an nRF5340 SoC, and adding the nRF7002 integrated circuit (IC). Each of these components enables a different type of connectivity: nRF9151: cellular (LTE-M / NB-IoT), DECT NR+, GNSS nRF5340: Bluetooth LE, 802.

0 views
Daniel Mangum 11 months ago

USB On-The-Go on the ESP32-S3

The ESP32-S3 is a popular microcontroller (MCU) for a variety of reasons, such as its support for external pseudostatic RAM (PSRAM). One of its lesser known features is its Universal Serial Bus (USB) On-The-Go (OTG) controller. The previously released ESP32-S2, as well as the new ESP32-P4, also have USB OTG support, with the latter having two controllers. USB OTG devices can act as a device or as a host. This is a popular feature for smartphones, which, when attached to a laptop or desktop should act as a device, but may want to act as a host for some peripherals, such as a keyboard, that may be attached to it.

0 views

Taming the buck with a Type III compensator

I recently designed and built my first DC/DC converter, a synchronous buck regulating some hefty DC currents. It turned out to work okay-ish (except the overvoltage crowbar), but I had a nagging feeling that it could (and should) be improved further. Even though the prototype made it through a testing regime of load currents (up to the full rated load of 5A) effected via mechanical switches without self-destructing, one thing that kept bothering me was the substantial ringing in response to a modest 1A load step.

0 views
@hannahilea 12 months ago

Clapping Music for one flip-disc display: Byte and variations

Reich’s Clapping Music performed on a single electromechanical flip-disc display.

0 views

Synchronous buck converter for 12V/5A output

What is the logical next step after making a linear regulator ? I learned some valuable lessons (both regarding general electronics and power supplies) doing that project, so I believe I could now make a much better linear supply. And perhaps I will! But now I decided it was time to aim for a switch-mode power supply (SMPS), a.k.a DC/DC converter. This article documents my take on a synchronous buck regulator for outputting 12V at currents up to 5A, from an input voltage that is nominally 48V, but in practice can be between 15V and 55V. This circuit is my original design, so I will go into a lot of detail on how it works, and share ample measurement data around its performance and efficiency.

0 views
@hannahilea 1 years ago

Clapping Music for two flip-disc displays

Reich’s Clapping Music performed on a pair of electromechanical flip-disc displays.

0 views
Stavros' Stuff 1 years ago

Making the Strofara

This is going to be pretty specific to a Greek audience, as it’s all based on a Greek meme video, but I’ll try to explain. Watch the video first so you know what I’m talking about while I describe it: Two guys are driving on a road near a remote village in Crete, and the guy on the passenger seat is excited about the prospect of speeding around the turn. At some point, he exclaims “wow, what a turn, come on Giorgi!”, and Giorgis speeds into the turn and they promptly crash and tumble, with perfect comedic timing. (They were both unharmed, by the way, and their friends made a joke video commemorating the feat). I recently saw the video, and thought it was pretty funny, so it was kind of stuck in my head. One day, while driving, I took a turn, and thought of the guy saying the phrase he became famous for, and then thought it would be funny if my car could, autonomously, encourage me in a similar way whenever I took a big turn. I realized that it would be fairly easy to detect turns, using an accelerometer, and I had a board that can play MP3 files off a MicroSD card, so I figured I’d cobble them all together and see if it worked. I didn’t want to play the audio through the car’s speakers, I wanted the audio to come from somewhere inside the car, so I decided to use a speaker and bury it somewhere in my car’s insides, to pleasantly surprise any second-hand owner that might eventually buy the car, long after I’ve forgotten that this thing is in its bowels. I used an MPU-6050 accelerometer breakout board, it was really easy to connect it to an ESP8266 , and with some sample code and existing libraries, I was quickly on my way to detecting turns. I used the X axis component of the accelerometer, as that’s the lateral acceleration component in the way I was planning to mount it, and wrote some code to detect whether I’m in a tight turn for longer than half a second. If both those conditions are true, then a GPD2856A board is used to play the actual audio file. The GPD2856A is pretty convenient if you want to make an MP3 player, as it includes all the volume/play/pause/repeat/whatever controls you need for a standalone player, but pretty inconvenient if you just want to use a microcontroller to play an audio file, as the GPD2856A won’t interface with the microcontroller at all. All it does is play files in sequence (and in a loop) when it starts up, forever. This wouldn’t do me any good, as I just want to play one file once, so I hooked it up to an N-MOSFET so I can turn it on and off with the ESP8266. When I want to play the file, I tell the MOSFET to turn on the entire board, and when I want to stop, I just tell it to turn off. This works decently, but the board has some timing issues that mean that it doesn’t always start playing from the very beginning of the file, but sometimes skips half a second at the start. This means that the “wow” at the beginning is cut off, which is less than ideal. The way I fixed that is to simply insert half a second of silence at the start of the audio file. This means that I consistently get the whole phrase, but there’s a half a second delay, which might mess with my comedic timing while driving. I’ll have to test that and see, but, if it doesn’t work, my only other alternative will be to use an ESP32 and a proper driver. The board plays over a fairly big speaker that my friend Agis salvaged from some twenty-year-old PC speakers he had, and it’s really loud. I thought the USB current wouldn’t be enough to drive any significant volume, but it’s loud enough to startle me the first time the audio played over the speaker. After connecting the ESP8266, the accelerometer, the MP3 player, and the speaker together, the only thing that remained was an enclosure worthy of such a legendary device. I decided to not bother with that, and instead designed a simple square case, though I did emboss the immortal words all around it. I quickly printed the enclosure out, and after some creative glueing, lamenting that I had measured wrongly and it was 1mm too short to fit everything, and printing it again, the Strofara was complete! You can see a photo of it to the right, it looks every bit as regal in real life as it does in that photo. On the middle bottom of the right face, you will notice the USB connector that powers the device (and also gives me access to the ESP8266 if I need to reprogram it). Of course, what would this post be without a taste of the actual, finished product, complete with audio? Just text. Here’s a video demonstration, by yours truly, in Greek (you don’t really need to understand anything I’m saying, it’s all random filler anyway): </lite-youtube> Amazing, isn’t it? As with mostly everything else, the code is open source, though there isn’t really much code to speak of: https://github.com/skorokithakis/strofara If you have any comments or feedback, please tweet or toot at me, or email me directly.

0 views