IoT Power Strip Lets You Control All Your Holiday Lights

As IoT devices become more prevalent in the consumer world, how long will it be before it’s cheaper to buy one, than to make one? Definitely not yet, which means if you want your very own IoT power strip — you’ll have to make your own. Good thing it’s not that hard!

[Dev-Lab] came up with this project which allows him to control several outlets with his phone. What we really like about it is that he designed a 3D printed housing that fits on the end of the power-strip. This keeps all messy wires out of sight, and it looks like it was designed to be there!

The beauty with an IoT device like this is that it doesn’t require any infrastructure besides a WiFi enabled device with an HTTP browser — the ESP8266 module means no server is necessary. An Arduino was used in the project just because it was quick an easy to do. But it really boils down to being a glorified pin expander. This could very easily be fixed by upgrading from an ESP01 to and ESP03 module to get more IO broken out on the carrier board. If you do this, let us know!

Continue reading “IoT Power Strip Lets You Control All Your Holiday Lights”

$20 Sip-and-Puff Mouse From E-Cig And 3D Printing

At Hackaday, we think the highest form of hacking is hacking for good. Sure, it’s fun to build robots and gadgets, and universal remotes. But it is even better to create things that make people’s lives better. In that spirit, we enjoyed seeing the Assistive Tech Challenge over on Thingiverse that ended last month. The winner was [0_o] who used 3D printing and an Arduino to produce a mouth-operated mouse for under $20.

sip-sensor-from-ecigInstructions on Thingiverse can be spotty, but [0_o] did an excellent job of laying out what you need to buy and how to assemble it. One of the most interesting parts of the build is the blow sensor. [0_o] tore apart a $5 electronic cigarette and used the sensor within. The mouthpiece is moved like a joystick to actuate the cursor, and the user blows into it for the mouse clicks. Perhaps not a true sip-and-puff system but it made us wonder what other uses you might find for these sensors.

You can see a video about the mouse after the break. These kinds of projects have the power to make someone’s life better and what could be better than that?

Continue reading “$20 Sip-and-Puff Mouse From E-Cig And 3D Printing”

Reading Smart Cards From A PLC (with A Little Arduino Help)

If you’ve spent any time on a factory or plant floor, it is a good bet you’ve run into PLCs (Programmable Logic Controllers). These are rugged computers that do simple control and monitoring functions, usually using ladder logic to set their programs. [plc4u] wanted to connect a smart card reader to an Allen Bradley PLC, so he turned to an Arduino to act as a go-between.

The Arduino talks to a USB card reader using a USB host shield. Then it communicates with the PLC using an RS232 link and the DF1 protocol that most Allen Bradley PLCs understand. You may not need a smart card, but once you know how to communicate between an Arduino and the PLC, you could do many different projects that leverage other I/O devices and code available on the Arduino and connects to existing PLC installations. Just remember that you’ll probably need to ruggedize the Arduino a bit to survive and be safe to the same level as a PLC (which might include a NEMA enclosure or even an explosion-proof box).

Continue reading “Reading Smart Cards From A PLC (with A Little Arduino Help)”

Code Craft – Embedding C++: Templates

The language C++ is big. There is no doubting that. One reason C++ is big is to allow flexibility in the technique used to solve a problem. If you have a really small system you can stick to procedural code encapsulated by classes. A project with a number of similar but slightly different entities might be best addressed through inheritance and polymorphism.

A third technique is using generics, which are implemented in C++ using templates. Templates have some similarities with #define macros but they are a great deal safer. The compiler does not see the code inserted by a macro until after it has been inserted into the source. If the code is bad the error messages can be very confusing since all the developer sees is the macro name. A template is checked for basic syntax errors by the compiler when it is first seen, and again later when the code is instantiated. That first step eliminates a lot of confusion since error messages appear at the location of the problem.

Continue reading “Code Craft – Embedding C++: Templates”

Ball Balancing Arduino-Style

If you have a good sense of balance, you can ride a unicycle or get on TV doing tricks with ladders. We don’t know if [Hanna Yatco] has a good sense of balance or not, but we do know her Arduino does. Her build uses the ubiquitous HC-SR04 SONAR sensor and a servo.

This is a great use for a servo since a standard servo motor without modifications only moves through part of a circle, and that’s all that’s needed for this project. A PID algorithm measures the distance to the ball and raises or lowers a beam to try to get the ball to the center.

Continue reading “Ball Balancing Arduino-Style”

Encryption For Arduino With Spritz

Hackaday.io user [Abderraouf] has written an implementation of the new(ish) Spritz cipher and hash for Arduino. While we’re not big enough crypto-nerds to assess the security of the code, it looks like it’s going to be pretty handy.

Spritz itself is a neat cipher. Instead of taking in fixed blocks of data and operating on them, it allows you to process it in (almost) whatever chunks it comes in naturally, and then extract out the encrypted results piecewise. It works both as a two-way cipher and as a one-way hash function. It looks like Spritz is a one-stop-shop for all of your encryption needs, and now you can run it on your Arduino.

In case you are afraid of new implementations of new ciphers (and you should be), Spritz’s pedigree should help to put you at ease: it was developed by [Ron Rivest] to be a successor to his RC4 algorithm, and it incorporates a lot of the lessons learned about that algorithm over the past. This doesn’t exclude subtle flaws in the implementation of the library (no offence, [Abderraouf]!) or your work downstream, but at least the underlying algorithm seems to be the real deal.

[Abderraouf] links it in his writeup, but just for completeness, here’s the Spritz paper (PDF). What crypto libraries do you currently use for Arduino or microcontroller projects? We’ve been fans of XXTEA for ages, but more because it’s simple and small than because it’s secure. Spritz may be simple enough to implement easily, and still more secure. Sweet.

Robot Listens To Commands–Literally

Where you might see a can, [Adam Kumpf] sees a robot. [Adam’s] robot (named [Canny]) doesn’t move around, but it does have expressive eyebrows, multicolored eyes, and a speaker for a mouth. What makes it interesting, though, is the fact that it receives audio commands via the headphones it wears. You can see [Canny] in action in the video below.

The headphones couple audio tones to [Canny’s] microphone using AFSK (audio frequency shift keying). [Canny] uses an opamp to bring the microphone level up and then uses a 567 PLL IC to decode the audio tones. [Adam] selected two clever frequencies for the mark and space (12345 Hz and 9876 Hz). In addition to being numerically entertaining, the frequencies are far enough apart to be easy to detect, pass through the headphones with no problem, and are not harmonically related.

Continue reading “Robot Listens To Commands–Literally”