Archive | Arduino

Arduino Christmas Lights

With the recent purchase of an Arduino microcontroller, my interest in electronics was rekindled after many years hiatus. One of my goals back in the day was to create a colour organ where lghts would flash in beat with the music. With the Arduino, I can easily do that and much more, so I set about coming up with a project that made use of modern day LED’s. The result will be Christmas lights that:

Continue Reading →

Continue Reading

Arduino & Bluetooth

Was playing with an HC-06 Bluetooth board today:

http://www.aliexpress.com/store/product/HC-06-Bluetooth-serial-pass-through-module-wireless-serial-communication-from-machine-Wireless-HC06-for-arduino/318950_630840325.html

Was able to successfully pair with this from my phone and send commands via a Bluetooth terminal on the phone to the Arduino, although I found the communications very difficult to maintain. Here’s my brief review of IR vs Bluetooth communications:
Continue Reading →

Continue Reading

Costing a FastLED Display Locally

Here’s an approximate cost breakdown if I were to head into some local electronics stores to purchase components for my portable displays:

Miscellaneous items include zip tie, solder, a few sizes of heat shrink tubing.

Then there’s my labour at a minimum of $40/hr and it takes about 45 minutes to build one.

Oh, did I mention all the time I spent learning/developing the coding and techniques?

Continue Reading

Arduino Resources

References

  • http://vancouverroboticsclub.org

Suppliers

  • http://www.seeedstudio.com
  • http://arduino-direct.com
  • http://www.makershed.com
  • http://www.adafruit.com
  • http://www.sparkfun.com
  • http://www.robotshop.com (Canada)
  • http://www.rpelectronics.com (Vancouver)
  • http://www.mainelectronics.com (Vancouver)

Continue Reading →

Continue Reading

Infrared Circuit

Before integrating all of the circuits, let’s demonstrate the IR receiver circuit.

Get a Universal Remote and program/test it until you see output from the debugger of the Arduino. It seems to work well with the Universal Remote programmed as a Sony controller.

IR test code:


//
// Universal remote decoder example for Arduino
//
// This simple program reads/decodes the output of a Universal Remote and displays the value.
//
// The IRremote.h library was referenced and downloaded from these locations:
//
// http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
// http://www.pjrc.com/teensy/td_libs_IRremote.html
//
// I used a universal remote, and programmed it until the software recognized the output.
// It was an Innovage Jumbo Universal Remote and programmed it as Sony 004.
//
// I also used a 3 pin KSM-603LM Optic receiver module where:
//
// pin 1 -> pin 7 of Arduino, pin 2 -> GND, pin 3 Vcc
//

#include

int RECV_PIN = 7; // A nice out of the way pin to connect the receiver to
IRrecv irrecv(RECV_PIN); // Initialize which pin we are receiving on
decode_results results; // Define the variable for storing 'results'

unsigned long oldmillis = 0; // Use my own delay to add a little debouncing

void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}

void loop() {
if (irrecv.decode(&results)) { // If there is a result . .
if (millis() - oldmillis > 300) { // Debounce for 300ms
Serial.println(results.value, HEX); // Print the value
oldmillis = millis(); // Reset the delay timer
}
irrecv.resume(); // Receive the next value
}
}

Continue Reading

Arduino Color Organ

The Color Organ used the MSGEQ7 graphic equalizer chip. Information on using it came from http://nuewire.com/info-archive/msgeq7-by-j-skoba/

I found that rather than blast the output values to the LED’s, it would be better to set ranges of values and light up the LED’s from that range.


int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 4; // reset is attached to digital pin 4
int spectrumValue[7]; // to hold a2d values

void setup()
{
Serial.begin(9600);
pinMode(analogPin, INPUT);
pinMode(strobePin, OUTPUT);
pinMode(resetPin, OUTPUT);
analogReference(DEFAULT);

digitalWrite(resetPin, LOW);
digitalWrite(strobePin, HIGH);

}

void loop()
{
digitalWrite(resetPin, HIGH);
digitalWrite(resetPin, LOW);

for (int i = 0; i < 7; i++)
{
digitalWrite(strobePin, LOW);
delayMicroseconds(30); // to allow the output to settle
spectrumValue[i] = analogRead(analogPin);

if (spectrumValue[i] < 65) {
analogWrite(pwm[i], 1023);
Serial.print(” “);
Serial.print(“0”);
} else if (spectrumValue[i] < 80) {
analogWrite(pwm[i], 1022);
Serial.print(” “);
Serial.print(“1”);
} else if (spectrumValue[i] < 100) {
analogWrite(pwm[i], 1021);
Serial.print(” “);
Serial.print(“2”);
} else if (spectrumValue[i] < 200) {
analogWrite(pwm[i], 1020);
Serial.print(” “);
Serial.print(“3”);
} else {
analogWrite(pwm[i], 1015);
Serial.print(” “);
Serial.print(“4”);
}

}
digitalWrite(strobePin, HIGH);
Serial.println();
}

Continue Reading