Posts with «arduino» label

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

Development Boards Galore at Maker Faire Bay Area

If you come to Maker Faire Bay Area 2018, you'll get the chance to learn about and see plenty of different development boards in action.

Read more on MAKE

The post Development Boards Galore at Maker Faire Bay Area appeared first on Make: DIY Projects and Ideas for Makers.

A Hacker’s Epic Quest to Keep His Son Entertained

Little humans have a knack for throwing a wrench in the priorities of their parents. As anyone who’s ever had children will tell you, there’s nothing you wouldn’t do for them. If you ever needed evidence to this effect, just take a gander at the nearly year-long saga that chronicles the construction of an activity board [Michael Teeuw] built for his son, Enzo.

Whether you start at the beginning or skip to the end to see the final product, the documentation [Michael] has done for this project is really something to behold. From the early days of the project where he was still deciding on the overall look and feel, to the final programming of the Raspberry Pi powered user interface, every step of the process has been meticulously detailed and photographed.

The construction methods utilized in this project run the gamut from basic woodworking tools for the outside wooden frame, to a laser cutter to create the graphical overlay on the device’s clear acrylic face. [Michael] even went as far as having a custom PCB made to connect up all the LEDs, switches, and buttons to the Arduino Nano by way of an MCP23017 I2C I/O expander.

Even if you aren’t looking to build an elaborate child’s toy that would make some adults jealous, there’s a wealth of first-hand information about turning an idea into a final physical device. It isn’t always easy, and things don’t necessarily go as planned, but as [Michael] clearly demonstrates: the final product is absolutely worth putting the effort in.

Seeing how many hackers are building mock spacecraft control panels for their children, we can’t help but wonder if any of them will adopt us.

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

MP3 player “reads” CDs like a vintage Victrola

Digital music—which gives us access to a virtually unlimited amount of media at our fingertips—is an amazing innovation. On the other hand, if you get nostalgic for something a bit more tangible, this “Victrola for the 21st century” may just fill that gap.

The device, by maker “castvee8,” plays digital music with the help of an Arduino Uno. Instead of simply emitting the tunes, however, the speaker is augmented with 3D-printed parts to make a horn assembly, and pushed over a CD spinning on a turntable using a worm drive. This creates the illusion that it’s playing digital music in a strange mashup of ‘90s tech and vintage vinyl record players.

My goal was make a music player with a mechanism that simulated a phonograph design but actually was just for aesthetics, and use modern digital media for the actual music. The combination of nostalgia with the modern components like an LCD screen, microcontroller and SD song storage would round this out as a unique build.

The main features of the build are a large cone type speaker supported on a moving axis that scans it across the cd simulating a tonearm pickup, an LCD module that gives instructions such as “press to play” and “select song” with pushbuttons that match, an LED analog level indicator and volume control, a rotating table to turn the cd as if it were being played, and of course the electronics to make it all work. At the end of the song the axis returns home so everything is reset for the next song to be played.

Check it out in the short clip below!

A 3D-printed personal weather station

If you need to know the forecast, generally you can look outside, listen to a weather report, or take advantage of the wide range of online services available. For something local to your dwelling place, however, this 3D-printed weather measurement device gives a great way to see what’s going on.

The system features a 3D-printed rain gauge, anemometer, and weather vane, along with a barometer and temperature sensor. Information from these sensors is piped to an Arduino Uno and displayed on a 4×20 character LCD.

While meant as a demonstration for an arts/science exhibition and would need to be calibrated for real world use, it is a perfect starting point if you’d like to build your own personal station!

The thrust bearings should be a tight fit and not require glue. The 5mm brass tube for the axles though will benefit from some cyanoacrylate on the ABS to hold them in place. Rough the tube up a bit with sandpaper or a file to help adhesion. The temperature and barometric pressure does not need calibrating. However rainfall (it is fairly close) and wind speed will need calibration. As long as the magnet in the wind direction sensor is close enough to trigger two adjacent reed switches when half way between the two reeds, it will allow 8 reed switches to reliably indicate 16 directions.

The reed switches in the direction indicator are vertical and are not trimmed, just the top end curled over to allow easy soldering to the common earth wire ring. Extra spacing maybe required, eg a small ring of heat shrink tubing to keep the moving parts of the anemometer and wind speed separated and seated on the bearings in the stationary base. This was too fine to print.

All the magnets N-S poles should be aligned along the line of the reed switch. The magnet lines of force between N-S have the best switching effect, not one of the poles, N or S, on its own. This also helps eliminate bounce, or multiple triggering.

More details on the project can be found on Thingiverse.

Give new life to an old electron microscope with Arduino

As seen here, although you might consider your oscilloscope and other test equipment to be pretty neat, you most likely don’t have anything nearly as cool as the scanning electron microscope that was dragged out of a shed at Benjamin Blundell’s local hackerspace.

The small detail is that it doesn’t currently work. They’ve been able to track down the machine’s schematics, and Blundell was asked to get the contents off each of its ROM chips. Whereas this might have been difficult 20 years ago, he was able to hook chips up to an Arduino Mega and extract the contents of each one using code provided via his write-up.

Some of you might have watched the TV series, Halt and Catch Fire? If not, don’t worry, I won’t spoil it much. Basically, a couple of the lead characters decide to read the bios out of the latest IBM machine. It’s quite a dramatic moment, but the reality is perhaps somewhat more sober. Anyway, the process they had was quite involved, as it was the eighties after-all. Nowadays, we have things like the Arduino Mega that has enough digital input pins to read a ROM with ease.

While he still needs to figure out what’s going on with this information, they have a place to start and will hopefully have a very exotic tool running in the near(ish) future!

Build a light painting device with Arduino and LEDs

Graffiti with spray paint is generally impolite and illegal, but as hacker “Reven” shows in his write-up, you can get a very similar effect with long exposure photography and carefully-timed LEDs.

Instead of blindly moving a light point about to make this effect, he built his own handheld light painter using an Arduino Uno and a custom enclosure—shared on Thingiverse—to hold everything.

The project’s Arduino sketch can be found here, and adds a 16×2 LCD display to a light painting device conceived of by Phil Burgess for Adafruit, which enables to control the brightness of the LED strip as well as select and load various images from a micro SD card.

This has been done before, many, many times; and even commercially. But I wanted to build my own, both to learn in the process and because commercial options were out of my budget. I chose adafruit’s implementation as a starting point, because it worked on the hardware I already had and they have provided detailed instructions. I also wanted some additional features: I wanted to add a display and a menu system to be able to choose the image to display and adjust the settings (like brightness or speed). I also wanted to be able to turn off the brightness balancing that adafruit’s sketch did, because frame or animation painting wasn’t something I really needed. And most importantly, I adjusted the project to the materials I had at hand.

With this fantastic build in hand, Reven can now produce beautiful light graffiti wherever it’s needed!

Art Deco Radio Gets FM Reception

Taking a vintage radio and cramming it full of modern, Internet-connected, guts has long been a staple of the hacking and making scene. While some might see it as a crime to take what’s arguably a legitimate piece of history and turn it into nothing more than a slipshod case for the Raspberry Pi, we have to admit there’s a certain appeal to the idea. Taking the beauty of classic design and pairing it with more modern capabilities is getting the best of both worlds.

But this project by [Nick Koumaris] is a somewhat unique take on the concept. Rather than sacrificing a real vintage piece of hardware to house the electronics, he’s designed a 3D printable case that looks like a classic 1936 AWA Radiolette. But what’s really interesting to us is that he then puts a basic FM radio inside of it.

That’s right, no Internet radio streaming or smartphone Bluetooth compatibility here. It’s just a regular FM radio, not entirely unlike the kind of hardware you’d expect to be inside of a classic radio. Of course, it’s much more modern, and [Nick] actually built it himself from a TEA5767 FM radio module and an Arduino Pro Mini.

While functionally it might not be terribly exciting, we do appreciate that he went through the trouble to make a vintage-looking user interface for the radio. While physical buttons would arguably have been more appropriate given the era, the art deco inspired font and graphics that show on the device’s Nokia 5110 LCD do look really slick.

Purists will surely be happy to see another project where a piece of vintage piece of audio equipment wasn’t sacrificed at the Altar of Hack, but we’ve also played host to many projects which weren’t nearly as concerned with historical preservation.

Reviving an Electron Microscope with Arduino

We don’t know about you, but when our friends ask us if we want to help them fix something, they’re usually talking about their computer, phone, or car. So far it’s never been about helping them rebuild an old electron microscope. But that’s exactly the request [Benjamin Blundell] got when a friend from a local hackerspace asked if he could take a look at a vintage Cambridge Stereoscan 200 they had found abandoned in a shed. Clearly we’re hanging out with the wrong group of people.

As you might imagine, the microscope was in desperate need of some love after spending time in considerably less than ideal conditions. While some of the hackerspace members started tackling the hardware side of the machine, [Benjamin] was tasked with finding a way to recover the contents of the scope’s ROM. While he’s still working on verification, the dumps he’s made so far of the various ROMs living inside the Stereoscan 200 have been promising and he believes he’s on the right track.

The microscope uses a mix of Texas Instruments 25L32 and 2516 chips, which [Benjamin] had to carefully pry out after making sure to document everything so he knew what went where. A few of the chips weren’t keen on being pulled from their home of 30-odd years, so there were a few broken pins, but on the whole the operation was a success.

Each chip was placed in a breadboard and wired up to an Arduino Mega, as it has enough digital pins to connect without needing a shift register. With the wiring fairly straightforward, [Benjamin] just needed to write up some code to read the contents of the chip, which he has graciously provided anyone else who might be working on a similar project. At this point he hasn’t found anything identifiable in his ROM dumps to prove that they’ve been made successfully, all he really knows right now is that he has something. At least it’s a start.

More and more of these older electron microscopes are getting a second lease on life thanks to dedicated hackers in their home labs. Makes you wonder if there’s ever going to be a piece of hardware the hacker community won’t bend to their will.