Friday, October 19, 2012

Lap Timer Build Along Part 4 - Adding the IR Detector

The final part of the lap timer build along is also the easiest part, involving only the IR Detector and an optional LED with current limiting resistors.

The previous steps can be found in the project index section of RC Arduino -
http://rcarduino.blogspot.com/p/project-index.html

A good introduction to IR Detectors is provided on the Ada Fruit website here -

http://learn.adafruit.com/ir-sensor

To start our build we need a small section of strip board and a set of three wires for power, ground and IR Out.

These can be soldered to the strip board so each leg of the IR Detector is connected through the copper strips of the strip board to one strand of the cable. In the picture I have used a section of ribbon cable, the cable should be long enough to suite your application, for example long enough to mount the detector on the steering column support of your Kart and allow you to attach the main unit to the steering wheel - don't make the cable longer than necessary it will only get in the way and may pick up interference.

Notice that the IR Detector is facing away from the connecting wires and that there is room for some additional components between the detector and the connecting wires, this is to allow us to add an indicator ID.

Reverse Side View

Next we add a 10K current limiting resistor between the output of the IR Detector and the wire we will be connecting to our Arduino interrupt pin.

For this resistor to have any effect we need to cut the copper track underneath the resistor so that the current has to pass through the resistor, a 3mm or 3.5mm drill bit will do this nicely.

Reverse view showing the cut in the copper track beneath the 10K resistor

Next we need to add the current limiting resistor for our indicator LED, I am using 560, but anything from 500 to 800 Ohms should be fine. This resistor connects from the row with the VCC Pin of the detector to the row below the Vout pin. From here we can also add two short lengths of connecting wire for our indicator LED, on wire should come from the VOut track and another from the track below VOut where we have just added the resistor.

This is to allow use to add an indicator LED which will light whenever the unit receives an IR Signal, this is useful as it will let you know if there is environmental interference such as reflected sunlight or fluorescent lighting.

At this point you should have the following circuit -
You can now add an indicator LED of whatever colour will be most visible in your application. To connect the LED, the long leg should be connected to the length of wire which is soldered to the same row as the 560 Ohm resistor, the shorted leg should be connected to same the same row as the Vout pin of the IR Detector.

You can test this set up immediately by connecting 4 to 6 volts to the circuit, the positive voltage should be applied to the top row, the ground should be connected to the middle row. If you use a TV Remote or the Transponder from part 3 of the build along, you should see the LED Light, if not, try swapping the LED around incase it was soldered in reverse.

This is essentially the same circuit as shown in the Lady Ada tutorial -

http://learn.adafruit.com/ir-sensor/testing-an-ir-sensor

Assuming that you have tested your detector correctly, we can now connect it to the Lap Timer.

To do this we need to connect the Vcc wire (top pin/wire in the picture assuming the detector is facing away from the connecting wires) to the 5V supply of the Arduino. Next we need to connect the center wire to the ground of the Arduino. Finally connect the bottom wire to digital pin 2 of your Arduino.

Congratulations, you have now finished the electronics however to be able to use the lap timer you need to build a small enclosure for the detector, without this sunlight and many type of indoor lighting will saturate your detector so that it is unable to detect signals. As I am based in Dubai where the sun is always fierce I have gone as far as spraying the inside of my enclosure with ultra matt camouflage paint. You can see the enclosures I have used in the following clips of the timer in action, not that the indicator LED is on the outside of the enclosure where we can see it - you knew that already right ?

Build Along Lap Timer in action complete with IR Detector as built in this post


I have recently added a few extensions to the project including a count down mode and support for external audio, you can see the new menu options and see them in action at the track in the following two clips -


New Menu Options
At the track with external audio enabled


The external audio option uses an LM386 based amplifier to drive external speakers. You can use this IC to add big sound to any Arduino project, here is a link to the circuit as used in the Lap Timer -

http://rcarduino.blogspot.com/2012/08/adding-audio-to-arduino-projects.html

If you would like the latest code, contact me through the arduino forum for a zip file containing the full project.

Future Developments - I am considering adding support for three additional transponder types -

1) Magnetic - I am told that many Kart Tracks use a magnetic strip under the track which lapping Karts detect using a window sensor such as you would use for home security.
2) Commercial Beacons - The commercial beacons used at many auto racing tracks use a well know pattern of pulses, it would make sense to support this pattern allowing users to 'arrive and drive' without having to place your own transponder around the track.
3) User selected pulse length - Allow the user to choose a pulse length, this would allow two or three systems to be used alongside each other. All of the calculations needed to build your own unique transponder are linked in previous parts of build along.

Stay tuned.

Duane B

Saturday, October 13, 2012

Algorithmic Music Visualizer

This is a short follow up to a previous post 'Algorithmic Music On Arduino'

http://rcarduino.blogspot.com/2012/09/algorithmic-music-on-arduino.html

The music generation algorithms take advantage of the repeating structure within binary numbers, an obvious development is a visualizer that would reveal some of the structure within the music.

This quick project uses the value of the algorithm output to drive the sound and visuals directly. The visualizer is simply a scrolling buffer of the 8 most recent output values.


While it would be possible to use FFT to visualize the music, in the case of algorithmic music it is more interesting to use the visualizer as a means to explore what is happening within the algorithm rather than in the frequency spectrum.



The short video shows that even with no additional processing, the visuals are very different for each of the algorithms and reveal some of the structure within the music.

The first algorithm running from 0:11 to 0:38 produces a cascade effect reminiscent of the matrix - unfortunately this effect is subtle and needs development for the best effect. The second section of the video provides a more obvious demonstration of how the sound is being developed within the algorithm.

Some other ideas to explore in the future -

1) Bit rate - for each bit in the 8 bit output, increment a counter if it has changed from the last sample. Use the values for the 8-bits to drive the display

2) Divide by 2 - Use the current output for row 0, update row 1 every second output, row 2 every fourth output, row 3 every 8 etc upto 128

For now, here is a scrolling buffer of the 8 most recent output values (and a little reaction from the family)


Duane B

Wednesday, October 10, 2012

New Arduino Products and Video Tutorials

UK Based electronics supplier RS-Online have added a new Arduino section to the home page of thier site.

Clicking on the links will take you to this section with an overview of the new starter kit, some video demonstrations and datasheets.

These are the 15 projects included in the new official Arduino starter kit -

01 GET TO KNOW YOUR OWN TOOL an introduction to the concepts you'll need to use this kit
02 SPACESHIP INTERFACE design to control panel for your starship
03 LOVE-O-METER measure how hot-blooded you are
04 COLOR MIXING LAMP produce any color with a lamp that uses light as an input
05 MOOD CUE clue people in to how you're doing
06 LIGHT THERIM create a musical instrument you play by waving your hands
07 KEYBOARD INSTRUMENT play music and make some noise with this keyboard
08 DIGITAL HOURGLASS a light-up hourglass that can stop you from working too much
09 MOTORIZED PINWHEEL a color wheel that will have your head spinning
10 ZOETROPE create a mechanical animation you can play forward or reverse
11 CRYSTAL BALL a mystical tour to answer all your tough question
12 KNOCK LOCK tap out the secret code to open the door
13 TOUCHY-FEEL LAMP a lamp that responds to your touch
14 TWEAK THE ARDUINO LOGO control your personal computer from your Arduino
15 HACKING BUTTONS create a master control for all your devices!

More information including the video tutorials can be found here -

http://uk.rs-online.com/web/generalDisplay.html?id=arduino

Arduino Due

While the site does not mention the upcoming Arduino Due, there is a 'stay tuned for Arduino' email notification which you can subscribe to in the link above. If RS have any marketting sense I am sure they will use this mailing list to announce the availability of Due or pre orders.

So if you are UK based Stay Tuned.

UPDATE: The Arduino team have started a new thread on the Arduino forum for the newly released started kit - http://arduino.cc/forum/index.php/topic,125444.0/topicseen.html


Duane B