Posts with «arduino» label

Blinking an Arduino LED, in Julia

The Julia programming language is a horrible fit for a no-frills microcontroller like the ATMega328p that lies within the classic Arduino, but that didn’t stop [Sukera] from trying, and succeeding.

All of the features that make Julia a cool programming language for your big computer make it an awful choice for the Arduino. It’s designed for interactivity, is dynamically typed, and leans heavily on its garbage collection; each of these features alone would tax the Mega to the breaking point. But in its favor, it is a compiled language that is based on LLVM, and LLVM has an AVR backend for C. Should just be a simple matter of stubbing out some of the overhead, recompiling LLVM to add an AVR target for Julia, and then fixing up all the other loose ends, right?

Well, it turns out it almost was. Leaning heavily on the flexibility of LLVM, [Sukera] manages to turn off all the language features that aren’t needed, and after some small hurdles like the usual problems with volatile and atomic variables, manages to blink an LED slowly. Huzzah. We love [Sukera’s] wry “Now THAT is what I call two days well spent!” after it’s all done, but seriously, this is the first time we’ve every seen even super-rudimentary Julia code running on an 8-bit microcontroller, so there are definitely some kudos due here.

By the time that Julia is wedged into the AVR, a lot of what makes it appealing on the big computers is missing on the micro, so we don’t really see people picking it over straight C, which has a much more developed ecosystem. But still, it’s great to see what it takes to get a language designed around a runtime and garbage collection up and running on our favorite mini micro.

Thanks [Joel] for the tip!

Raspberry Pi Simulates the Real Analog TV Experience

If you’ve laid hands on a retro analog TV, have the restoration bug, and you plan to make the final project at least somewhat period-correct, you face a bit of a conundrum: what are you going to watch? Sure, you can serve up just about any content digitally these days, but some programs just don’t feel right on an old TV. And even if you do get suitably retro programming, streaming isn’t quite the same as the experience of tuning your way through the somewhat meager selections as we did back in the analog days.

But don’t worry — this Raspberry Pi TV simulator can make your streaming experience just like the analog TV experience of yore. It comes to us from [Rodrigo], who found a slightly abused 5″ black-and-white portable TV that was just right for the modification. The battery compartment underneath the set made the perfect place to mount a Pi, which takes care of streaming a variety of old movies and shorts. The position of the original tuning potentiometer is read by an Arduino, which tells the Pi which “channel” you’re currently tuned to.

Composite video is fed from the Pi’s output right into the TV’s video input, and the image quality is just about what you’d expect. But for our money, the thing that really sells this is the use of a relay to switch the TV’s tuner back into the circuit for a short bit between channel changes. This gives a realistic burst of static and snow, just like we endured in the old days. Hats off to [Rodrigo] for capturing everything that was awful about TV back in the day — Mesa of Lost Women, indeed! — but still managing to make it look good.

Hack a Day 20 Jun 12:00

This Arduino Pen Plotter Is Built for Speed

We see a lot of simple pen plotter projects around here, and while we appreciate them one and all, most of them are a little on the slow side. That’s OK — a glacial pace is sometimes all that’s needed, as long as it gets the job done. But there’s nothing wrong with putting the pedal to the metal, so to speak. And that’s exactly what this super-fast Arduino-based plotter is all about.

As the story goes, [IV Projects] felt the need for speed after building an earlier pen plotter project that worked, but failed to excite. With the additional goal of keeping the plotter easy to build with cheap parts, the design centers on a “grit roller drive” for the Y-axis — the one that actually moves the paper back and forth. And move it does, using Dremel tool sanding drums on a lightweight shaft to maximize acceleration. In fact, all the moving parts are kept as lightweight as possible, and the results really show — the three steppers really sing when this plotter is in action.

There are some really clever details in [IV Projects]’ design. We particularly like the way the pen lift mechanism works, and the surprise appearance of a clothespin spring as a belt tensioner was a real treat. Judging by the pile of rejected prototype parts, it took quite a bit of work to get this design right. If you’d like to build your own, STLs are available for the printed parts.

If you’re interested in what the other end of the speed scale looks like, check out this bare-minimum pen plotter.

Hack a Day 20 Jun 06:00
arduino  misc hacks  pen  plotter  stepper  x-y  

Pushing the Limits of a 16×2 LCD with Bad Apple!!

While low-contrast, blue-on-slightly-less-blue 16-character by 2-line LCDs are extremely popular, they really are made specifically for alphanumeric use. They do an admirable job of displaying a few characters, but they don’t exactly spring to mind as a display for non-character purposes. But displaying video on a 16×2 LCD is possible, as long as you’re willing to stretch the definition of “video” a bit and use some imagination while watching.

Normally, a 16×2 display can only display a single character in each spot, chosen from a fixed character set. But [arduinocelantano] was able to leverage the eight custom character slots the display allows to build up images from arbitrary 5×8 pixel bitmaps. After using ffmpeg to scale the original video to a viewport of eight characters, a Python program was used to turn every frame of the scaled video into code to generate the custom bitmaps for each chunk of the viewport. Even with the low refresh rate of the display and the shrunken frame size, the result is a recognizable video, helped no doubt by the choice of the shadow-puppet Bad Apple!! video. Check it out after the break to see how it looks.

We saw a similar rendering of the same video on LCD a while back; that effort was amazing in that it was an EEPROM-only implementation, along with a somewhat bigger LCD with better contrast. That project served as inspiration for [arduinocelantano]’s build here, which in some ways we think looks a bit better — perhaps it’s the inverted pixels. Either way, hats off to both builders for pushing past the normal constraints and teaching us something interesting.

The HackadayPrize2022 is Sponsored by:
Hack a Day 14 Jun 12:00

Odd Inputs and Peculiar Peripherals: The GameBug Turns Your Breadboard Into a Game Console

What’s more fun than playing video games? Designing your own video game hardware, of course! If you’ve followed these pages long enough you’ll have seen dozens of great examples of homebrew hardware, and perhaps been inspired to try such a project yourself. This often starts with assembling the basic bits onto a solderless breadboard, which is fine for programming but not so great for testing: squeezing pushbuttons into your breadboard works for basic debugging, but is not very user-friendly or reliable. A better solution can be found in [Dimitar]’s GameBug: a set of breadboard-compatible joypad-like controllers.

The GameBug’s design excels in its simplicity: a miniature analog joystick, four buttons arranged in a diamond pattern, a shoulder button and two sliding switches are sitting on a neat purple PCB. On the bottom are two rows of pin headers to ensure a snug fit on your solderless breadboard. There’s even a little vibrating motor for haptic feedback.

Interfacing with the GameBug is simplified by the integrated readout electronics. A Schmitt trigger-based debounce circuit ensures clean signals from all the pushbuttons, while a motor driver chip provides stable current to the haptic feedback system. An RGB LED can be used as yet another user feedback device, or simply for decorative lighting.

All design files are available on [Dimitar]’s GitHub page, along with an Arduino sketch to help you try out the GameBug’s functionality. Having a proper gamepad might come in handy with breadboard-based game systems like Tiny Duck Hunt or this impressive mess of wires that makes up a Colecovision.

Mighty Modules: Pluggable Boards To Get Your Project Built

If you're taking your microcontroller or SBC project to market, these pluggable boards might be what you need.

The post Mighty Modules: Pluggable Boards To Get Your Project Built appeared first on Make: DIY Projects and Ideas for Makers.

Sisyphean Ball Race Robot Toils Gracefully, Magnetically

Aren’t ball races and marble runs fun? Wouldn’t they be so much more enjoyable if you didn’t have to climb back up the ladder each time, as it were, and reset the thing? [Johannes] wrote in to tell us about a wee robot with the Sisyphean task of setting a ball bearing on a simple but fun course, collecting it from the end, and airlifting it back to the start of the track.

[Johannes] built this ‘bot to test small-scale resin printing strength as well as the longevity of some tiny linear actuators from Ali that may or may not be available at a moment’s notice. The point was to see how these little guys fared when connected directly to an Arduino or other microcontroller, rather than going the safer route with a motor driver of some kind.

Some things worked well, like the c-clips that keep the axles together, and using quick pulses to release the magnetically-linked ball from the gripper. Other aspects didn’t work out so well. Tiny resin parts do not respond well to force, for starters. And then there’s the actuators themselves. The connections are fragile and the motors are weak, but they vary wildly in quality from piece to piece, so YMMV. Some lose steps, and others occasionally seize. But you wouldn’t know any of that from the graceful movement capture in the video below. Although it appears to be automated, the bot is under remote control because of the motor issues.

Not into ball runs? There are other Sisyphean tasks available, such as moving sand around in the name of meditation.

Water Your Plants Just Four Times Per Year

While it’s true that some plants thrive on neglect, many of them do just fine with a few ounces of water once a week, as long as the light level is right. But even that is plenty to remember and actually do in our unprecedented times, so why bother trying? [Martin] has solved this problem for us, having given every aspect of automatic plant care a lot of thought. The result of his efforts is Flaura, a self-watering open-source plant pot, and a YouTube channel to go with it.

The 3D-printed pot can easily be scaled up or down to suit the size of the plant, and contains a water reservoir that holds about 0.7 L of water at the default size. Just pour it in through the little spout, and you’re good for about three months, depending on the plant, the light it’s in, and how much current water it draws. You can track the dryness level in the companion app.

Whenever the capacitive soil moisture sensor hidden in the bottom of the dirt detects drought conditions, it sends a signal through the Wemos LOLIN32 and a MOSFET to a small pump, which sends up water from the reservoir.

The soil is watered uniformly by a small hose riddled with dozens of tiny holes that create little low-pressure water jets. This is definitely our favorite part of the project — not just because it’s cool looking, but also because a lot of these types of builds tend to release the water in the same spot all the time, which is. . . not how we water our plants. Be sure to check out the project overview video after the break.

No printer? No problem — you could always use an old Keurig machine to water a single plant, as long as the pump is still good.

Thanks for the tip, [Keith]!

Arduino and Git: Two Views

You can’t do much development without running into Git, the version control management system. Part of that is because so much code lives on GitHub which uses Git, although you don’t need to know anything about that if all you want to do is download code. [Dr. Torq] has a good primer on using Git with the Arduino IDE, if you need to get your toes wet.

You might think if you develop by yourself you don’t need something like Git. However, using a version control system is a great convenience, especially if you use it correctly. There’s a bug out in the field? What version of the firmware? You can immediately get a copy of the source code at that point in time using Git. A feature is broken? It is very easy to see exactly what changed. So even if you don’t work in a team, there are advantages to having source code under control.

If you are already using a more advanced IDE, Git is probably integrated into your environment, or, at least, it could be. If you are allergic to the command line, there are plenty of GUI tools to use Git, also. One nice thing about Git is that your local repository is just a directory. You don’t need to stand up a special server or anything to use it.

We don’t think it is directly related, but [Andreas] recently had a video on Git and Arduino. It isn’t as detailed, but it does have some good stuff and is worth the time to watch. You can see it below.

We’ve used Git for some odd things in the past. Note that Git is the version control system while GitHub is a website. However, if you are a hardcore command line user, you can manipulate GitHub from there, too.

This Sun Tracking CNC Machine Uses The Sun Instead of a Laser

We’ve all seen people goof around with a magnifying glass in the sun, but this project takes it to a new level. Cranktown City has uploaded this fantastically amusing project that is sure to impress. He built a cnc controlled engraving machine that uses the sun instead of a laser tube. As he explains in […]

The post This Sun Tracking CNC Machine Uses The Sun Instead of a Laser appeared first on Make: DIY Projects and Ideas for Makers.