Friday, June 26, 2015

RGB Strip LED

For my sound level project I am considering using inexpensive RGB Strip LEDs.  So to try some code out I did a trial from this Adafruit post:
https://learn.adafruit.com/rgb-led-strips/overview

The differences are:

* used Adafruit's circuit for the TIP120 except except that I used 5mm LEDs to stand in for the strip (also put a resistor in front of each LED so it wouldn't burn out)
* used Adafruit's sketch except I substituted pins 11, 12, and 13 for the Arduino PWM (used a MSP430G2553)
* used a 4.5V battery pack for external power to the LEDs

It is working:



For my project I am thinking I'll need at least 2 strips running 2 different colors so 6 TIP120s.  I only have 5.  Even better would be to have 3 strips and 3 colors - then I'll have the added complication of not enough PWM pins.  It looks like there is another order in my future.

Wednesday, June 24, 2015

Sound Level

A sound level sensor I'm working on....  The mic on a breakout is a MAX4466 from Adafruit.


Friday, June 19, 2015

Rainfall Gauge using Hall Sensor

This is one I was working on a while back but have put on hold.  I have a working prototype so will post it anyway - maybe it will inspire me to finish it up.  Find photos below and preliminary code here at github.


The sensor works by collecting rain in the funnel as shown in the top photographs.  The funnel has a known diameter and thus area.

The rain then collects in the rocking mechanism in the middle photograph.  The pivot point for the mechanism is better seen in the top photo.  The volume collected can be calibrated by moving the adjustment screws up and down. The hall sensor is the device that has been attached with yellow wire.  It is opposite the South pole of a small round magnet in the middle photo.

When the tipping mechanism fills it tips as shown in the bottom photo. The hall sensor loses contact with the magnet and reports the change to the MSP430F5529 microcontroller.  The water then drains out the bottom of the sensor through holes.

The sensor works and appears to be accurate and repeatable.  I have not kept it in service long enough to comment on how reliable it might ultimately be.  I need to go back and clean up the design a bit and incorporate it into the larger weather station vision I have.

Credit to msuzuki77, the Lazy Old Geek
http://www.instructables.com/id/Arduino-Weather-Station-Part3-Rain/
for the inspiration for my version


Tuesday, June 16, 2015

Vibration Sensors SW-18015P and SW-18020P

There is a post on how to use these simple vibration sensors with a LaunchPad here on github.  They act like open switches that close momentarily when shaken or bumped.  I got mine at Addicore.

Saturday, June 13, 2015

Addicore 20 x 4 Serial LCD using I2C and Addicore Bi-Directional Level Converter

This post uses the same Addicore 20x4 Serial LCD that I used in this post.  However, this time I used an Addicore Level Converter instead of creating a circuit.  The Level Converter is easy to use, reasonably priced, and has 4 channels should you need them.  I've also posted an I2C library with it that was obtained from the DFRobot.com site.  The library, example code, and circuit are located here on github.  The example demonstrates how to define special characters and also simple animation.



 I tested the sketch with the F5529, CC3200, and the MSP432P410R.  It should work with a 2 line LCD as well but I haven't tried that since I don't have one with I2C.


Monday, June 8, 2015

Sharp GP1S53VJ000F PhotoInterrupter

I recently got a Sharp GP1S53VJ000F photointerrupter from Mouser and successfully tested it with a Texas Instruments EXP-430F5529 LaunchPad with Energia and on an Arduino Uno.    It should work with most LaunchPads using Energia.  Non-transparent objects passing through the "slot" are detected.

The sensor consists of an infrared LED emitter and a phototransistor detector opposite each other in a case.  When the transmission between them is blocked the digital pin will go high.  The sketch will then send a message to the serial monitor.

When tested it gave a very reliable response, even in bright sunlight with the sensor unshielded.

The circuit and sketch can be found here at Github.

Friday, June 5, 2015

HC-SR04 Ultrasonic Distance Sensor

Here's a simple sketch that shows how to use the HC-SR04 ultrasonic distance sensor.  I bought this one from Addicore.  They are inexpensive and work well for what they are, especially for the cost.  They are easy to get going and fun to play with.  The code is here on Github.

Here it is, measuring the distance from my laptop to the wall...

Tuesday, June 2, 2015

CNY70 Tachometer

Here are some photographs of a CNY70 Reflective Optical Sensor mounted on a little board for use as a tachometer.

 In the photograph below the reflector can be seen.  It is simply a piece of white paper glued to the fan rotor.
 Here it is with the MSP-EXP430F5529 spitting out RPM values to the serial monitor.  I've turned the fan off and it is slowing down.


The code and schematic can be found here on Github.  It includes a discussion of how the sensor works and modifying it to work on an Arduino Uno.