Bolt-On Clog Detection For Your 3D Printer

Desktop 3D printing technology has improved by leaps and bounds over the last few years, but they can still be finicky beasts. Part of this is because the consumer-level machines generally don’t offer much in the way of instrumentation. If the filament runs out or the hotend clogs up and stops extruding, the vast majority of printers will keep humming along with nothing to show for it.

Looking to prevent the heartache of a half-finished print, [Elite Worm] has been working on a very clever filament detector that can be retrofitted to your 3D printer with a minimum of fuss. The design, at least in its current form, doesn’t actually interface with the printer beyond latching onto the part cooling fan as a convenient source of DC power. Filament simply passes through it on the way to the extruder, and should it stop moving while the fan is still running (indicating that the machine should be printing), it will sound the alarm.

Inside the handy device is a Digispark ATtiny85 microcontroller, a 128 x 32  I2C OLED display, a buzzer, an LED, and a photoresistor. An ingenious 3D printed mechanism grabs the filament on its way through to the extruder, and uses this movement to alternately block and unblock the path between the LED and photoresistor. If the microcontroller doesn’t see the telltale pulse after a few minutes, it knows that something has gone wrong.

In the video after the break, [Elite Worm] fits the device to his Prusa i3 MK2, but it should work on essentially any 3D printer if you can find a convenient place to mount it. Keep a close eye out during the video for our favorite part of the whole build, using the neck of a latex party balloon to add a little traction to the wheels of the filament sensor. Brilliant.

Incidentally, Prusa tried to tackle jam detection optically on the i3 MK3 but ended up deleting the feature on the subsequent MK3S since the system proved unreliable with some filaments. The official line is that jams are so infrequent with high-quality filament that the printer doesn’t need it, but it does seem like an odd omission when even the cheapest paper printer on the market still beeps at you when things have run afoul.

Continue reading “Bolt-On Clog Detection For Your 3D Printer”

Light Emitting Logic Gates Built From Scratch

What’s the weirdest computer you can think of? This one’s weirder.

[Dr. Cockroach] figured out a way to create an inverting NOT gate from just one LED and two resistors (one being a photo-resistor). The Dr. has since built AND, NAND, OR, NOR, XOR and XNOR gates, as well as a buffer, incorporating light into every logic gate.

Traditional inverters – NOT gates – are already made with diodes (typically not light-emitting), resistors (typically not light-dependent), and bipolar transistors. The challenge was to reduce the number of transistors. The schematic from the very first test shows the slight modifications [Dr. Cockroach] made to incorporate light into the logic gate using a 910 Ohm, output LED, and an LED and LDR in parallel.

The output is initially 4.5V for logic 1 and 1.5V for logic 0. Adding two 1N914 diodes and an AND gate ahead of the inverter create a two-input NAND gate. With the two diodes reversed and a 910 Ohm resistor removed, a NOR gate is created.

The next step was to build a S-R latch using the NAND gates and inverters, which holds some basic memory. From there, with some size reductions, a Master-Slave J-K Flip Flop, similarly using NAND gates and inverters, can be built. The current state of the project is a working sequencer and counter. You can even see a smooth sine wave propagating through the LED chaser, which is typically built with ICs or transistors but in this case is built simply with LEDs, LDRs, resistors, and capacitors.

The upcoming plan is to use the gates to build a processor that only uses diodes, resistors, and capacitors. While it’s probably not going to be nearly as fast as any processors we have today, it should be interesting (and educational!) to be able to visually track the flow of data from one logic gate over to the next. Continue reading “Light Emitting Logic Gates Built From Scratch”

DIY Vactrols Give MIDI-Controlled Video Distortion

It’s one thing to assemble your own circuits from scratch using off the shelf components. It’s quite another to build the components first, and then build the circuit.

That’s the path [Joris Wegner] took with this video distortion effects box, dubbed PHOSPHOR. One might wonder why you’d want a box that makes a video stream look like playback from a 1980s VHS player with tracking problems, but then again, audio distortion for artistic effect is a thing, so why not video? PHOSPHOR is a USB MIDI device, and therein lies the need for custom components. [Joris] had a tough time finding resistive optoisolators, commonly known as Vactrols and which are used to control the distortion effects. He needed something with a wide dynamic range, so he paired up a bright white LED and a cadmium sulfide photoresistor inside a piece of heat shrink tubing. A total of 20 Vactrols were fabricated and installed on a PCB with one of the coolest silkscreens we’ve ever seen, along with the Sparkfun Pro Micro that takes care of MIDI chores. Now, distortions of the video can be saved as presets and played back in sync with music for artistic effects.

This isn’t the first time Vactrols have made an appearance here, of course. We saw them a while back with this Arduinofied electric guitar, and more recently with a triple-555 timer synth.

Continue reading “DIY Vactrols Give MIDI-Controlled Video Distortion”

Monitoring Power By Counting Blinks

What do you do when you want to add a new feature to some electronics but you can’t or don’t want to tear into the guts? You look for something external with which you can interface. We like these hacks because they take some thinking outside the box, literally and figuratively, and often involve an Aha! moment.

[Simon Aubury’s] big household load was electric heating and his ancient heaters didn’t provide any way to monitor their usage. His power meters weren’t smart meters and he didn’t want to open them up. But the power meters did have an external LED which blinked each time 1 Wh was consumed. Aha! He could monitor the blinks.

Home power usage graph
Maximum is white, average is orange, and minimum is blue.

Doing so was simple enough. Just point photoresistors at the two meter’s LEDs and connect them and capacitors to a Raspberry Pi’s GPIO pins. Every time a pulse is detected, his Python code increments the LED’s counter and every fifteen minutes he writes the counters to an SQL database. Analysing his data he saw that nothing much happens before 5 AM and that the lowest daytime usage is around noon. The maximum recorded value was due to a heater accidentally being left on and the minimum is due to a mini holiday. Pretty good info given that all he had to go on was a blinking light.

Where else are there LED indicators which you can tap into? Here’s an only slightly more invasive usage where a washing machine’s “end of cycle” LED  was removed and the power going to it was rerouted to an Arduino for remote monitoring.

ESP8266 Uses LiFi To Get On WiFi

Connecting your shiny new ESP8266 to WiFi can be as simple or as complicated as you please. Most people decide to manually add it. Some people find clever ways to make the bloody thing connect itself. [Eduardo Zola] transfers his WiFi password using the flashing light of a smartphone screen.

A simple photo-resistor and a bit of tinkering allows him to easily send credentials — or any data really — to his ESP8266, through the power of LiFi. Short for Light Fidelity, LiFi transmits data using light with on and off states representing digital values. It can use visible light, or reach into either the ultraviolet or infra-red radiation if need be. For the nitty-gritty details on the subject, check out our primer on LiFi.

 A flashing LCD screen and a photo-resistor barely make the cut for a one-way LiFi system, but [Eduardo Zola] makes it work. The approach is to build a resitor divider and watch an input pin on the ESP for changes.

The trick is to keep ambient light out of the mix. The test sensor shown here places the LDR in a black cap, but [Eduardo] 3D-Printed a slick little enclosure for his reverse flashlight so it fits flush with the phone screen. One click and about half a minute of a flashing screen later, and the Wi-Fi credentials are transferred. This circuit could really be added onto any project, for short data transfers. With a bit more work on the sensor circuit, speed could be improved with the limiting factor being the timing on the phone screen itself.

Since the ESP8266 has its own WiFi connection, it’s likely you’ll use that for data transfer once the LiFi gets it onto the network. But any situation where you don’t have a full user input or a network connection could benefit from this. Pull out that old scrolling LED matrix project and add this as a way to push new messages to the device!
Continue reading “ESP8266 Uses LiFi To Get On WiFi”

Color Sensor From An RGB LED And A Photocell

When you need to quantify the color of an object, you’ve got quite a few options. You can throw a Raspberry Pi camera and OpenCV at the problem and approach it through software, or you can buy an off-the-shelf RGB sensor and wire it up to an Arduino. Or you can go back to basics and build this reflective RGB sensor from an LED and a photocell.

The principle behind [TechMartian]’s approach is simplicity itself: shine different colored lights on an object and measure how much light it reflects. If you know the red, green, and blue components of the light that correspond to maximum reflectance, then you know the color of the object. Their sensor uses a four-lead RGB LED, but we suppose a Neopixel could be used as well. The photosensor is a simple cadmium sulfide cell, which measures the intensity of light bouncing back from an object as an Arduino drives the LED through all possible colors with PWM signals. The sensor needs to be white balanced before use but seems to give sensible results in the video below. One imagines that a microcontroller-free design would be possible too, with 555s sweeping the PWN signals and op-amps taking care of detection.

And what’s the natural endpoint for a good RGB sensor? A candy sorter, or course, of which we have many examples, from the sleek and polished to the slightly more hackish.

Continue reading “Color Sensor From An RGB LED And A Photocell”

Fail Of The Week: Museum Buttons

Museum exhibits are difficult to make, and they’re always breaking down; especially the interactive ones. This is a combination of budget, building a one-off, and the incredibly harsh abuse they take from children.

My first exhibit is an interactive laser show that turns waveforms from music into laser patterns, and different types of music have very different patterns. I knew from talking to the museum staff that industrial buttons were a necessity, but it turns out that industrial buttons are made under the assumption that tiny creatures won’t be constantly mashing, twisting, and (ew ew ew) licking the buttons. After a while, the buttons (and poor knob) were trashed.

The second exhibit is also interactive, but in this case it’s just a simple button that turns on a thing for a while, then shuts it off. You can read more about the Periodic Table of Motion on the project page. Here I thought; let’s use capacitive touch, put the sensor behind two layers of acrylic for protection, and then there won’t be any moving parts to break. I built a bunch of units, tested it for weeks, then installed it. Instant failure despite my diligence.

Something is different about the installation from my test environment. It might be the second layer of acrylic contributing. Maybe it’s the power supply and a strange ground issue. Maybe the room’s fluorescent lights are creating an electromagnetic field that is interrupting the sensor, or the carpet is causing static buildup that is somehow causing the midichlorians to reverse polarity and discharge through the base plate of prefabulated aluminite. In some of the cells, the button doesn’t work. In other cells it is extremely sensitive. In one column of the table (columns share a common piece of acrylic among 5 cells), a single touch will trigger all 5.

The circuit is an ATtiny with a 2.2M resistor between two pins, one of which connects via a short wire to a soldered connection to a piece of copper tape on the underside of an acrylic piece. The ATtiny is using the capsense library, which has features for automatic recalibration. Because of the way it is installed, I can’t reprogram them to adjust their sensitivity while inside the enclosure, so tweaking them post-install is not an option. I thought I could isolate the problem and use an existing capacitive touch sensor breakout of the AT42QT1010 hooked up to just power, but it had the exact same issue, meaning it’s either the power supply, the enclosure, or the room.

Side-by-side tests of copper tape+Arduino and AT42QT1010 had similar problems.

There are three paths I can go down now:

  1. Find the problem and solve it
  2. Switch to a photoresistor
  3. Petition Hackaday for a better solution

Finding the problem and solving it will be a long and difficult path, especially since the museum environment is somehow and inexplicably different from the test environment. The photoresistor option has promise; when the user puts their hand over the paper button the light level changes. Some early testing indicates that it is easy to detect instantaneous change, and a trailing average and adjusting threshold make it robust enough for changing lighting conditions throughout the day. Further, it’s a simple change to the code, and the existing circuit board will accommodate the adjustment.

As for the third option…

What have you done for child-compatible touch interfaces that are robust enough to handle uncertain environments and harsh abuse? What buttons, knobs, and other interactive elements have you used?