Posts with «arduino» label

Debugging with Serial Print at 5333333 Baud

Debugging with printf is something [StorePeter] has always found super handy, and as a result he’s always been interested in tweaking the process for improvements. This kind of debugging usually has microcontrollers sending messages over a serial port, but in embedded development there isn’t always a hardware UART, or it might already be in use. His preferred method of avoiding those problems is to use a USB to Serial adapter and bit-bang the serial on the microcontroller side. It was during this process that it occurred to [StorePeter] that there was a lot of streamlining he could be doing, and thanks to serial terminal programs that support arbitrary baud rates, he’s reliably sending debug messages over serial at 5.3 Mbit/sec, or 5333333 Baud. His code is available for download from his site, and works perfectly in the Arduino IDE.

The whole thing consists of some simple, easily ported code to implement a bare minimum bit-banged serial communication. This is output only, no feedback, and timing consists of just sending bits as quickly as the CPU can handle, leaving it up to the USB Serial adapter and rest of the world to handle whatever that speed turns out to be. On a 16 MHz AVR, transmitting one bit can be done in three instructions, which comes out to about 5333333 baud or roughly 5.3 Mbit/sec. Set a terminal program to 5333333 baud, and you can get a “Hello world” in about 20 microseconds compared to 1 millisecond at 115200 baud.

He’s got additional tips on using serial print debugging as a process, and he’s done a followup where he stress-tests the reliability of a 5.3 MBit/sec serial stream from an ATMega2560 at 16 MHz in his 3D printer, and found no missed packets. That certainly covers using printf as a debugger, so how about a method of using the debugger as printf?

This 3D-Printed Robotic Vacuum Sucks

After you’ve taken a moment to ponder the turn of phrase used in the title, take a look at this scratch-built robotic vacuum created by [theking3737]. The entire body of the vacuum was 3D printed, and all of the internal electronics are off-the-shelf modular components. We can’t say how well it stacks up against the commercial equivalents from iRobot and the like, but it doesn’t look like it would be too hard to build one yourself to find out.

The body of this rather concerned-looking robot was printed on a DMS DP5 printer, which is a neat trick as it only has a build platform of 200 mm x 200 mm. Once all the pieces were printed, a 3D pen was used to “weld” the sections together. The final result looks a bit rough, but should give a bond that’s just as strong as the printed parts themselves.

The robot has four sets of ultrasonic range finders to detect walls and obstacles, though probably not in the positions you would expect. The right side of the robot has two sets of sensors, while the left side only gets one. We aren’t sure the reasoning behind the asymmetrical layout, but presumably the machine prefers making right turns.

Control is provided by an Arduino Mega and the ever-reliable HC-05 Bluetooth module. A companion Android application was written which allows configuring the robot without having to plug into the Arduino every time you want to tweak a setting.

We can’t say we’ve seen that many DIY robotic vacuums here at Hackaday, but we’ve certainly featured our fair share of hacks for the commercially available models.

Tachometer Uses Light, Arduinos

To measure how fast something spins, most of us will reach for a tachometer without thinking much about how it works. Tachometers are often found in cars to measure engine RPM, but handheld units can be used for measuring the speed of rotation for other things as well. While some have mechanical shafts that must make physical contact with whatever you’re trying to measure, [electronoobs] has created a contactless tachometer that uses infrared light to take RPM measurements instead.

The tool uses an infrared emitter/detector pair along with an op amp to sense revolution speed. The signal from the IR detector is passed through an op amp in order to improve the quality of the signal and then that is fed into an Arduino. The device also features an OLED screen and a fine-tuning potentiometer all within its own self-contained, 3D-printed case and is powered by a 9 V battery, and can measure up to 10,000 RPM.

The only downside to this design is that a piece of white tape needs to be applied to the subject in order to get the IR detector to work properly, but this is an acceptable tradeoff for not having to make physical contact with a high-speed rotating shaft. All of the schematics and G code are available on the project site too if you want to build your own, and if you’re curious as to what other tools Arduinos have been used in be sure to check out the Arduino-based precision jig.

Arduino Watchdog Has Bite And Doesn’t Need Treats

My dog Jasper isn’t much of a watchdog: he’s too interested in sleeping and chasing my cats to keep an eye on things. Fortunately, [Vadim] has come up with a more reliable alternative with this simple Arduino watchdog. It’s designed to work with crypto coin mining rigs, but it could be easily adapted for other high-uptime uses, such as file servers or doomsday weapons.

The way it works is simple: a small program on the watched computer sends a command over the serial port: a polite “hello”. The Arduino watchdog picks this up and responds with an equally polite “HELLO”. That starts the watchdog running. A simple Java program on the watched computer then sends a ping every five seconds over the serial port to let the watchdog know it is still running okay.

If the watchdog doesn’t receive this ping, it uses reed relay wired into the reset pins of the computer to trigger a reset. It then waits for the watched computer to say hello, starting the process again.

[Vadim] includes a demo video where the system resets an unreliable crypto mining rig. It does have limitations, of course: if the mining program crashes without taking down the entire computer, the watchdog won’t be triggered, and it won’t work if the problem requires a full hard power reset rather than a soft reset. dIt’s a neat little build that could be easily modified to handle all these issues, though, and you don’t need to keep feeding it treats to keep its attention, unlike Jasper.

Hack a Day 23 Feb 19:30

Let an Arduino notify you when the coffee is ready

Hacker “wesgood,” apparently not satisfied with randomly checking the office coffee pot to see if a fresh brew was available, decided to make his own notification system.

His device uses a current sensor to monitor power usage of the coffee pot, and after some observation, he was able to pick out its brewing pattern—7A at 10 minutes, then quick cycling to keep the pot warm.

The system features an Arduino Yún for brew tracking and sends an alert via his office communication tool to let everyone know that a fresh pot is ready. As with many projects, the first iteration started life on a breadboard, but now exists on a manufactured PCB as a shield. It even has a second channel that is slated for use with the office kettle.

Once the Arduino side of the Yún detects the brew cycle is complete, it triggers a shell script under Linux that sends a notification to our office communication tool Hipchat. It also records the data about date and cycle stage so that Hipchat can query the database (on a webserver) and request things like what stage the brew cycle is on and when it brewed last.

You can find additional build details on Imgur.

Learning Microcontrollers and Robotics in the DroneBot Workshop

Discover an excellent YouTube channel for learning hobby electronics, microcontrollers, robotics, and drones.

Read more on MAKE

The post Learning Microcontrollers and Robotics in the DroneBot Workshop appeared first on Make: DIY Projects and Ideas for Makers.

Strange vocal interactions with ‘you, me and all these machines’

Moscow-based artist ::vtol:: is back again with an interesting interactive exhibit entitled “you, me and all these machines.” His latest work, a collaboration with Lovozero, allows two participants to produce otherworldly vocals together.

One participant wears the device, which points a directional microphone under the control of the other participant at her mouth using a servo motor. An array of LEDs signal the vocalist in a manner agreed upon before the performance.

The head-mounted system is controlled by an Arduino Uno, and is meant to display the subtle interaction between two participating artists, as they must work together to produce the desired output.

“You, me and all these machines” is a performance for voice and electronic devices. The vocalist puts on his or her head a specially designed wearable interface tool to interact with the voice and display a visual score. Technically, the device consists of several elements: a narrowly directional microphone driven by a motor; an LED strip that shows the vocalist score; remote control with a joystick used by the second participant to control the interface.

Shifting the microphone against the mouth makes it possible to achieve interesting sound effects, and makes it easier to manipulate the vocalist’s voice. The LED line consisting of 10 diodes is a very primitive, but effective and convenient way of interacting with the vocalist, and the way of interpreting the values is predetermined before each performance. During the performance, a sound canvas is formed, thereby changing the dynamics, consisting of a set of looped fragments created within voice and interface processing elements, without using other methods to generate sounds.

Check out “you, me and all these machines” in the video below!

Designing an Arduino-powered split-flap display

If you’d like a split-flap display with numbers and letters, options tend to be quite expensive. This though was no problem for hacker “scottbez1” who reports that after “only” two-plus years of work, he has produced a split-flap assembly that plugs into an Arduino Uno as a sort of external shield.

The device employs inexpensive stepper motors to click through letters, numbers, and even some punctuation, using cutout PVC ID display stock to show the characters. Cleverly, the PCB he designed for it can function as a motor driver or be split in two to function as a sensor board.

I’ve always loved these electro-mechanical displays, but you can’t buy them for a reasonable price, so I figured I’d try making them myself (plus it’s more fun that way!). Ultimately I wanted to design a split-flap display that can be built at home in small/single quantities and can be customized and put together by an intermediate hobbyist for not too much money.

The design I settled on uses PVC ID badge cards for the flaps, store-bought vinyl stickers for the letters, and is driven by a cheap 28BYJ-48 stepper motor. The enclosure and moving parts are all made from laser-cut MDF, which can be easily ordered online. To control them, I designed a driver board that can be hand-soldered and plugs into an Arduino like a shield.

The entire build story can be found here and more details including Arduino code are available on GitHub. If you’d just like to see and hear it flapping away, check out the video below!

Vintage Sewing Machine to Computerized Embroidery Machine

It is February of 2018. Do you remember what you were doing in December of 2012? If you’re [juppiter], you were starting your CNC Embroidery Machine which would not be completed for more than half of a decade. Results speak for themselves, but this may be the last time we see a first-generation Raspberry Pi without calling it retro.

The heart of the build is a vintage Borletti sewing machine, and if you like machinery porn, you’re going to enjoy the video after the break. The brains of the machine are an Arduino UNO filled with GRBL goodness and the Pi which is running CherryPy. For muscles, there are three Postep25 stepper drivers and corresponding NEMA 17 stepper motors.

The first two axes are for an X-Y table responsible for moving the fabric through the machine. The third axis is the flywheel. The rigidity of the fabric frame comes from its brass construction which may have been soldered at the kitchen table and supervised by a big orange cat. A rigid frame is the first ingredient in reliable results, but belt tension can’t be understated. His belt tensioning trick may not be new to you, but it was new to some of us. Italian translation may be necessary.

The skills brought together for this build were vast. There was structural soldering, part machining, a microcontroller, and motion control. The first time we heard from [juppiter] was December 2012, and it was the result of a Portable CNC Mill which likely had some influence on this creation. Between then, he also shared his quarter-gobbling arcade cabinet with us.

10 Arduino-Based Robo-Critters

Hot on the heels of yesterday’s delightful discovery of Vorpal, a lovable scamp of a hexapod, I decided to poke around to see what other Arduino-based robot projects there are out there these days. I found this YouTube video rounding up ten robo-critters. These include a robo-dog, a robotic cat, […]

Read more on MAKE

The post 10 Arduino-Based Robo-Critters appeared first on Make: DIY Projects and Ideas for Makers.