Pulse Density Modulation

[esot.eric] was trying to drive a motor and naturally thought of using pulse width modulation (PWM) to control the motor speed. However, he found that even with a large capacitor, his underpowered power supply would droop before the PWM cycles were complete. So instead of PWM he decided to experiment with pulse density modulation.

The idea is to use smaller pulses over a longer period of time and make the average power equal to the percentage motor speed desired. With a PWM system, for example, if the time period is T, a 50% PWM drive would have the  drive high for T/2 and low for the other half of the cycle. With pulse density, each pulse might be T/10 (as an example) and then the output would be on for 1/10, off for 1/10, on for 1/10 and so on, until by time T you’d still get to 50%. The advantage is the output capacitor gets a kick more often and has less opportunity to droop.

Continue reading “Pulse Density Modulation”

Redlining Your CPU Via Automotive Tachometer

Many CPU-usage widgets have stylistically borrowed from vehicles, displaying something mimicking the tachometer found in the dashboard. [Pat] took it a step further and tried his hand at re-borrowing this style. He figured, why not use an actual physical tachometer to display how hard the CPU on his Raspberry Pi was revving?

With the goal of tuning 0-100% CPU usage to 0-8000 RPM on the tach, the first step was diagnosing the range of PWM input frequencies that moved the needle across the tach’s full arc. Using his Tektronix 3252C function generator he quickly determined 0-440 Hz would be needed and graphed a handful of intermediate points. The response curve was not linear, so he drew up some fudging guidelines to make all the datapoints match.

Next, he wrote a few lines of Python (he shared) to make the Pi to poll its CPU usage and translate it to the proper frequency. The Pi makes outputting easy, GPIO pin 11 carried the signal to a 7404 for buffering, then out to the tach. The automotive tach itself ran on 12V, but its input signal required only 5V so he pulled a 7805 from his parts bin.

Once it was all put together it worked beautifully using just the one extra component. Some might see this as more clever than USB dependent or Arduino bloated based tachometer hacks.

See the video after the break of the tach twitching even when the mouse moved, and pegging the red when opening a browser. No more need to use up valuable screen real-estate (or use a screen at all) if you want to see at a glance when your Pi is putting in work.

Continue reading “Redlining Your CPU Via Automotive Tachometer”

Easy And Effective Way To Measure PWM… Without A Scope!

Sometimes when a project is coming together, you need to cobble a tool together to get it completed. Whether it’s something very involved, like building a 3D printer to fabricate custom parts, or something relatively simple, like wiring a lightbulb and a battery together to create a simple continuity checker, we’ve all had to come up with something on the fly. Despite having access to an oscilloscope, [Brian] aka [schoolie] has come up with his own method for measuring PWM period and duty cycle without a scope, just in case there’s ever a PWM emergency!

The system he has come up with is so simple it’s borderline genius. The PWM signal in question is fed through a piezo speaker in parallel with a resistor. The output from the speaker is then sent to an FFT (fast fourier transform) app for Android devices, which produces a picture of a waveform. [schoolie] then opens the picture in MS Paint and uses the coordinates of the cursor and a little arithmetic to compute the period and the duty cycle.

For not using a scope, this method is pretty accurate, and only uses two discrete circuit components (the resistor and the speaker). If you’re ever in a pinch with PWM, this is sure to help, and be a whole lot cheaper than finding an oscilloscope!

Intel Edison on a box

Running Golang On The Intel Edison

While most embedded development is still done in C and/or assembly, some people are working with more modern languages. The team over at Gobot has successfully managed to get Go running on the Intel Edison.

The Go programming language, which has been around for about five years, compiles to machine code like C. It has a number of modern features including concurrency, garbage collection, and packages.

We’ve looked at the Edison on Hackaday before, and even took a detailed look at the hardware. It features a Quark SoC, Bluetooth, and WiFi, which makes it well suited for connected devices.

Getting Go to work on the Edison hardware wasn’t particularly difficult, since it supports the Pentium instruction set and MMX. However, a library was needed to interface with the Edison’s peripherals. The Gobot team whipped up gobot-intel-iot, which makes it easy to work with GPIO, I2C, and PWM.

After the break, the team demos PWM on the Edison using Go.
Continue reading “Running Golang On The Intel Edison”

Aquarium with variable LEDs

18-Channel PWM Aquarium Lights Provide Habitat-Like Life For Fish

Whether you want to keep your fish happy or just need a good light show, this aquarium light fits the bill. It is the second iteration, but [William] calls it v1. That’s because v0 — which used a few loops of LED strips — never really met his requirements.

This build uses just six LEDs, each a 30 Watt RGB monster! To source about 350 mA for each, and to control brightness with 18-channels of pulse width modulation, he had to plan very carefully. This meant a proper aluminum project box and a beefy, fan-cooled power supply.

The driver board is his own design, and he etched a huge board to hold all of the components. Everything is driven by an Arduino Mega, which has 16 hardware PWM channels; two short of what he needed. Because of this he had to spend a bit of time figuring out how best to bit-bang the signals. But he’s putting them to good use, with fish-pleasing modes like “sunset” or the “passing rainbow” pattern which is shown in the image above.

If you need something a little less traditional why not house your fish in a computer case, complete with LED marquee for displaying data.

Monster 100W LED Flashlight Produces A Whopping 8500lm!

100W LED Flashlight

[Yannick] got a hold of a 100W LED diode recently, and like any self-respecting hacker, he just had to turn it into a ridiculously over powered flash light.

The tricky thing about these diodes is that they need a high amount of DC voltage, anywhere from 32-48V typically. [Yannick’s] using a 12V sealed lead acid battery coupled with a 600W constant current boost converter which ups it to 32V at around 3.2A. He also managed to find a giant aluminum heat-sink to keep the diode from getting too hot. A 120mm fan helps to keep the heat sink nice and cool, which allows the light to be run constantly without fear of burning it out. But just in case he also has an Arduino monitoring the temperatures — oh and it provides PWM control to adjust the brightness of the light!

To focus the flashlight he bought a proper lens and reflector which can be mounted directly to the diode. At full power the LED puts out around 8500lm, which is brighter than almost all consumer projectors available — or even the high beams of a car!

Continue reading “Monster 100W LED Flashlight Produces A Whopping 8500lm!”