Image

A Guide To Using Triacs For Switching AC

For switching high-powered loads from a microcontroller, or for switching AC loads in general, most of us will reach into the parts bin and pull out a generic relay of some sort. Relays are fundamental, proven technologies to safely switch all kinds of loads. They do have their downsides, though, so if you need silent operation, precise timing, or the ability to operate orders of magnitude more times you might want to look at a triac instead. These solid state devices can switch AC loads unlike other transistor-based devices and [Ray] at OpenSprinkler is here to give us an overview on how to use them.

The key to switching an AC load is bi-directional conductivity. A normal transistor or diode can only conduct in one direction, so if you try to switch an AC load with one of these you’ll end up with what essentially amounts to a bad rectifier. Triacs do have a “gate” analogous to the base of a bipolar junction transistor, but the gate will trigger the triac when current flows in either direction as well. The amount of current needed to trigger the triac does depend on the state of the switched waveform, so it can be more complex to configure than a relay or transistor in some situations.

After going through some of the theory around these devices, [Ray] demonstrates how to use them with an irrigation system, which are almost always operating on a 24VAC system thanks to various historical quirks. This involves providing the triacs with a low voltage source to provide gate current as well as a few other steps. But with that out of the way, switching AC loads with triacs can become second nature. If you prefer a DC setup for your sprinklers, though, [vinthewrench] has demonstrated how to convert these sprinkler systems instead.

Image

Saving A Rental Ebike From The Landfill

One of the hardest things about owning a classic car is finding replacement parts. Especially if the car is particularly old or rare, or if the parent company is now out of business, sometimes this can be literally impossible and a new part will have to be manufactured from scratch. The same is true of bicycles as well, and there are plenty of defunct bicycle manufacturers to choose from. [Berm Peak] found a couple old rental ebikes from a company that’s not in business anymore and set about trying to get them working again. (Video, embedded below.)

Of course, unlike many classic cars, ebikes are encumbered by proprietary electronics and software that are much harder to replace than most physical components. As a result, these bikes get most of their electronics pulled out and directly replaced. This bike also had a seized motor, so [Berm Peak] replaced it with another hub motor he had in his shop. Some of the other highlights in the build include a custom 3D-printed latching mechanism for the battery’s attachment point at the frame, a 3D printed bezel for the new display and control unit, and the reuse of some of the other fun parts of the bike like the front basket and integrated headlight.

There are a few reasons for putting so much work into a bike like this. For this specific bike at least, the underlying components are worth saving; the sturdy metal frame and belt drivetrain are robust and won’t need much maintenance in the long term. It also only cost around $500 in parts to build a bike that would take around $2,000 to purchase new, so there’s some economic incentive as well. And in general it’s more fun and better for the world to fix things like this up and get them running again rather than buying something new off the shelf. And while proprietary electronics like those found on this bike are ubiquitous in the ebike world, they’re not all completely closed-source.

Continue reading “Saving A Rental Ebike From The Landfill”

Image

2025 One Hertz Challenge: Using Industrial Relays To Make A Flasher

These days, if you want to flash some LEDs, you’d probably grab a microcontroller. Maybe you’d go a little more old-school, and grab a 555. However, [Jacob] is even more hardcore than that, as evidenced by this chunky electromechanical flasher build.

[Jacob] goes into great detail on his ancillary write-up, describing how the simple building blocks used by industrial control engineers can be used to make a flasher circuit that cycles once per second. Basically, two relays are paired with two 0.5-second delay timers. The two relays tag each other on and off on delay as their timers start and expire, with the lamp turned on and off in turn.

We’ve had lots of other great entries to our One Hertz Challenge, too — from clocks to not-clocks. There’s still time to get an entry in — the deadline for submission is Tuesday, August 19 at 9:00AM Pacific time. Good luck out there!

Image

Turning Down The Noise On SMPS

On paper, electricity behaves in easy-to-understand, predictable ways. That’s mostly because the wires on the page have zero resistance and the switching times are actually zero, whereas in real life neither of these things are true. That’s what makes things like switch-mode power supplies (SMPS) difficult to build and troubleshoot. Switching inductors and capacitors tens or hundreds of thousands of times a second (or more) causes some these difficulties to arise when these devices are built in the real world. [FesZ Electronis] takes a deep dive into some of the reasons these difficulties come up in this video.

The first piece of electronics that can generate noise in an SMPS are the rectifier diodes. These have a certain amount of non-ideal capacitance as well as which causes a phenomenon called reverse current, but this can be managed by proper component choice to somewhat to limit noise.

The other major piece of silicon in power supplies like this that drives noise are the switching transistors. Since the noise is generally caused by the switching itself, there is a lot that can be done here to help limit it. One thing is to slow down the amount of time it takes to transition between states, limiting the transients that form as a result of making and breaking connections rapidly. The other, similar to selecting diodes, is to select transistors that have properties (specifically relating to inherent capacitances) that will limit noise generation in applications like this.

Of course there is a lot more information as well as charts and graphs in [FesZ]’s video. He’s become well-known for deep dives into practical electrical engineering topics like these for a while now. We especially like his videos about impedance matching as well as a more recent video where he models a photovoltaic solar panel in SPICE.

Continue reading “Turning Down The Noise On SMPS”

Image

Mechanical Logic Gates With Amplification

One of the hardest things about studying electricity, and by extension electronics, is that you generally can’t touch or see anything directly, and if you can you’re generally having a pretty bad day. For teaching something that’s almost always invisible, educators have come up with a number of analogies for helping students understand the inner workings of this mysterious phenomenon like the water analogy or mechanical analogs to electronic circuits. One of [Thomas]’s problems with most of these devices, though, is that they don’t have any amplification or “fan-out” capability like a real electronic circuit would. He’s solved that with a unique mechanical amplifier.

Digital logic circuits generally have input power and ground connections in addition to their logic connection points, so [Thomas]’s main breakthrough here is that the mechanical equivalent should as well. His uses a motor driving a shaft with a set of pulleys, each of which has a fixed string wrapped around the pulley. That string is attached to a second string which is controlled by an input. When the input is moved the string on the pulley moves as well but the pulley adds a considerable amount of power to to the output which can eventually be used to drive a much larger number of inputs. In electronics, the ability to drive a certain number of inputs from a single output is called “fan-out” and this device has an equivalent fan-out of around 10, meaning each output can drive ten inputs.

[Thomas] calls his invention capstan lever logic, presumably named after a type of winch used on sailing vessels. In this case, the capstan is the driven pulley system. The linked video shows him creating a number of equivalent circuits starting with an inverter and working his way up to a half adder and an RS flip-flop. While the amplifier pulley does take a minute to wrap one’s mind around, it really helps make the equivalent electronic circuit more intuitive. We’ve seen similar builds before as well which use pulleys to demonstrate electronic circuits, but in a slightly different manner than this build does.

Continue reading “Mechanical Logic Gates With Amplification”

Image

Lathe Outfitted With Electronic Gearbox

Running a metal lathe is not for the faint of heart. Without proper knowledge and preparation, these machines can quickly cause injury or destroy expensive stock, tools, or parts. The other major problem even for those with knowledge and preparedness is that some of their more niche capabilities, like cutting threads with a lead screw, can be tedious and complicated thanks to the change gear system found on some lathes. While these are useful tools for getting things done, [Not An Engineer] decided that there was a better way and got to work building an electronic gearbox to automate the task of the traditional mechanical change gear setup in this video.

What makes change gears so tricky is that they usually come as a set of many gears of different ratios, forcing the lathe operator to figure out the exact combination of gears needed to couple the spindle of the lathe to the feed screw at the precise ratio needed for cutting a specific thread pattern. It is possible to do this task but can be quite a headache. [Not An Engineer] first turned to an Arduino Nano to receive input from a rotary encoder connected to the shaft of the lathe and then instruct a motor to turn the feed screw at a set ratio.

The first major problem was that the Arduino was not nearly fast enough to catch every signal from the encoder, leading to a considerable amount of drift in the output of the motor. That was solved by upgrading to a Teensy 4.1 with a 600 MHz clock speed. There was still one other major hurdle to cross; the problem of controlling the motor smoothly when an odd ratio is selected. [Not An Engineer] used this algorithm to inspire some code, and with that and some custom hardware to attach everything to the lathe he has a working set of electronic change gears that never need to be changed again. And, if you don’t have a lathe at all but are looking to get started with one, you can always build your own from easily-sourced parts.

Continue reading “Lathe Outfitted With Electronic Gearbox”

Image

Automated System Keeps Camper Van Air Fresh And Warm

Air quality has become a hot topic in recent years. [Ryan Stout] was interested in improving it in his camper van, and set about doing something about it. His solution was an automated system that provided cleaner air and better comfort to boot.

The concept was simple. [Ryan]’s system is based on an Arduino clone, and uses a SparkFun SCD40 as a CO2 sensor, and an MCP9808 for temperature. When the system detects excess carbon dioxide levels, it opens the MaxxAir fan in the camper by triggering it with an infrared signal. Similarly, when it detects excessively low temperatures inside the van, it kicks on a diesel furnace for heating. In a neat addition, to avoid the fan sucking in exhaust fumes, it also closes the fan in order to avoid exhaust fumes entering the camper unnecessarily. All the hardware was then  wrapped up in a simple 3D printed enclosure.

With this setup, [Ryan] has managed to cut the buildup of CO2 in his camper at night, and he credits this with reducing morning headaches when he’s out in the camper. We’d call that a win, to say nothing of the additional comfort created by the automatically-controlled heater! If you’re interested in something similar for your home HVAC system, we’ve got you covered.