Posts with «arduino hacks» label

Reflowduino: Put That Toaster Oven To Good Use

There are few scenes in life more moving than the moment the solder paste melts as the component slides smoothly into place. We’re willing to bet the only reason you don’t have a reflow oven is the cost. Why wouldn’t you want one? Fortunately, the vastly cheaper DIY route has become a whole lot easier since the birth of the Reflowduino – an open source controller for reflow ovens.

This Hackaday Prize entry by [Timothy Woo] provides a super quick way to create your own reflow setup, using any cheap means of heating you have lying around. [Tim] uses a toaster oven he paid $21 for, but anything with a suitable thermal mass will do. The hardware of the Reflowduino is all open source and has been very well documented – both on the main hackaday.io page and over on the project’s GitHub.

The board itself is built around the ATMega32u4 and sports an integrated MAX31855 thermocouple interface (for the all-important PID control), LiPo battery charging, a buzzer for alerting you when input is needed, and Bluetooth. Why Bluetooth? An Android app has been developed for easy control of the Reflowduino, and will even graph the temperature profile.

When it comes to controlling the toaster oven/miscellaneous heat source, a “sidekick” board is available, with a solid state relay hooked up to a mains plug. This makes it a breeze to setup any mains appliance for Arduino control.

We actually covered the Reflowduino last year, but since then [Tim] has also created the Reflowduino32 – a backpack for the DOIT ESP32 dev board. There’s also an Indiegogo campaign now, and some new software as well.

If a toaster oven still doesn’t feel hacky enough for you, we’ve got reflowing with hair straighteners, and even car headlights.

Held Captive by Arduino and Multiple RFID Readers

If you’re the kind of person who has friends, and/or leaves the confines of the basement from time to time, we hear that these “Escape Rooms” are all the rage. Basically you get locked into a room with a couple other people and have to solve various problems and puzzles until you’ve finally made enough progress that they let you out. Which actually sounds a lot like the working conditions here at Hackaday HQ, except they occasionally slip some pizza rolls under the door for us which is nice.

Whichever side you find yourself on in one of these lighthearted hostage situations, knowledge of this multi-tag RFID lock created by [Annaane] may come in handy. By connecting multiple MFRC522 RFID readers to an Arduino Uno, she’s come up with a method of triggering a device (like an electronic door lock) only when the appropriate combination of RFID tags have been arranged. With a little imagination, this allows for some very complex puzzle scenarios which are sure to keep your prisoners enthralled until you can lower the lotion down to them.

Her code allows you to configure the type and number of RFID cards required to trigger one of the Arduino’s digital pins, which usually would be connected to a relay to fire off whatever device you want. The Arduino sketch is also setup to give “hints” to the player by way of a status LED: fast blinking let’s you know the tag scanned is wrong, and slow blinking means you don’t have enough scanned in yet.

The video after the break shows some highlights of the build, as well as a quick demonstration of how both the RFID “combination” and manual override can be used to trigger the attached relay.

Hackers do love RFID. Using them for physical access control is a fairly common project around these parts, and we’ve even seen similar setups for the digital realm.

A Two-Range OLED Capacitance Meter

If you are just starting out in electronics, you need tools. But it is hard to build all your tools. Even though we see a lot of soldering station builds, you really ought to have a soldering iron to build the station. It is hard to troubleshoot a multimeter you just built if you don’t have a multimeter. However, a capacitance meter is a handy piece of gear, relatively simple to build, and you should be able to get it working without an existing capacitance meter. [gavinlyonsrepo] presents a simple design using an Arduino, an OLED display, and a few components.

The principle of operation is classic. On one range, the Arduino charges the capacitor through one resistor and discharges it through another while timing the operation. The amount of time taken corresponds to the capacitance.

The other range doesn’t use external components but relies on the internal resistance of the Arduino and the stray capacitance in the chip and the board. Because these parameters vary, you’ll need to calibrate the device with a capacitor of known value.

This is one of those projects that would have been more complicated before microcontrollers. With an Arduino or similar device, though, it is pretty straightforward.

We looked at a project that explores the second method in depth quite some time ago. We’ve seen some similar meters in the past you might enjoy.

Push it to the Limit: SSD1306 at 150 FPS

A good deal of the projects we cover here at Hackaday are not, in the strictest sense, practical endeavors. If we required that everything which graced our digital pages had a clear end result, the site would be in a rather sad state of affairs. Sometimes it’s enough just to do something for the challenge of it. But more often than not, you’ll learn something in the process which you can use down the line.

That’s precisely what pushed [Laurence Bank] to see how well he could optimize the frame rate on the popular SSD1306 OLED display. After several iterations of his code, he was able to achieve a blistering 151.5 FPS, with apparently still some room for improvement if he’s feeling up to the challenge. But considering his first attempt was only running at 5.5 FPS, we’d say he’s already more than earned his hacker cred on this one.

A few different tricks were used to achieve such incredible performance gains. To start with, while the official I2C specification says you’re supposed to wait for an acknowledgment back from the device when communicating with it, [Laurence] realized the SSD1306 didn’t actually care. He could continuously blast commands at the display without bothering to wait for an acknowledgment. He admits there are problems with this method, but you can’t argue with the results.

To really wring all the performance out of the system he could, [Laurence] donned his Assembly Cap and examined how the Arduino IDE compiler was interpreting his code. He identified a few areas where changing his C code would force the compiler to generate faster output. He notes that this wouldn’t normally be required when working with more advanced compilers, but that the Arduino toolchain needs its hand held occasionally.

This isn’t the first time we’ve seen somebody try and push more pixels through the very same OLED display, and it’s interesting to see the two very different approaches to the same goal.

Stomping On Microcontrollers: Arduino Mega Guitar Effects Pedal

Effects pedals: for some an object of overwhelming addiction, but for many, an opportunity to hack. Anyone who plays guitar (or buys presents for someone who does) knows of the infinite choice of pedals available. There are so many pedals because nailing the tone you hear in your head is an addictive quest, an itch that must be scratched. Rising to meet this challenge are a generation of programmable pedals that can tweak effects in clever ways.

With this in mind, [ElectroSmash] are back at it with another open source offering: the pedalSHIELD MEGA. Aimed at musicians and hackers who want to learn more about audio, DSP and programming, this is an open-hardware/open-software shield for the Arduino MEGA which transforms it into an effects pedal.

The hardware consists of an analog input stage which amplifies and filters the incoming signal before passing it to the Arduino, as well as an output stage which does the DAC-ing from the Arduino’s PWM outputs, and some more filtering/amplifying. Two 8-bit PWM outputs are used simultaneously to make pseudo 16-bit resolution — a technique you can read more about in their handy forum guide.

The list of effects currently implemented covers all the basics you’d expect, and provides a good starting point for writing custom effects. Perhaps a library for some of the commonly used config/operations would be useful? Naturally, there are some computational constraints when using an Arduino for DSP, though it’s up to you whether this is a frustrating fact, or an opportunity to write some nicely optimised code.

[ElectroSmash] don’t just do pedals either: here’s their open source guitar amp.

Tiny Arduino + FPGA = Sno

Alorium rolled out a new product late last year that caught our attention. The Sno (pronounced like “snow”) board is a tiny footprint Arduino board that you can see in the video below. By itself that isn’t that interesting, but the Sno also has an Altera/Intel Max 10 FPGA onboard. If you aren’t an FPGA user, don’t tune out yet, though, because while you can customize the FPGA in several ways, you don’t have to.

Like Alorium’s XLR8 product, the FPGA comes with preprogrammed functions and a matching Arduino API to use them. In particular, there are modules to do analog to digital conversion, servo control, operate NeoPixels, and do floating point math.

However, you can reprogram the FPGA to have other functions — known as XBs or Xcelerator Blocks — if you like. The only problem we see is that, so far, there aren’t many of them. In addition to the stock XBs, there is one that will do quadrature decoding for dealing with things like shaft encoders. There are a few others you can find on their GitHub page. You can get an idea for the workflow by looking at this tutorial for the XLR8 board.

Of course, you can write your own FPGA configurations as you see fit, but they also provide a standard workflow — OpenXLR8 — that lets you build your own blocks that operate just like their blocks. It would be easy to imagine an “app store” concept where people develop custom blocks and make them available.

We really like the idea of this device and it is certainly inexpensive. You can prototype on the XLR8 which looks like a UNO or you can put headers in the Sno. They also sell a breakout board that will make the Sno physically more like an UNO. We are surprised, though, that there are not more XBs created over the last two years.

The FPGA onboard is similar to the one on the Arrow board we looked at earlier this year, although that has some additional components like SDRAM. If you are looking for a project, it might be interesting to convert our PWM code into an XB.

Thanks to [K5STV] for showing us one of these.

Hack a Day 30 Apr 16:30

Core Memory Upgrade for Arduino

Linux programs, when they misbehave, produce core dumps. The reason they have that name is that magnetic core memory was the primary storage for computers back in the old days and many of us still refer to a computer’s main memory as “core.” If you ever wanted to have a computer with real core memory you can get a board that plugs into an Arduino and provides it with a 32-bit core storage. Of course, the Arduino can’t directly run programs out of the memory and as designer [Jussi Kilpeläinen] mentions, it is “hilariously impractical.” The board has been around a little while, but a recent video shined a spotlight on this retro design.

Impractical or not, there’s something charming about having real magnetic core memory on a modern CPU. The core plane isn’t as dense as the old commercial offerings that could fit 32 kilobits (not bytes) into only a cubic foot. We’ll leave the math about how much your 8-gigabyte laptop would have to grow to use core memory to you.

Honestly, this is purely a novelty, but we do miss core memory somewhat. It was inherently nonvolatile. You could turn the computer off, turn it back on, and everything was just how you left it. Sure, it was peculiar that reading a bit also destroyed it, but many of the old computers had the write after read cycle built into the CPU architecture so that it wasn’t a big deal.

If you want to look at how it was to repair a big core system, we looked at that earlier. Surprisingly, though, this isn’t the first Arduino core memory rig we’ve seen.

Catch a Rising Star with Arduino

Space is big. Really big. Yet on TV and movies, enemy spacecraft routinely wind up meeting at roughly the same spot and, miraculously, in the same orientation. If you’ve ever tried to find something smaller than the moon in a telescope, you’ll appreciate that it isn’t that easy. There are plenty of tricks for locating objects ranging from expensive computerized scopes with motors to mounting a phone with Google Sky or a similar program to your telescope. [DentDentArthurDent] didn’t use a phone. He used an Arduino with an outboard GPS module.

You still have to move the scope yourself, but the GPS means you know your location and the time to a high degree of accuracy. Before you start an observing session, you simply point the telescope at Polaris to calibrate the algorithm, a process which in the northern hemisphere is pretty easy.

The telescope in question is a Dobson, so is easy to move and easy to sense its position using potentiometers and an A/D. The project also includes a detailed description of the math used to convert the time, latitude, longitude, right ascension, and declination into position data. One of four LEDs show if you should move up, down, left, or right. When you are on target, all four LEDs light. We assume you should use red LEDs and a red LCD filter so you don’t ruin your night vision.

There are a few sources of error and [Arthur] does a great job of analyzing and correcting each one. The project even has a nice 3D printed case. The database only contains 45 objects but it is easy to add more. We wondered if it wouldn’t have been better to use a larger computer such as a Raspberry Pi to get the stellar data — maybe even from the Internet — and rely on the Arduino to just manage the position sensing and direction indication, but then again, this works and it is very inexpensive.

This isn’t the first Arduino telescope finder we’ve seen. The last one even had a touchscreen.

Hack a Day 27 Apr 06:00

PID Control with Arduino

Experience — or at least education — often makes a big difference to having a successful project. For example, if you didn’t think about it much, you might think it is simple to control the temperature of something that is heating. Just turn on the heater if it is cold and turn it off when you hit the right temperature, right? That is one approach — sometimes known as bang-bang — but you’ll find there a lot of issues with that approach. Best practice is to use a PID or Proportional/Integral/Derivative control. [Electronoob] has a good tutorial about how to pull this off with an Arduino. You can also see a video, below.

The demo uses a 3D printer hot end, a thermocouple, a MAX6675 that reads the thermocouple, and an Arduino. There’s also an LCD display and a FET to control the heater.

The idea behind a PID controller is that you measure the difference between the current temperature and the desired temperature known as the setpoint. The proportional gain tells you how much output occurs due to that difference. So if the setpoint is way off, the proportional term will generate a lot of output to the heater. If it is close, only a little bit of output will result. This helps prevent overshoot where the temperature goes too high and has to come back down.

The integral term adds a little bit to the output based on the cumulative error over time. The derivative term reacts to changes in the temperature difference. For example, if something external causes the temperature to drop suddenly, the derivative term can goose the output to compensate.

However, the operative word is “can.” Part of setting up a PID is finding the coefficients for each term which for some systems could be zero or even negative (indicating a reverse effect).  There are a lot of other subtleties, too, like what happens if the output stops affecting the temperature for a long period and the integral amount grows to unmanageable magnitude.

By the way, we’ve covered a PID library for Arduino before. While this post talks about temperature, PID control is used for everything from flight control to levitation.

Hack a Day 14 Apr 09:00

Need a Thousand Extra PWM Pins?

If your Arduino runs out of I/O lines, you can always add one of the several I/O expander chips that takes a serial interface to set its several pins. Or perhaps you could buy something like an Arduino Mega, with its extra sockets to fulfil your needs. But what would you do if you really needed more pins, say a thousand of them? Perhaps [Brian Lough] has the answer. OK, full disclosure: If you really need a thousand, the video isn’t exactly for you, as he shows you how to add up to 992 PWM outputs. The chip he uses works with any microcontroller (the video shows an ESP8266), and we suppose you could use two daisy chains of them and break the 1,000 barrier handily.

We like how short the video is (just two minutes; see below) as it gets right to the point. The PCA9685 chip gives you 16 12-bit PWM channels via an I2C interface. You can daisy chain up to 62 of the boards to get the 992 outputs promised.

[Brian] uses a cheap $2 breakout board that lets you set a 6-bit address, has a nice power connector and makes it easy to use the little surface mount device. Each of the 16 outputs on the board can have an independent duty cycle, but they do share a single output frequency. That means if you want to use some channels for low-frequency devices like motors and some for high-frequency devices like LEDs, you might have to spring $4 for two boards.

Over on Hackaday.io, we’ve seen these devices driving 128 vibration motors. The PCA9685 made us think of the time we rolled our own serial to PWM devices using an FPGA.

Hack a Day 12 Apr 00:00