An Affordable And Programmable PLC

We’re all used to general purpose microcontroller boards such as the Arduino or its many imitators, but perhaps we don’t see as much of their industrial cousins. A programmable logic controller (PLC) is a computer designed to automate industrial machinery, and comes with protected interfaces and usually a specific PLC programming environment. Thus [Galopago]’s work with an inexpensive Chinese PLC clone is especially interesting, providing a route forward to using it within the Arduino IDE ecosystem.

Opening it up, the processor is identified as an STM32F103, and the connection needed to place it in bootloader mode is identified. Then it can be programmed from the Arduino IDE, even though its bootloader can’t be changed. Then to complete the process it’s necessary to identify the various different inputs and outputs by old-fashioned hardware reverse engineering.

This PLC may not be quite as robust as some products costing much more money, but it still represents a cost-effective way to access a microcontroller board with much of the interface circuitry already installed that would normally be required for controlling machinery. We expect that we’ll be seeing it appear on these pages over the coming months, and perhaps there might even be another comparison in the air.

A two picture montage of a boy wearing a sonic the hedgehog costume with LEDs in them. The left picture is at night with the boy wearing sunglasses and a face mask with the sonic costume head piece lit up. The right picture is during the day with the boy wearing a face mask, holding a plastic pu mpkin bucket for candy and wearing a lit up sonic the hedgehog costume in the front yard of a house.

LEDs Put New Spin On A Sonic The Hedgehog Costume

[Wentworthm] couldn’t say no to his son’s plea for a Sonic the Hedgehog costume for Halloween but also couldn’t resist sprucing it up with LEDs either. The end result is a surprisingly cool light up Sonic the Hedgehog costume.

a picture of a breadboard with an Arduino Nano on it, with wires going out to 3d printed tear dropped shapes that have LED strips in them, with some LED strips on.

After some experimentation, [Wentworthm] ordered two costumes and ended up mixing and matching the head piece of one with the body suit of the other. For the head, [Wentworthm] created six 3D printed “quills” that had slots for the WS2812B LED strips to slide into and diffuse out the sides, with each quill sliding into the folds of the Sonic head “spikes”. Sewn strips of cloth were used to house the LED strips that were placed down the sides of the costume. An additional 3D printed switch housing was created to allow for a more robust interface to the two push buttons to activate the LEDs. An Arduino Nano, soldered to a protoboard, was used to drive the LED strips with a USB battery pack powering the whole project.

[Wentworthm] goes into more detail about the trials and errors, so the post is definitely worth checking out for more detail on the build. Halloween is always a great source of cool costumes and we’ve featured some great ones before, like a light up crosswalk costume to making a giant Gameboy colour costume.

Video after the break!

Continue reading “LEDs Put New Spin On A Sonic The Hedgehog Costume”

Weasley Clock For Magically Low Cost

For those unfamiliar with the details of the expansive work of fiction of Harry Potter, it did introduce a few ideas that have really stuck in the collective conscious. Besides containing one of the few instances of time travel done properly and introducing a fairly comprehensive magical physics system, the one thing specifically that seems to have had the most impact around here is the Weasley family clock, which shows the location of several of the characters. We’ve seen these built before in non-magical ways, but this latest build seeks to drop the price tag on one substantially.

To do this, the build relies on several low-cost cloud computing solutions and smartphone apps to solve the location-finding problem. The app is called OwnTracks and is an open-source location tracker which can report data to any of a number of services. [Simon] sends the MQTT data to a cloud-based solution called HiveMQCloud, but you could send it anywhere in principle. With the location tracking handled, he turns to some very low-cost Arduinos to control the stepper motors which point the clock hands to the correct locations on the face.

While the build does rely on a 3D printer for some of the internal workings of the clock, this does bring the cost down substantially when compared to other options. Especially when compared to this Weasley family clock which was built into a much larger piece of timekeeping equipment, having an option for a lower-cost location-tracking clock face like this one is certainly welcome.

The Fastest Fourier Transform In The West

An interesting aspect of time-varying waveforms is that by using a trick called a Fourier Transform (FT), they can be represented as the sum of their underlying frequencies. This mathematical insight is extremely helpful when processing signals digitally, and allows a simpler way to implement frequency-dependent filtration in a digital system. [klafyvel] needed this capability for a project, so started researching the best method that would fit into an Arduino Uno. In an effort to understand exactly what was going on they have significantly improved on the code size, execution time and accuracy of the previous crown-wearer.

A complete real-time Fourier Transform is a resource-heavy operation that needs more than an Arduino Uno can offer, so faster approximations have been developed over the years that exchange absolute precision for speed and size. These are known as Fast Fourier Transforms (FFTs). [klafyvel] set upon diving deep into the mathematics involved, as well as some low-level programming techniques to figure out if the trade-offs offered in the existing solutions had been optimized. The results are impressive.

Fastest FFT code benchmarking results in ms
Benchmarking results showing speed of implementation versus the competition (ApproxFFT)

Not content with producing one new award-winning algorithm, what is documented on the blog is a masterclass in really understanding a problem and there are no less than four algorithms to choose from depending on how you rank the importance of execution speed, accuracy, code size or array size.

Along the way, we are treated to some great diversions into how to approximate floats by their exponents (French text), how to control, program and gather data from an Arduino using Julia, how to massively improve the speed of the code by using trigonometric identities and how to deal with overflows when the variables get too large. There is a lot to digest in here, but the explanations are very clear and peppered with code snippets to make it easier and if you have the time to read through, you’re sure to learn a lot!  The code is on GitHub here.

If you’re interested in FFTs, we’ve seen them before around these parts. Fill your boots with this link of tagged projects.

IR Remote tester in use, showing a remote control lighting up an LED and screenshots of the Arduino serial terminal

IR Remote Tester Helps You Crack The Code

Even though some devices now use WiFi and Bluetooth, so much of our home entertainment equipment still relies on its own proprietary infrared remote control. By and large (when you can find them) they work fine, but what happens when they stop working?  First port of call is to change the batteries, of course, but once you’ve tried that what do you do next? [Hulk] has your back with this simple but effective IR Remote Tester / Decoder.

IR remote tester schematic showing arduino, receiver, LED and resistor
How to connect the TSOP4838 to an Arduino to read the transmitted codes

By using a cheap integrated IR receiver/decoder device (the venerable TSOP4838), most of the hard work is done for you! For a quick visual check that your remote is sending codes, it can easily drive a visible LED with just a resistor for a current-limit, and a capacitor to make the flickering easier to see.

For an encore, [Hulk] shows how to connect this up to an Arduino and how to use the “IRremote” library to see the actual data being transmitted when the buttons are pressed.

It’s not much of a leap to imagine what else you might be able to do with this information once you’ve received it – controlling your own projects, cloning the IR remote codes, automating remote control sequences etc..

It’s a great way to make the invisible visible and add some helpful debug information into the mix.

We recently covered a more complex IR cloner, and if you need  to put together a truly universal remote control, then this project may be just what you need.

Continue reading “IR Remote Tester Helps You Crack The Code”

"The Great Resistor" color code illumination project

The Great Resistor Embiggens The Smallest Value

With surface-mount components quickly becoming the norm, even for homebrew hardware, the resistor color-code can sometimes feel a bit old-hat. However, anybody who has ever tried to identify a random through-hole resistor from a pile of assorted values will know that it’s still a handy skill to have up your sleeve. With this in mind, [j] decided to super-size the color-code with “The Great Resistor”.

Resistor color code from Wikipedia with white background
How the resistor color-code bands work

At the heart of the project is an Arduino Nano clone and a potential divider that measures the resistance of the test resistor against a known fixed value. Using the 16-bit ADC, the range of measurable values is theoretically 0 Ω to 15 MΩ, but there are some remaining issues with electrical noise that currently limit the practical range to between 100 Ω and 2 MΩ.

[j] is measuring the supply voltage to help counteract the noise, but intends to move to an oversampling/averaging method to improve the results in the next iteration.

The measured value is shown on the OLED display at the front, and in resistor color-code on an enormous symbolic resistor lit by WS2812 RGB LEDs behind.

Inside view of the great resistor showing WS2812 LEDs and baffle plates
Inside The Great Resistor, the LEDs and baffle plates make the magic work

Precision aside, the project looks very impressive and we like the way the giant resistor has been constructed. It would look great at a science show or a demonstration. We’re sure that the noise issues can be ironed out, and we’d encourage any readers with experience in this area to offer [j] some tips in the comments below. There’s a video after the break of The Great Resistor being put through its paces!

If you want to know more about the history of the resistor color code bands, then we have you covered.  Alternatively, how about reading the color code directly with computer vision?

Continue reading “The Great Resistor Embiggens The Smallest Value”

Walnut Case Sets This Custom Arduino-Powered RPN Calculator Apart From The Crowd

How many of us have an everyday tool that’s truly unique? Likely not many of us; take a look around your desk and turn out your pockets, but more often than not, what you’ll find is that everything you have is something that pretty much everyone else on the planet could have bought too. But not so if you’ve got this beautiful custom RPN calculator in a wooden case.

This one comes to us from [Shinsaku Hiura], who generally dazzles us with unique mechanical clocks and displays. This calculator solves a more practical problem — the dearth of RPN calculators on the market with the correct keyboard feel, specifically with the large keys and light touch he desired. Appropriately, the build started with a numeric keypad, which once liberated of its USB interface was reverse-engineered to figure out how the matrix was wired. Next up, a custom PCB to connect the keypad to an Arduino and a 20×4 LCD display was milled up, while a test case was designed and printed to check fitment. The final case was milled from a block of solid walnut and fitted with an acrylic window, for a sharp look with clean lines and pleasing colors.

As for the calculator itself, the demo below shows it going through its paces. The code is clever because it leverages the minimal number of keys available by hiding all the scientific and engineering functions behind a “secret silver key” that was once the equals key and obviously not needed in RPN. Hats off to [Shinsaku] for a handsome and unique addition to his desk.

Continue reading “Walnut Case Sets This Custom Arduino-Powered RPN Calculator Apart From The Crowd”