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.

Continue reading “Tachometer Uses Light, Arduinos”

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.

Continue reading “Arduino Watchdog Has Bite And Doesn’t Need Treats”

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.

Continue reading “Vintage Sewing Machine To Computerized Embroidery Machine”

Debunking Moon Landing Denial With An Arduino And Science

It’s sad that nearly half a century after the achievements of the Apollo program we’re still arguing with a certain subset of people who insist it never happened. Poring through the historical record looking for evidence that proves the missions couldn’t possibly have occurred has become a sad little cottage industry, and debunking the deniers is a distasteful but necessary ongoing effort.

One particularly desperate denier theory holds that fully spacesuited astronauts could never have exited the tiny hatch of the Lunar Excursion Module (LEM). [AstronomyLive] fought back at this tendentious claim in a clever way — with a DIY LIDAR scanner to measure Apollo artifacts in museums. The hardware is straightforward, with a Garmin LIDAR-Lite V3 scanner mounted on a couple of servos to make a quick pan-tilt head. The rig has a decidedly compliant look to it, with the sensor flopping around a bit as the servos move. But for the purpose, it seems perfectly fine.

[AstronomyLive] took the scanner to two separate museum exhibits, one to scan a LEM hatch and one to scan the suit Gene Cernan, the last man to stand on the Moon so far, wore while training for Apollo 17. With the LEM flying from the rafters, the scanner was somewhat stretching its abilities, so the point clouds he captured were a little on the low-res side. But in the end, a virtual Cernan was able to transition through the virtual LEM hatch, as expected.

Sadly, such evidence will only ever be convincing to those who need no convincing; the willfully ignorant will always find ways to justify their position. So let’s just celebrate the achievements of Apollo.

Continue reading “Debunking Moon Landing Denial With An Arduino And Science”

Handheld GPS Tracks All The Things

With a GPS on every smartphone, one would be forgiven for forgetting that handheld GPS units still exist. Seeking to keep accurate data on a few upcoming trips, [_Traveler] took on a custom-build that resulted in this GPS data logger.

Keeping tabs on [_Traveler] is a Ublox M8N GPS which is on full-time, logging data every 30 seconds, for up  to 2.5 days. All data is saved to an SD card, with an ESP32 to act as a brain and make downloading the info more accessible via WiFi . While tracking the obvious — like position, speed, and time — this data logger also displays temperature, elevation, dawn and dusk, on an ePaper screen which is a great choice for conserving battery.

The prototyping process is neat on this one. The first complete build used point-to-point soldering on a protoboard to link several breakout modules together. After that, a PCB design embraces the same modules, with a footprint for the ESP’s castellated edges and header footprints for USB charing board, SD card board, ePaper, etc. All of this finds a hope in a 3D printed enclosure. After a fair chunk of time coding in the Arduino IDE the logger is ready for [_Traveler]’s next excursion!

As far as power consumption in the field, [_Traveler] says the GPS takes a few moments to get a proper location — with the ESP chewing through battery life all the while — and plans to tinker with it in shorter order.

Not all GPS trackers are created equal: sometimes all you need is a stripped-down tracker for your jog, or to know exactly where every pothole is along your route.

[Via /r/electronics]