Posts with «sensor» label

Color-Coded Key Opens Doors, Opportunities

Of all the ways to open up a lock, there are some tried and true methods. Keys, combinations, RFIDs, picks, and explosives have all had their time and place, but now someone else wants to try something new. [Erik] has come up with a lock that opens when it is shown a pattern of colors.

The lock in question uses a set of color coded cards as the “keys”. When the cards are inserted in the lock, a TCS230 color sensor interprets the pattern on the cards and sends the information over to an Arduino Uno. From there, the Arduino can command the physical lock to open if the pattern is a match, although [Erik] is still waiting on the locking mechanism to arrive while he continues to prototype the device.

This is a fairly unique idea with a number of upsides. First, the code can’t be “stolen” from inside a wallet like RFID cards can. (Although if you can take a picture of the card all bets are off.) If you lose your key, you can simply print another one, and the device is able to handle multiple different keys and log the usage of each one. Additionally, no specialized equipment is needed to create the cards, unlike technologies that rely on magnetic strips. Of course, there’s always this classic way of opening doors if you’d rather go old school with your home locks.

Hack a Day 10 Mar 00:00

Optical Tach Addresses the Need for Spindle Speed Control

With CNC machines, getting the best results depends on knowing how fast your tool is moving relative to the workpiece. But entry-level CNC routers don’t often include a spindle tachometer, forcing the operator to basically guess at the speed. This DIY optical spindle tach aims to fix that, and has a few nice construction tips to boot.

The CNC router in question is the popular Sienci, and the 3D-printed brackets for the photodiode and LED are somewhat specific for that machine. But [tmbarbour] has included STL files in his exhaustively detailed write-up, so modifying them to fit another machine should be easy. The sensor hangs down just far enough to watch a reflector on one of the flats of the collet nut; we’d worry about the reflector surviving tool changes, but it’s just a piece of shiny tape that’s easily replaced.  The sensor feeds into a DIO pin on a Nano, and a small OLED display shows a digital readout along with an analog gauge. The display update speed is decent — not too laggy. Impressive build overall, and we like the idea of using a piece of PLA filament as a rivet to hold the diodes into the sensor arm.

Want to measure machine speed but don’t have a 3D printer? No worries — a 2D-printed color-shifting tach can work too.

Hack a Day 28 Jan 09:01

Flying the Friendly Skies with A Hall Effect Joystick

There are plenty of PC joysticks out there, but that didn’t stop [dizekat] from building his own. Most joysticks mechanically potentiometers or encoders to measure position. Only a few high-end models use Hall effect sensors. That’s the route [dizekat] took.

Hall effect sensors are non-contact devices which measure magnetic fields. They can be used to measure the position and orientation of a magnet. That’s exactly how [dizekat] is using a trio of sensors in his design. The core of the joystick is a universal joint from an old R/C car. The center section of the joint (called a spider) has two one millimeter thick disc magnets glued to it. The Hall sensors themselves are mounted in the universal itself. [Dizekat] used a small piece of a chopstick to hold the sensors in position while he found the zero point and glued them in. A third Hall effect sensor is used to measure a throttle stick positioned on the side of the box.

An Arduino micro reads the sensors and converts the analog signal to USB.  The Arduino Joystick Library by [Matthew Heironimus] formats the data into something a PC can understand.

While this is definitely a rough work in progress, we’re excited by how much [dizekat] has accomplished with simple hand tools and glue. You don’t need a 3D printer, laser cutter, and a CNC to pull off an awesome hack!

If you think Hall effect sensors are just for joysticks, you’d be wrong – they work as cameras for imaging magnetic fields too!

Hack a Day 18 Jan 09:00

Automated Chamber Passes Just the Right Gas

It sounds like an overly complicated method a supervillain would use to slowly and painfully eliminate enemies — a chamber with variable oxygen concentration. This automated environmental chamber isn’t for torturing suave MI6 agents, though; rather, it enables cancer research more-or-less on the cheap.

Tasked with building something to let his lab simulate the variable oxygen microenvironments found in some kinds of tumors, [RyanM415] first chose a standard lab incubator as a chamber to mix room air with bottled nitrogen. With a requirement to quickly vary the oxygen concentration from the normal 21% down to zero, he found that the large incubator took far too long to equilibrate, and so he switched to a small acrylic box. Equipped with a mixing fan, the smaller chamber quickly adjusts to setpoints, with an oxygen sensor providing feedback and controlling the gas valves via a pair of Arduinos. It’s quite a contraption, with floating ball flowmeters and stepper-actuated variable gas valves, but the results are impressive. If it weren’t for the $2000 oxygen sensor, [RyanM145] would have brought the whole project in for $500, but at least the lab can use the sensor elsewhere.

Modern biology and chemistry labs are target-rich environments for hacked instrumentation. From DIY incubators to cheap electrophoresis rigs, we’ve got you covered.


Filed under: chemistry hacks

DIY I2C Devices with ATtiny85

[Pawel] has a weather station, and its nerve-center is a Raspberry Pi. He wanted to include a light sensor but the problem is, the Pi doesn’t have a built-in ADC to read the voltage off the light-dependent resistor that he (presumably) had in his junk box. You can, of course, buy I2C ADC chips and modules, but when you’ve already got a microcontroller that has ADC peripherals on board, why bother?

[Pawel] wired up a tremendously simple circuit, downloaded some I2C slave-mode code, and added an LED for good measure. It’s all up on GitHub if you’re interested.

Bright by Day, Dark by Night!

We’re covering this because we rarely see people coding for I2C slave devices. Everyone and their mom uses I2C to connect to sensors, for which the Arduino “Wire” library or “i2c-tools” on the Pi do just fine. But what do you do when you want to make the I2C device? [Pawel]’s project makes use of TinyWireS, a slave-mode SPI and I2C library for AVR ATtiny Arduino projects.

Here, [Pawel] just wanted a light sensor. But if you’re building your own devices, the sky is the limit. What’s the most esoteric I2C sensor that you can imagine? (And is it really the case that we haven’t seen an I2C slave device hack since 2010?)


Filed under: ATtiny Hacks
Hack a Day 07 Nov 09:00

HMC5883L on the GY-80 module

Description

In this tutorial, I will show you how to configure and extract data from the magnetometer (HMC5883L) sensor on the GY-80 10DOF module from ICStation. While there are some very good libraries on the internet which will give you full access to this sensor, I will show you what you need to know without using a library. This means that it may get a bit technical at times, but I will hold your hand along the way and provide explanations as required. I would also recommend that you watch the complete video from start to finish - as the video provides really useful information.


 

HMC5883L Magnetometer Datasheet:

You can find the datasheet for the HMC5883L pretty easily by searching on the internet. Here are a couple of sources:


 

Arduino Libraries

This tutorial does not use any external libraries.
It does use the Wire library for I2C communication.
However, there is no extra download required to access the Wire library.
If you are looking for a library specific for the HMC5883L sensor, then I would recommend one of these:

Like I said - you do not need an HMC5883L library for this tutorial. The libraries above are listed for those who wish to learn more about this particular sensor.

Arduino IDE

The Arduino IDE can be downloaded from the Arduino website. Visit the Arduino IDE download page.

I generally use the ZIP file for Windows and never seem to have any issues.
There are downloads available for all the major operating systems.


 

ARDUINO CODE:

I have created a Gist for the Arduino code to configure and extract data from the HMC5883L sensor. However, I also have a GitHub repository which aims to capture the code for all of the sensors on the GY-80 module. Code for the other sensors will become available in due time. Meanwhile, have a look at the code below for the HMC5883L sensor:

This code will set all axis values to 1000 upon startup. Moving the GY-80 module around will result in a value greater or less than 1000, however, returning the sensor back to it's original position, should result in values very close to 1000 on each axis. I chose to introduce this calibration in order to avoid negative values, and I liked the fact that I could set a heading with values that were easy to remember.
 
The magSetting function was created to easily configure the magnetometer.
Make sure to look at the video and also the datasheet for further information about calibrating the magnetometer.
 
The getReadings function was created to easily retrieve the magnetometer axis data. I chose to use Single measurement mode in this tutorial.


 
 

Hooking it up:

You can communicate with any of the sensors on the GY-80 module using I2C. The HMC5883L magnetometer sensor is no different. You will need four connections between the Arduino UNO and the GY-80 module. Have a look at the diagram below for the connection diagram and table.

Fritzing diagram



 
 

Project pictures












Concluding comments

The HMC5883L sensor on the GY-80 module is quite interesting and works relatively well. There are a number of other sensors on the GY-80 module which can provide complementary positional data. At some point, I plan to come back and explain some of the other sensors on this module, but first I would like to create a real-life project using the magnetometer. So stay tuned. You may want to subscribe to my social networks or to this blog to be notified of that project when I complete it.

I would like to thank ICStation for their collaborative efforts. Their contribution was invaluable to this tutorial's existence.

If you like this page, please do me a favour and show your appreciation :

 
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
I can also be found on Pinterest and Instagram.
Have a look at my videos on my YouTube channel.

             
ScottC 06 Nov 16:20

HMC5883L on the GY-80 module

Description

In this tutorial, I will show you how to configure and extract data from the magnetometer (HMC5883L) sensor on the GY-80 10DOF module from ICStation. While there are some very good libraries on the internet which will give you full access to this sensor, I will show you what you need to know without using a library. This means that it may get a bit technical at times, but I will hold your hand along the way and provide explanations as required. I would also recommend that you watch the complete video from start to finish - as the video provides really useful information.


 

HMC5883L Magnetometer Datasheet:

You can find the datasheet for the HMC5883L pretty easily by searching on the internet. Here are a couple of sources:


 

Arduino Libraries

This tutorial does not use any external libraries.
It does use the Wire library for I2C communication.
However, there is no extra download required to access the Wire library.
If you are looking for a library specific for the HMC5883L sensor, then I would recommend one of these:

Like I said - you do not need an HMC5883L library for this tutorial. The libraries above are listed for those who wish to learn more about this particular sensor.

Arduino IDE

The Arduino IDE can be downloaded from the Arduino website. Visit the Arduino IDE download page.

I generally use the ZIP file for Windows and never seem to have any issues.
There are downloads available for all the major operating systems.


 

ARDUINO CODE:

I have created a Gist for the Arduino code to configure and extract data from the HMC5883L sensor. However, I also have a GitHub repository which aims to capture the code for all of the sensors on the GY-80 module. Code for the other sensors will become available in due time. Meanwhile, have a look at the code below for the HMC5883L sensor:

This code will set all axis values to 1000 upon startup. Moving the GY-80 module around will result in a value greater or less than 1000, however, returning the sensor back to it's original position, should result in values very close to 1000 on each axis. I chose to introduce this calibration in order to avoid negative values, and I liked the fact that I could set a heading with values that were easy to remember.
 
The magSetting function was created to easily configure the magnetometer.
Make sure to look at the video and also the datasheet for further information about calibrating the magnetometer.
 
The getReadings function was created to easily retrieve the magnetometer axis data. I chose to use Single measurement mode in this tutorial.


 
 

Hooking it up:

You can communicate with any of the sensors on the GY-80 module using I2C. The HMC5883L magnetometer sensor is no different. You will need four connections between the Arduino UNO and the GY-80 module. Have a look at the diagram below for the connection diagram and table.

Fritzing diagram



 
 

Project pictures












Concluding comments

The HMC5883L sensor on the GY-80 module is quite interesting and works relatively well. There are a number of other sensors on the GY-80 module which can provide complementary positional data. At some point, I plan to come back and explain some of the other sensors on this module, but first I would like to create a real-life project using the magnetometer. So stay tuned. You may want to subscribe to my social networks or to this blog to be notified of that project when I complete it.

I would like to thank ICStation for their collaborative efforts. Their contribution was invaluable to this tutorial's existence.

If you like this page, please do me a favour and show your appreciation :

 
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
I can also be found on Pinterest and Instagram.
Have a look at my videos on my YouTube channel.

             
ScottC 06 Nov 16:20

Otto - build you own robot in two hours!

Primary image

What does it do?

Otto walks, dances, makes sounds and avoids obstacles, is completely open source, Arduino compatible, 3D printable, and with a social impact mission to create an inclusive environment for all kids.

Otto was inspired by another robot instructable BoB the BiPed and programmed using code from another open source biped robot called Zowi.

CC-BY-SA

Otto's differences are in the assembled size (11cm x 7cm x12cm), cleaner integration of components and expressions.

Cost to build

$49, 00

Embedded video

Finished project

Complete

Number

Time to build

2 hours

Type

URL to more information

Weight

250 grams

read more

360 Degree proximity sensor

A DIY Seizure Alarm based on Arduino Micro

Chad Herbert’s son Daniel was diagnosed with Benign Rolandic Epilepsy in 2014. It’s a type of epilepsy the Epilepsy Foundation says accounts for about 15 percent of all Epilepsies in children and the good news is that most children grow out of it.

The bad news is that Daniel’s most affected by his condition at night or early morning while he sleeps. That’s why Chad invested in a sleep monitor/alarm for his bed that detects when he’s having a full tonic-clonic seizure.

At the same time though, he decided to work on a DIY version of a seizure alarm  running on Arduino Micro. The starting point was Arduino’s “Knock” example project with the sketch code originally created in 2007 by David Cuartielles and modified by Tom Igoe in 2011:

While shopping around for the exact type of monitor/alarm my wife and I wanted, I found out a few things:

  • They are hard to find. I believe the one we ended up with was manufactured by a company in Great Britain.
  • They are expensive. The one we ended up getting cost in the $400-$500 range.
  • The one we have isn’t totally cumbersome, but it’s not easy to pack up and take with you somewhere.

Figuring these things out, I decided to search for a way to build a simple seizure alam that’s both relatively inexpensive and easy to transport. I’m sure there are people out there who have children that suffer from seizures that simply cannot afford equipment such as this even though they truly need it. Thanks to the folks in the Arduino community, I was able to accomplish both things I was setting out to do.

Discover how it was made on his blog.