Posts with «arduino» label

Automatic Sunglasses For the Lazy Hacker

[Andreas] may have created the ultimate lazy hacker accessory: automatic sunglasses, or “Selfblending sunglasses” as he creatively titled his video. If you can’t tell from the name, these are glasses that you never have to take off. If the light is dim, they move away from your eyes. Going back outside to bright light? The glasses move to protect your eyes.

The glasses consist of a couple of micro servos which move tinted lenses toward or away from the user’s eyes. A side-mounted Arduino Uno reads a CdS cell light sensor and drives the servos.  Why an Uno rather than a much more wearable Arduino Nano? It’s what [Andreas] had lying around.

Yes, a good portion of the fun of this build is [Andreas’] comedy. But the best part comes when he tests the glasses out — in an actual car on the highway. The glasses work better than expected — moving the lenses into and out of [Andreas] field of view as he drives through tunnels. You can actually see how surprised [Andreas] is that it works so well.

These aren’t the first automatic sunglasses we’ve seen, nor are they the most peril-sensitive. Still, it’s a fun project and the video gave us a few chuckles.

Hack a Day 14 Jun 06:00

Simplifying Basic LED Effects

There was a time when having a blinking blue LED on a project was all you needed to be one of the cool kids. But now you need something more complex. LEDs should not just snap on, they should fade in and out. And blinking? Today’s hotness is breathing LEDs. If that’s the kind of project you want, you should check out [jandelgado’s] jled library.

At first glance, an Arduino library for LED control might seem superfluous, but if you are interested in nice effects, the coding for them can be a bit onerous. If you don’t mind stopping everything while you fade an LED on (or off) then sure, you just write a loop and it is a few lines of code. But if you want to have it happen while other things continue to execute, it is a little different. The library makes it very simple and it is also nicely documented.

Obviously, to create a special effect LED, you need to create a JLed object. Then you can use modifier methods on that object to get certain effects. The only overhead is that you need to call the update method on the LED periodically. Here is one of the examples from the project:

#include <jled.h>

// connect LED to pin 13 (PWM capable). LED will breathe with period of
// 2000ms and a delay of 1000ms after each period.
JLed led = JLed(13).Breathe(2000).DelayAfter(1000).Forever();

void setup() { }

void loop() {
   led.Update();
}

Pretty easy and readable. Just remember that some Arduinos can’t do PWM on pin 13, so you might have to adjust. Our only complaint is that you have to update each LED. It would be nice if the JLed constructor kept a linked list of all LED objects so you could have a class method that updates all of them with one call. In the examples, the author keeps all the LEDs in an array and steps through that. However, that would be easy to fork and add. Oh wait, we did it for you. The library does do a lot of work, including taking advantage of higher PWM resolution available on the ESP8266, for example.

The library can turn an LED on or off (including delays), blink or breathe an LED forever or for a certain number of times, or fade an LED on or off. In addition to the presets, you can provide your own brightness function if you want to do some kind of custom pattern. You can modify most actions by specifying a delay before or after, a repeat count (which can be forever) and you can also tell the library that your LED is active low, so you don’t have to mentally remember to flip everything around in your code.

Rocket science? No. But we like it. Blocking for an LED effect is bad and this makes fancy asynchronous LEDs simple. Why not use it? Recent IDEs can install it from the manage library dialog, so it takes just a second.

Really, libraries are a key to building systems simple. Why not stand on the backs of others? Some of our favorites handle SPI and proportional integral derivative (PID) control.

Hack a Day 14 Jun 00:00

Pull small planes around with this Arduino Mega-based tug

While there are many ways to move an airplane on the ground, Anthony DiPilato decided to build a “tug” of his own.  

The treaded device looks like a tiny tank, and when it slides under the aircraft’s front wheel it locks in place, allowing a 5,200-pound plane to be pulled around courtesy of the RC system’s wheelchair motors. Onboard, an Arduino Mega serves as the brains of the operation along with an H-bridge for motor control. User interface is handled by DiPilato’s iPhone via Bluetooth.

For small aircraft, a towbar is sufficient, but for larger aircraft a power assisted tug is necessary for maneuvering the aircraft. Commercially available aircraft tugs are considerably expensive, so many people use small tractors or golf carts to pull their aircraft.For this project I wanted to see if I could build a remote controlled aircraft tug for a reasonable price.

The goal was to design a remotely controlled tug capable of pulling a Cessna 310 with an estimated weight of 5,200 lbs while keep the cost under $1,000.

Build details can be found in his blog write-up. The Arduino code is available on GitHub, as well as the iOS program. Finally, you can see the tug in action in the first video below, while the second clip shows how the locking mechanism works.

Arduino Blog 12 Jun 17:07

This Arduino-controlled robot slithers like a snake

Would you like to create a robot that slithers from place to place like a snake? Well now you can, thanks to this bio-inspired design from Will Donaldson. 

Donaldson’s project uses 10 metal gear servos to allow his robotic snake to curl its body back and forth, sliding along on small wheels that replace a real serpent’s bottom scales. An Arduino Nano controls its 10 segments, and power is provided by an external tether from a recycled desktop power supply. 

As shown in Donaldson’s video, he’s been experimenting with several different snake builds and forms of locomotion. These include an inchworm-style gait where sections are picked up off of the ground, and a sort of hybrid configuration where a snake can move in both the horizontal and vertical planes. 

Instructions and code can be found in Donaldson’s write-up here, and you can check out the video below to see more about his design process.

A DIY Automobile Black Box with Arduino Mega

If you’d like to monitor your driving habits, or perhaps keep them handy in the event of an accident, a “black box,” or more properly a “telematics” device is just what you’re looking for. 

Monitoring driving habits can be interesting, but what if you’d like to make a telematics box yourself, giving you total control over how data is collected and used?

That’s just what maker “TheForeignMan” did, using an Arduino Mega to take in data from his car’s OBD-II port, along with position information from a GPS module. Vehicle speed, engine RPM, and throttle depression are saved on an SD card, which can be removed and graphed on the driver’s computer.

DISCLAIMER: This custom-made black box may not always be valid evidence in a court of law. Some countries/states/local laws may not allow installation of custom monitoring units into moving vehicles unless authorized by an approved installation team. For these reasons, and any other associated to tampering with the OBD port, the author(s) of this article and website hold no responsibility over the outcome of your driving, your car, your car’s electronics (including on board computer), and any other incidents occurred with a custom-made monitoring unit fitted.

Instructions for this build are available here and code can found on GitHub. 

These high school students built their own vending machine

If you’re a high school student and would appreciate a vending machine in class, what’s to be done? Most of the time the answer is “not much,” but Tustin High T-Tech students were able to get one—by building it themselves!

In fact, this excellent device functioned both as a class project and as a fundraiser for their engineering program. It can be seen working in the video below, and uses an Arduino Mega for control, along with motor drivers and steppers to actuate six snack pusher coils. 

Customers simply insert a dollar into the bill acceptor, punch in the correct number in the keypad, and snacks drop out. Arduino code is published here, and Solidworks design files are also available for your DIY vending edification.

Don’t Miss Tomorrow Night’s Hardware Didactic Galactic

MAKE » Arduino 06 Jun 22:10

Smart Citizen Opens Eyes and Ears in Barcelona

More often than not, our coverage of projects here at Hackaday tends to be one-off sort of thing. We find something interesting, write it up for our beloved readers, and keep it moving. There’s an unending world of hacks and creations out there, and not a lot of time to cover them all. Still, it’s nice when we occasionally see a project we’ve previously covered “out in the wild” so to speak. A reminder that, while a project’s time on the Hackaday front page might be fleeting, their journey is far from finished.

A perfect example can be found in a recent article posted by the BBC about the battle with noise in Barcelona’s Plaza del Sol. The Plaza is a popular meeting place for tourists and residents alike, with loud parties continuing into the middle of the night, those with homes overlooking the Plaza were struggling to sleep. But to get any changes made, they needed a way to prove to the city council that the noise was beyond reasonable levels.

Enter the Smart Citizen, an open source Arduino-compatible sensor platform developed by Fab Lab Barcelona. We originally covered the Smart Citizen board back in 2013, right after it ran a successful funding campaign on Kickstarter. Armed with the data collected by Smart Citizen sensors deployed around the Plaza, the council has enacted measures to try to quiet things down before midnight.

Today people tend to approach crowdfunded projects with a healthy dose of apprehension, so it’s nice to see validation that they aren’t all flash in the pan ideas. Some of them really do end up making a positive impact, years after the campaign ends.

Of course, we can’t talk about distributed environmental monitoring without mentioning the fantastic work of [Radu Motisan], who’s made it his mission to put advanced sensors in the hands of citizen scientists.

[Thanks to muA for the tip.]

A Flexible Arduino Prototype

We recently visited NextFlex, the flexible electronics manufacturing institute in Silicon Valley, where they developed a flexible prototype based on the Arduino Mini. Their mission is to make flexible electronics mainstream, opening up all kinds of new applications.

How did you make the flexible Arduino prototype?

Some of the equipment we use is familiar. For example, automated screen printers and industrial inkjet printers. We used them to print the circuit on a 1mm thick flexible plastic ‘board’ (known as the substrate).

We then took the microcontroller silicon die, which is usually inside a chip package, and connected it directly to the substrate. For this, we used our production-level assembly equipment for precision adhesive dispense, die, and component attach.

Using these techniques, we’re able to create flexible wire connections with a resolution of 50um (that’s 0.005 cm, roughly the thickness of a human hair).

Silicon die inside a standard microcontroller package. (Image credit: NextFlex)

What kind of conductive inks are you using to connect components?

Conductive inks are not new, however we focus our efforts on making these materials very reliable and resilient.

We are using advanced formulations of silver ink with strong adhesion to the base substrate, uniform particle distribution, and the ability to bend and flex after curing — all without degrading the electrical performance.

Some components you use are rigid. When will they be flexible too?

We use some rigid components, which is why we call it “Flexible Hybrid Electronics,” but aim for them to be as small and thin as possible.

The unpackaged die can be thinned to 30um or less. At these thicknesses the silicon becomes flexible and allows for 10mm or smaller bend radii (roughly the radius of your thumb).

Some passive components we use, like capacitors and resistors, are rigid today. Eventually we will print these components, so they are flexible too.

When will flexible electronics be used in every day products? 

The technology is already here! Over the next couple of years, we think it will reach prices that make it widely adopted in consumer products. Before then, by working on projects like the flexible Arduino implementation, we hope we can soon put development tools into the hands of more students, makers and product designers to innovate with.

MCU silicon die bonded to the flexible Arduino prototype. (Image credit: NextFlex)

NextFlex will be talking more about this project at the Sensors Expo & Conference in San Jose, California on June 26th, during the “Democratizing IoT” session.

Teddy Ruxpin answers queries with Arduino and Google Assistant

If you have an unused Teddy Ruxpin lying around, you’re in luck. This hack from “Jayden17” turns the iconic ’80s toy from a fancy tape player into your own talking bear assistant!

The build started out with obtaining one of these vintage bears and fixing up the internals, as well as equipping it with a new speaker. An old smartphone was then added, running Google Assistant to take and answer queries. An Arduino Uno is tasked with translating the amplitude of incoming sound into mouth movements with the help of a motor shield.

If you can get your hands on one of these animatronics toys, it’s a relatively simple hack and something that could work with any sort of voice assistant or audio input. Check it out in the video below!