Posts with «arduino hacks» label

A Tweeting Litter Box

How can you not be interested in a project that uses load cells, Bluetooth, a Raspberry Pi, and Twitter. Even for those of our readers without a cat, [Scott's] tweeting litter box is worth the read.

Each aspect of this project can be re-purposed for almost any application. The inexpensive load cells, which available from eBay and other retailers, is used to sense when a cat is inside the litter box. Typically sensors like the load cell (that contain a strain gauge) this use a Wheatstone bridge, which is very important for maximizing the sensitivity of resistive sensor. The output then goes to a HX711, which is an ADC specifically built for load cells. A simple alternative would be using an instrumentation amplifier and the built-in ADC of the Arduino. Now, the magic happens. The weight reading is transmitted via an HC-06 Bluetooth module to a Raspberry Pi. Using a simple Perl script, the excreted weight, duration, and the cat’s resulting body weight is then tweeted!

Very nice work! This is a well thought out project that we could see being expanded to recognize the difference between multiple cats (or any other animal that goes inside).


Filed under: Arduino Hacks, Raspberry Pi, wireless hacks

Bare Bones Arduino IR Receiver

Old infrared remote controls can be a great way to interface with your projects. One of [AnalysIR's] latest blog posts goes over the simplest way to create an Arduino based IR receiver, making it easier than ever to put that old remote to good use.

Due to the popularity of their first IR receiver post, the silver bullet IR receiver, [AnalysIR] decided to write a quick post about using IR on the Arduino. The part list consists of one Arduino, two resistors, and one IR emitter. That’s right, an emitter. When an LED (IR or otherwise) is reverse biased it can act as a light sensor. The main difference when using this method is that the IR signal is not inverted as it would normally be when using a more common modulated IR receiver module. All of the Arduino code you need to get up and running is also provided. The main limitation when using this configuration, is that the remote control needs to be very close to the IR emitter in order for it to receive the signal.

What will you control with your old TV remote? It would be interesting to see this circuit hooked up so that a single IR emitter can act both as a transmitter and a receiver. Go ahead and give it a try, then let us know how it went!


Filed under: Arduino Hacks

Art-O-Matic Is Spirograph’s Young Hip Offspring

Some of our more senior experienced readers may remember a toy called the Spirograph. In case you don’t, it’s a geometric shape drawing toy. The way it works is a plastic disc with gear teeth around the perimeter and various holes on its face is spun around a plastic ring with gear teeth on the inside. A pencil is inserted in one of the holes in the disc and, when spun around the inside of the ring, draws different complex shapes called hypotrochoids.

This was fun enough to keep a kid entertained for a few minutes. It took a while to make a complete shape and sometimes it was easy to mess up (especially if the hole chosen for the pencil was near the outside of the disc). [Darcy] thought it would be neat to combine the Spirograph’s drawing style with modern technology. The result is called the Art-O-Matic and it draws some pretty wild art, you guessed it, automatically.

Click past the break for more!

[Darcy] started the project by drawing all the gears and linkages in Sketchup. A CNC Router was used to cut out the parts, after that just a few bolts and nuts got the mechanics together. In the video below there are 2 geared discs that move the linkage arms. Both arms move independently, one quickly and the other slowly. Each disc is controlled by its own stepper motor. The speed of each stepper motor is controlled by an Arduino. Different patterns are drawn depending on the speeds of the two motors. Switching pen colors along the way adds to the coolness.

 


Filed under: Arduino Hacks

The Lightgame Project: A Multiplayer Arduino Game

Summer is upon us. The Lightgame Project is a multiplayer reaction time based game built around the Arduino. It’s a perfect rainy day project for those restless kids (and adults!). Designed by two undergraduate students [Efstathios] and [Thodoris] for a semester long project, all the hard work has already been done for you.

There are tons of reasons we love games that you can build yourself. For one, it’s an amazing way to get children interested in hobby electronics, making, and hacking. Especially when they can play the game with (and show off to) their friends. Another reason is that it is a perfect way to share your project with friends and family, showcasing what you have been learning. The game is based on your reaction time and whether or not you press your button when another players color is shown. The project is built around two Arduinos connected via I2C. The master handles the mechanics of the game, while the slave handles the TFT LCD and playing music through a buzzer.

I2C is a great communication protocol to be familiar with and this is a great project to give it a try. [Efstathios] and [Thodoris] did a great job writing up their post, plus they included all the code and schematics needed to build your own. It would be great to see more university professors foster open source hardware and software with their students. A special thanks goes out to [Dr. Dasygenis] for submitting his student’s work to us!


Filed under: Arduino Hacks
Hack a Day 29 May 03:00

Using State Machines In Your Projects

 

[Tony] has developed a method of using a state machine to validate keypad inputs. His method checks the commands character by character as they are entered in by a 16 button keypad. State machines are often used to break down complex problems into sequential tasks, making code development easier. While [Tony's] example uses the keypad, Arduino Uno, and a character LCD, the theory can be applied to numerous projects, such as this Dahlander motor switch.

As you see, state machines can be very versatile. Stick around after the break as we take a look at [Tony's] state machine and provide a brief explanation of how it all works. 

The goal is to ensure a command is entered in to a system correctly – in this case it is being validated character by character with each key press. A state machine is used to achieve this goal. The command is:

 

XX@HH:MM#
Where:
XX = 1-99
HH = 0-24
MM = 00-59
# = Execute

 

Each value is considered a state. When the value is entered, it moves to the next state. So:

 

 

Be sure to check out [Tony's] project for more details and learn how he implements the above state machine in code.

 


Filed under: Arduino Hacks
Hack a Day 27 May 21:00

Arduino Garage Door Opener is Security Minded

Do it yourself garage door openers must be all the rage nowadays. We just got word of another take on this popular idea. [Giles] was commissioned by his friend to find a way to control the friend’s garage door using a smart phone. The request was understandable, considering the costly garage door remote and the fact that the buttons on the expensive remote tended to fail after a while. The inspiration for this project came from some YouTube videos of other similar projects. Those projects all paired an Arduino with a Bluetooth headset in order to control the door from a mobile phone. [Giles] understood that while this would get the job done, it wouldn’t be very secure. Bluetooth headsets typically connect to mobile phones using a four digit PIN. Many of them have known default PINs and even if the default is changed, it wouldn’t take very long to guess a four digit PIN. [Giles] knew he had to find a more secure way.

While WiFi was an option, [Giles] decided that having the garage door hooked up to the internet would likely be a security risk, even if it did offer some potential interesting use cases.  He therefore opted to stick with Bluetooth, but decided to use the Seedstudio Bluetooth shield instead of a basic headset. The electronics are relatively simple. [Giles] simply plugged the Bluetooth shield into an Arduino Uno. [Giles] did have one problem with the Bluetooth shield though. The Bluetooth module did not accept many standard AT commands. He needed a way to force a disconnect of a mobile device if it failed authentication. After digging around, he discovered that the module had some extra exposed pads that he could likely use to accomplish that goal. The only problem was that they were expecting a 3.3V signal, and the Arduino works at 5V. The solution was simple. He setup a basic voltage divider using two resistors. This lowered the 5V signal from the Arduino to the required 3.3V. This provides the communication functionality to the mobile phone. He then realized that he could use a simple 12V automotive relay to control the garage door. To control the relay, he used the Freetronics relay control shield. The end result is a relatively simple stack of shields hooked up to a relay.

For the smart phone interface, [Giles] started out by trying to write a native Android application. Having little experience in Android development, he soon realized that it was going to take him longer than anticipated to get anything usable this way. He then decided to use SL4A. SL4A provides a scripting environment for Android and supports several different scripting languages. [Giles] was then able to write a Python script that can be executed on the smart phone. Many people would be tempted to write a really simple script that would just open the door and connect without any real thought about security. After all, this is a one-off obscure garage door opener. Security through obscurity! [Giles] is smarter than that.

He instead implemented a challenge handshake authentication mechanism between the Python script and the Arduino. This would ensure that users are authenticated before permitting commands to be executed, and also help prevent replay attacks. The process works like this. First the smart phone connects to the Arduino. The Arduino then generates a pseudo-random string and calculates the expected response, based on a pre-shared key. The phone then receives the string and sends back the appropriate response. If it doesn’t match, the Arduino disconnects the phone. If it does match, the phone then sends back a request for a different pseudo-random command challenge string. Once the phone receives this new string, it is able to use that string in conjunction with a second pre-shared key to generate a one-time use command. Assuming it was calculated correctly, the Arduino will then run the command to open or close the door. If it doesn’t match the phone gets disconnected. All of this is to help prevent replay attacks. Any attacker watching the airwaves would not be able to simply record the signals or commands and play them back. This is because every time the authentication and commands are transmitted, they must be different based on the pseudo-random seed.

While everything seems to work mostly fine, the Arduino tends to crash after about six door cycles. [Giles] believes this may be caused by the MD5 library he is using but has so far been unsuccessful in trying to fix this bug. He also thinks his Python script is messy and somewhat unstable. He’s decided to publish his programs to the internet in hopes that someone else may have the time and drive to figure out what’s going on.


Filed under: Arduino Hacks

This Sassy Art Installation is Like The Stanley Parable for the Telephone

Imagine this. A phone on a nearby desk starts ringing. No one is around to pick it up, so you decide that you will be a good Samaritan and answer the phone. You are greeted by a slightly creepy robotic female voice asking you to complete a simple survey. Having nothing else to do, you go ahead and run through the telephone survey. As you start answering the questions, things start to get a bit… weird. The robot voice doesn’t like your answers. She actually disagrees with you, and she does NOT like being interrupted. Now she’s getting sassy with you! What is going on here?

Most likely you are the latest victim of Insert Customer Feedback Here, [Charles'] art installation. You see, that is no ordinary telephone. [Charles] actually removed the guts of an old telephone and replaced them with an Arduino. The Arduino periodically rings the phone, waiting for someone to answer. Once the phone is off the hook, the Arduino uses a Wave shield to start playing back the scripted audio files. All of the text-to-speech files and the various hold music files are played back with the wave shield. The Arduino is also hooked up to the 1, 2, 3, and # keys of the telephone keypad in order to read back the user’s responses.

From here on out the program acts as a sort of “choose your own adventure” game. The program takes different paths and responds in different ways depending on how the user answers the questions. Generally speaking, it will get more “irritated” towards the user if it doesn’t “like” your answers, otherwise it will get less irritated. The hold music will even change to become more or less aggressive.

It’s easy to draw comparisons to Portal’s GLaDOS due to the robotic female voice and to the narrator from The Stanley Parable for the “choose your own adventure” feeling. In fact, if GLaDOS and The Stanley Parable had offspring, this would surely be it. This project brings that same type of silly sarcastic humor to a different medium and it does it well. Be sure to watch the video of the system in action below. It really starts to get interesting around the 1:15 mark.


Filed under: Arduino Hacks

Introducing The Arduino Zero

The Arduino Uno is the old standby of the Arduino world, with the Arduino Due picking up where the Mega left off. The Arduino Tre is a pretty cool piece of kit combining a Linux system with the Arduino pinout. Care to take a guess at what the next Arduino board will be called? The Arduino Zero, obviously.

The Arduino Zero uses an Atmel ARM Cortex-M0+ for 256kB of Flash and 32k of RAM. The board supports Atmel’s Embedded Debugger, finally giving the smaller Arduino boards debugging support.

The chip powering the Zero features six communications modules, configurable as a UART, I2C, or SPI. USB device and host are also implemented on the chip, but there’s no word in the official word if USB host will be available. There are two USB connectors on the board, though.

The Arduino folk will be demoing the Zero at the Bay Area Maker Faire this weekend. Hackaday will have boots on the ground there, so we’ll try to get a more detailed report including pricing and availability then.


Filed under: Arduino Hacks
Hack a Day 15 May 16:00

Programming Micros With Impossibly Cheap Bluetooth Adapters

[Zenios] and [Raivis] are building a small balancing robot, and for communications to the outside world, they’re using a small, extremely cheap Bluetooth adapter. They figured uploading code to the microcontroller over Bluetooth would be a good idea, but their adapter, a cheap HC-06 module, had no way of resetting the microcontroller; it just provided Tx and Rx the serial port. They did notice a LED blinked when a device wasn’t connected to the adapter, so with a simple circuit they kludged a reset circuit where it wasn’t intended.

The small LED on the HC-06 module blinks when nothing is connected, and remains on when a connection is established. Figuring a new connection would be a good time to upload new code, the guys needed to design a circuit that would stay low when the LED was blinking, and switch to high when the LED was on.

A simple RC filter took care of the blinking LED, keeping the line low until a device connected. Bringing the logic level high when the LED stayed solid required digging through a part drawer, eventually finding an LM741 p differential amplifier.

After a few small changes to the bootloader, the guys had a reliable means of flashing new firmware without the need of programming adapters or wires draped over their workspace, all with a Bluetooth adapter that shouldn’t have this capability. Video below.


Filed under: Arduino Hacks

Upgrade Your Garage Door with Arduino and RFID

[Jason] really wanted to build an RFID controlled garage door opener and decided to turn to Arduino to get the job done. For someone who’s never worked with an Arduino before, he really seemed to know what he was doing.

The Arduino acts as the brains of the operation while an off-the-shelf NFC/RFID reader module is used to read the RFID tags. To add new keys to the system, [Jason] simply swipes his “master” RFID key. An indicator LED lights up and a piezo speaker beeps, letting you know that the system is ready to read a new key. Once the new key is read, the address is stored on an EEPROM. From that point forward the new key is permitted to activate the system.

Whenever a valid key is swiped, the Arduino triggers a relay which can then be used to control just about anything. In this case, [Jason] plans to use it to control his garage door. The system also has a few manual controls. First is the reset button. If this button is held down for two seconds, all of the keys from the EEPROM are erased. This button would obviously only be available to people who are already inside the garage. There is also a DIP switch that allows the user to select how long the relay circuit should remain open. This is configurable in increments of 100ms.

For now the circuit is wired up on a couple of breadboards, but it might be a good idea to use something more permanent. [Jason] could always take it a step further and learn to etch his own PCB’s. Or he could even design a board in Eagle CAD and order a real printed board. Don’t miss the video description of the RFID system below.

[via Reddit]


Filed under: Arduino Hacks