For most of us, the solution to having a non-dimmable LED light bulb but needing a dimmable one is a simple as a drive to the store to get the right kind of bulb. But that seems downright boring, not to mention wasteful, so when [Leo Fernekes] was faced with this problem, he looked for a way to make a non-dimmable bulb dimmable.

To be fair, there was a financial aspect to this hack, too. [Leo] had a bunch of cheap non-dimmable light fixtures he wanted to put to use. He started with a teardown and reverse-engineering of a light strip, which contains little more than LEDs and a small buck converter. His analysis of the circuit led him to a solution for dimming the light: inserting a MOSFET as a shunt around the LEDs. That and the addition of a diode to isolate the LEDs from the current regulator would allow for simple PWM-control of the lights via a microcontroller.

As is typical with these things, there were complications. [Leo] found that a timing problem resulted in flickering LEDs; the fix came from adding a sync circuit that cleverly leveraged a flip-flop inside the PIC16 microcontroller he chose for the circuit. His prototype incorporates these modifications, plus an interface that supports the DALI protocol for architectural lighting control. As always, [Leo] is quick to point out that mixing line voltage into your projects is not without risks, which he takes pains to mitigate. And as is also typical for his projects, [Leo] gives just the right amount of detail to understand the theory behind his design.

Continue reading “Hacking A Non-Dimmable LED Fixture”

There was a time when a microphone for most people was a cheap plastic affair that probably came for free with their sound card, but in the age of pandemic video streaming no desktop is complete without a chunky model that looks for all the world as though it escaped from a studio. Few people make their own microphones, so the work of [DJJules] in building very high quality condenser microphones is a particularly fascinating read.

A condenser microphone is a capacitor in which one plate is formed by a conductive diaphragm. A bias voltage is supplied to the diaphragm via a resistor, and since the charge on the plate remains constant as its capacitance changes with the sound vibrations, the voltage on the capacitor changes accordingly. This is picked up by a high impedance buffer and from there fed to a normal microphone input. This Instructable uses a commercial condenser microphone capsule, and takes the reader through generating the bias voltage for it before describing the op-amp buffer circuit.

The most interesting part comes at the end, as we’re shown how the sensitivity pattern of a dual-microphone array can be tuned to be omnidirectional, cardoid, or figure-of-eight. This is probably the norm among audio engineers, but we rarely see this sort of insight in our community. We may never build a microphone of our own, but it’s fascinating to see this one from the ground up in the video below the break.

If you’re confused about the difference between a condenser microphone and the more common electret condenser microphone, we have published a guide to that topic. Continue reading “Taking A Capacitor Microphone To The Next Level”

When do you need to use a real-time operating system (RTOS) for an embedded project? What does it bring to the table, and what are the costs? Fortunately there are strict technical definitions, which can also help one figure out whether an RTOS is the right choice for a project.

The “real-time” part of the name namely covers the basic premise of an RTOS: the guarantee that certain types of operations will complete within a predefined, deterministic time span. Within “real time” we find distinct categories: hard, firm, and soft real-time, with increasingly less severe penalties for missing the deadline. As an example of a hard real-time scenario, imagine a system where the embedded controller has to respond to incoming sensor data within a specific timespan. If the consequence of missing such a deadline will break downstream components of the system, figuratively or literally, the deadline is hard.

In comparison soft real-time would be the kind of operation where it would be great if the controller responded within this timespan, but if it takes a bit longer, it would be totally fine, too. Some operating systems are capable of hard real-time, whereas others are not. This is mostly a factor of their fundamental design, especially the scheduler.

In this article we’ll take a look at a variety of operating systems, to see where they fit into these definitions, and when you’d want to use them in a project. Continue reading “Real-Time OS Basics: Picking The Right RTOS When You Need One”

The idea of camless automotive engines has been around for a while but so far has been limited to prototypes and hypercars. [Wesley Kagan] has been working on a DIY version for a while, and successfully converted a Mazda Miata to a camless valve system. See the videos after the break.

There have been many R&D projects by car manufacturers to eliminate camshafts in order to achieve independent valve timing, but the technology has only seen commercial use on Koenigsegg hypercars. [Wesley] started this adventure on a cheap single cylinder Harbor Freight engine, and proved the basic concept, so he decided to move up to an actual car. He first sourced a junkyard engine head to convert, and use as a drop-in replacement for the head on the complete project car. An off-the-shelf double-acting pneumatic cylinder is mounted over each valve and connected to the valve stem with a custom adaptor. The double-acting cylinder allows the valve to be both opened and closed with air pressure, but [Wesley] still added the light-weight return spring to keep the valve closed if there is any problem with the pneumatic system.

The controller is an Arduino, and it receives a timing signal from a factory crankshaft and operates the pneumatic solenoid valves via MOSFETs. After mounting the new head and control box into the Miata, it took a couple of days of tuning to get the engine running smoothly. Initial tests were done using the compressor in his garage, but this was replaced with a small compressor and air tank mounted in the Miata’s boot for the driving tests.

Although the pneumatic system works well for short test drives, the compressor is quite noisy and adds a couple of points of failure. [Wesley] is also working on a solenoid actuated system, which would require a lot more current from the battery and alternator, but he believes it’s a better long-term solution compared to compressed air. However, he is still struggling to find solenoids with the required specifications. Continue reading “Deleting The Camshafts From A Miata Engine”

As a society in the USA and other parts of the world, we don’t give much thought to the twisting vines of civilization that entangle our skies and snake beneath our streets. The humming electrical lines on long poles that string our nations together are simply just there. Ever-present and immutable. We expect to flick the switch and power to come on. We only notice the electrical grid when something goes wrong and there is a seemingly myriad number of ways for things to go wrong. Lighting strikes, trees falling on lines, fires, or even too many people trying to crank on the A/C can all cause rolling blackouts. Or as we found out this month, cold weather can take down generation systems that have not been weatherized.

We often hear the electrical grid described as aging and strained. As we look to the future and at the ever-growing pressure on the infrastructure we take for granted, what does the future of the electrical grid look like? Can we move past blackouts and high voltage lines that criss-cross the country?

Continue reading “Increasing The Resolution Of The Electrical Grid”

Most people find two problems when it comes to flip-dot displays: where to buy them and how to drive them. If you’re [Pierre Muth] you level up and add the challenge of driving them fast enough to rival non-mechanical displays like LCDs. It was a success, resulting in a novel and fast way of controlling flip-dot displays.

Gorgeous stackup of the completed display. [Pierre] says soldering the 2500 components kept him sane during lockdown.

If you’re lucky, you can get a used flip-dot panel decommissioned from an old bus destination panel, or perhaps the arrivals/departures board at a train station. But it is possible to buy brand new 1×7 pixel strips which is what [Pierre] has done. These come without any kind of driving hardware; just the magnetized dots with coils that can be energized to change the state.

The problem comes in needing to reverse the polarity of the coil to achieve both set and unset states. Here [Pierre] has a very interesting idea: instead of working out a way to change the connections of the coils between source and sink, he’s using a capacitor on one side that can be driven high or low to flip the dot.

Using this technique, charging the capacitor will give enough kick to flip the dot on the display. The same will happen when discharged (flipping the dot back), with the added benefit of not using additional power since the capacitor is already charged from setting the pixel. A circuit board was designed with CMOS to control each capacitor. A PCB is mounted to the back of a 7-pixel strip, creating modules that are formed into a larger display using SPI to cascade data from one to the next. The result, as you can see after the break, does a fantastic job of playing Bad Apple on the 24×14 matrix. If you have visions of one of these on your own desk, the design files and source code are available. Buying the pixels for a display this size is surprisingly affordable at about 100 €.

We’re a bit jealous of all the fun displays [Pierre] has been working on. He previously built a 384 neon bulb display that he was showing off last Autumn.

Continue reading “30 FPS Flip-Dot Display Uses Cool Capacitor Trick”

What is the easiest way to get audio from a WAV file into a line-level format, ready to be plugged into the amplifier of a HiFi audio set (or portable speaker)? As [Konrad Beckmann] demonstrated on Twitter, all you really need is a UART, a cable and a TRS phono plug. In this case a USB-TTL adapter based around the FTDI FT232R IC: the TTL-232R-3V3-AJ adapter with 12 Mbps USB on one end, and a 3 Mbps UART on the other end.

[Konrad] has made the C-based code available on GitHub. Essentially what happens underneath the hood is that it takes in a PCM-encoded file (e.g. WAV). As a demonstration project, it requires the input PCM files to be a specific sample rate, as listed in the README, which matches the samples to the baud rate of the UART. After this it’s a matter of encoding the audio file, and compiling the uart-sound binary.

The output file is the raw audio data, which is encoded in PDM, or Pulse-Density Modulation. Unlike Pulse-Code Modulation (PCM), this encoding method does not encode the absolute sample value, but uses binary pulses, the density of which corresponds to the signal level. By sending PDM data down the UART’s TX line, the other side will receive these bits. If said receiving device happens to be an audio receiver with an ADC, it will happily receive and play back the PDM signal as audio. As one can hear in the video embedded in the tweet, the end result is pretty good.

If we look at at the datasheet for the TTL-232R-3V3-AJ adapter cable, we can see how it is wired up:

When we compare this to the wiring of a standard audio TRS jack, we can see that the grounds match in both wirings, and TX (RX on the receiving device) would match up with the left channel, with the right channel unused. A note of caution here is also required: this is the 3.3V adapter version, and it lists its typical output high voltage as 2.8V, which is within tolerances for line-level inputs. Not all inputs will be equally tolerant of higher voltages, however.

Plugging random TRS-equipped devices into one’s HiFi set, phone or boombox is best done only after ascertaining that no damage is likely to result.  Be safe, and enjoy the music.