Posts with «arduino» label

Pulse Oximeter is a Lot of Work

These days we are a little spoiled. There are many sensors you can grab, hook up to your favorite microcontroller, load up some simple library code, and you are in business. When [Raivis] got a MAX30100 pulse oximeter breakout board, he thought it would go like that. It didn’t. He found it takes a lot of processing to get useful results out of the device. Lucky for us he wrote it all down with Arduino code to match.

A pulse oximeter measures both your pulse and the oxygen saturation in your blood. You’ve probably had one of these on your finger or earlobe at the doctor’s office or a hospital. Traditionally, they consist of a red LED and an IR LED. A detector measures how much of each light makes it through and the ratio of those two quantities relates to the amount of oxygen in your blood. We can’t imagine how [Karl Matthes] came up with using red and green light back in 1935, and how [Takuo Aoyagi] (who, along with [Michio Kishi]) figured out the IR and red light part.

The MAX30100 manages to alternate the two LEDs, regulate their brightness, filter line noise out of the readings, and some other tasks. It stores the data in a buffer. The trick is: how do you interpret that buffer?

[Raivis] shows the code to take the output from the buffer, remove the DC component, pass it through a couple of software filters, and detect the heart rate. To read the oxygen reading, you have even more work to do. You can find the code for the device on GitHub.

If you want to build your own without a dedicated IC, grab a clothespin. Or try this more polished build.


Filed under: Arduino Hacks, Medical hacks

Save ESP8266 RAM with PROGMEM

When [sticilface] started using the Arduino IDE to program an ESP8266, he found he was running out of RAM quickly. The culprit? Strings. That’s not surprising. Strings can be long and many strings like prompts and the like don’t ever change. There is a way to tell the compiler you’d like to store data that won’t change in program storage instead of RAM. They still eat up memory, of course, but you have a lot more program storage than you do RAM on a typical device. He posted his results on a Gist.

On the face of it, it is simple enough to define a memory allocation with the PROGMEM keyword. There’s also macros that make things easier and a host of functions for dealing with strings in program space (basically, the standard C library calls with a _P suffix).

However, there’s also a helper class that lets you use a string object that resides in program memory. That makes it even easier to use these strings, especially if you are passing them to functions. As an example [sticilface] writes a string concatenation function that handles PROGMEM strings.

You can use the same techniques for other data, as well, and at the end of the post, there are some very clear examples of different use cases. Under the hood, the ESP8266 doesn’t store data in bytes in program memory. The library routines hide this from you, but it can be important if you are trying to calculate space or do certain kinds of manipulation.

You can also check out the official documentation. If you want to see the technique in action, maybe you’ll be interested in your coworker’s mood. Or, try putting a Jolly Wrencher on your oscilloscope. Both projects use PROGMEM.

[Editor’s note: PROGMEM is in the ESP8266 Arduino codebase from AVR-GCC, and originally wrote (counterinutitively) into RAM.  Some clever hacking fixed that early last year, so now you can use the same AVR-style abstraction with the ESP. It still doesn’t work on the ARM Arduinos.]

Image by [connorgoodwolf] (CC BY-SA 4.0)


Filed under: Arduino Hacks

An interactive Lea shapes puzzle for visually impaired children

Using two Arduino Micros, these parents created a unique Lea shapes puzzle for their daughter Rebecca.

Because of a medical condition, Rebecca will need to have her vision assessed at the age of two or younger. This means that she’ll have to be tested without yet knowing her alphabet, and instead need to be familiar with Lea shapes which can act as a substitute for letters in a vision test. Unfortunately, her hearing is also impaired, meaning that a non-visual type of stimulus is needed to encourage a correct response.

To accomplish this, her parents came up with an excellent puzzle system, where when one of these shapes is dropped into the correct slot, the smart lights in the room change to the corresponding color. It’s an interesting project that will hopefully help with a pressing need.

In terms of hardware, a Raspberry Pi 3 is used as a central hub along with a Hue smart lights bridge, which is paired with a couple of Arduinos and 2.4GHz radio modules that handle the wireless communication between the two devices.

You can see more about this build on their blog here and more background on their lighting system here.

Arduino into NAND Reader

[James Tate] is starting up a project to make a “Super Reverse-Engineering Tool”. First on his list? A simple NAND flash reader, for exactly the same reason that Willie Sutton robbed banks: because that’s where the binaries are.

As it stands, [James]’s first version of this tool is probably not what you want to use if you’re dumping a lot of NAND flash modules. His Arduino code reads the NAND using the notoriously slow digital_read() and digital_write() commands and then dumps it over the serial port at 115,200 baud. We’re not sure which is the binding constraint, but neither of these methods are built for speed.

Instead, the code is built for hackability. It’s pretty modular, and if you’ve got a NAND flash that needs other low-level bit twiddling to give up its data, you should be able to get something up and working quickly, start it running, and then go have a coffee for a few days. When you come back, the data will be dumped and you will have only invested a few minutes of human time in the project.

With TSOP breakout boards selling for cheap, all that prevents you from reading out the sweet memory contents of a random device is a few bucks and some patience. If you haven’t ever done so, pull something out of your junk bin and give it a shot! If you’re feeling DIY, or need to read a flash in place, check out this crazy solder-on hack. Or if you can spring for an FTDI FT2233H breakout board, you can read a NAND flash fast using essentially the same techniques as those presented here.


Filed under: Arduino Hacks, hardware

This device converts gestures into keystrokes

Engineering student Federico Terzi has built an impressive computer interface device reminiscent of a Wiimote.

When talking in person,  you can express meaning using facial expressions, and your hands. Usually this acts to add emphasis to a statement or perhaps to point out a certain object, but what if you could actually type letters based on how your hands move?

Terzi’s aptly named “Gesture Keyboard” does just this, using an Arduino Pro Micro, an MPU-6050 accelerometer, and an HC-06 Bluetooth module for sending signals to his laptop. A Python library using Scikit-learn’s SVM (Support Vector Machine) algorithm then translates the motion readings into characters that appear on the screen.

You can find the code and more information on Terzi’s GitHub page.

Arduino + Geometry + Bicycle = Speedometer

It is pretty easy to go to a big box store and get a digital speedometer for your bike. Not only is that no fun, but the little digital display isn’t going to win you any hacker cred. [AlexGyver] has the answer. Using an Arduino and a servo he built a classic needle speedometer for his bike. It also has a digital display and uses a hall effect sensor to pick up the wheel speed. You can see a video of the project below.

[Alex] talks about the geometry involved, in case your high school math is well into your rear view mirror. The circumference of the wheel is the distance you’ll travel in one revolution. If you know the distance and you know the time, you know the speed and the rest is just conversions to get a numerical speed into an angle on the servo motor. The code is out on GitHub.

Granted, reading a magnet, keeping time, and driving a servo isn’t exactly cutting edge. On the other hand, it made us think about what other kinds of outputs you could drive. We haven’t seen a nixie tube speedometer (well, not on a bicycle, anyway), for example. Or maybe one built with mechanical flip numbers like an old clock.

We have seen some with Arduinos and lots of LEDs (although, again, not really for a bicycle). This speedometer might still be our favorite, though.

 


Filed under: Arduino Hacks, transportation hacks

An Arduino-controlled Team Fortress 2 sentry gun prop

If you’ve played Team Fortress or its sequel TF2, you’ve certainly run into a sentry gun. This unit can be set up by an engineer character to guard various positions, and looks like something that could make an amazing prop.

YouTuber “henry3136” apparently agrees, and spent an estimated 400-500 hours building and programming his own out of cardboard, plastic bottles, and a few 3D-printed bits.

His Arduino-controlled gun pans back and forth using a servo and “fires” whenever it senses a target with its ultrasonic sensor. An Adafruit Audio FX Sound Board helps produce some fun effects, while the barrel moves in and out to scare off the bad guys.

You can see it in action below!

Heat up a small pool with this solar-powered system

Imgurian “ElectricYFronts” has created an Arduino-controlled solar heating system for his kids’ paddling pool.

Small semi-portable above ground pools can be fun, but are generally not heated. The “Solar Paddle” system, however, raises the temperature of the pool from a chilly 68 degrees Fahrenheit to a much warmer 83 degrees (20 to 28 Celsius). It does this by piping water into and out of the pool, then heating it in over 200 yards of black watering pipe on top of a shed.

Water is cycled via an impeller pump, which is powered by a solar panel along with a battery to keep power even over fluctuations. A few buttons and an LCD panel allow things to be changed around without opening up the Arduino Uno’s enclosure.

You can see more on how this heater was made on Imgur.

Make an “analog” bike speedometer with Arduino

As Maker Alex Gyver points out in his video, Chinese bike computers are quite cheap, but “why not?” It’s a great question, and one that motivates many of the hacks seen here, including his mountain bike speedometer.

Although he could have simply used a numerical display to show how fast his bike was going, he instead employed a small servo to point to the speed like an analog gauge. The custom speedometer is based on an Arduino Nano, and wheel revolutions are measured by a magnetic and Hall effect sensor.

This may seem like a silly project, but if you need to take a very short glance at something, analog gauges tend to be much easier to read than digital. Perhaps this concept could be quite useful! You can see exactly how to make this hack on Instructables and in his video here with a few action shots. Code can be found on GitHub if you’d like to check that out as well!

A cool infinity mirror-style bottle opener

In his quest to create “the coolest wall-mounted bottle opener in the entire world,” it would appear that YouTuber “Never Stop Seeking” has succeeded.

As seen below, the infinity mirror-style unit is made of plexiglass and two-way mirror film, and equipped with Arduino Uno-controlled RGB LED strips that are activated by a proximity sensor as you open a beer or soda. He even included a magnetic catch for his bottle caps!

Want to build one of your own? Good news, Never Stop Seeking plans on sharing more details along with a how-to video in the coming days.