Showing posts with label arduino. Show all posts
Showing posts with label arduino. Show all posts

Sunday, May 5, 2013

Bike Bar Lights LED test

Here is as short video that shows a test of LED strips on a bike frame.


I am planning to cover the tubes in a shrink wrapping material to make the project more waterproof.

Wednesday, February 6, 2013

Disco Bike - Radio test

This is a test of a cheap 433Mhz transmitter and reciever from SparkFun electronics. Together they cost only $7 for the pair. I did a test with two arduinos one transmitting data and the other recieving, both outputing over serial to debug. The fidelity seemed pretty good (Although it was only short range ~1m) without an antenna. This video shows a test using the musical output of the computer which is sent to an anolog pin on the arduino. The Arduino reads the voltage and sends a byte to the transmitter. The receiver on the other end then pulls that value in and is SUPPOSED to adjust the brightness of the LEDs accordingly.


Unfortunately, the signal is two noises causing the value to fluctuate wildly. The instability also means that the LEDs are on for a very short period so its difficult to see the lights change their state.




.

Tuesday, January 15, 2013

Arduino Shield - Stepper Driver and Digital Caliper Reader ver.3

This is my 3rd full revision of a board I am making for another project. I thought I should post the schematic/layout incase anyone else finds it useful. I am getting faster at this layout stuff. The first was so painful but I am starting to get the strategy down.


The board uses an H bridge to drive a small stepper motor. The power for the stepper is fed of the Vin pin of the arduino. So to run this you will need a 9-12v power supply feeding into the Arduino barrel jack. I have made capacity for two calipers (To measure X and Y simultaneously).

Design is based on the schematic at http://arduino.cc/en/Reference/StepperBipolarCircuit and the Nerd kit DRO tutorial. http://www.nerdkits.com/videos/digital_calipers_dro/

Check out those sites for backround reading and code.

Check back here later for build photos and my code.

Check back here much later to see the circuit in a useful application.

https://docs.google.com/file/d/0B8_hXvCtBTMMUXVFQWN4RkVTQkE/edit

Monday, January 7, 2013

Adafruit GPS shield

I finished building the Adafruit GPS shield. I did a quick test whilst I commuted back to my flat. The visualisation generator I used is at every trail here:

http://www.everytrail.com/view_trip.php?trip_id=1927731


http://www.gpsvisualizer.com/ is another site that does the same thing.

What I dont like about the module is that you have to take out the SD card to load the data into the computer. It would be great if the data could be accessed throught the serial port. I have started writing some code that allows you to manipulate files on the SD card with some basic menus over serial. However, I am having trouble erasing files. If you have any tips, please let me know.


I also want to add some triggering options to the GPS module. I want to do this to A) reduce power consumption B) reduce data density.

The plan is:
A mode switch allow you to select. 1.trigger mode (push button/external trigger ie camera) 2. Normal mode, sampling at the normal rate. 3. Interval timing timing is set by a potentiometer that allows for logarithmic interval timing. The idea here is to save power where possible.



Friday, September 28, 2012

VU Meter using Adafruits LED strip


I have made a VU meter using an ISP addressable LED strip. The project is made based on the project done by Jeremy Blum. See the video tutorial here. The rest of the his arduino series is excellent.

The electronics I have used are the same. This is a basic amplifier circuit that keeps only the peaks of the sinusoidal audio signal.

The code his tutorial produces gives a piece of code that has the LED change colour depending on the level of the audio output. The colour then moves down the LED strip at a fixed rate.

My code takes the signal level from the audio and converts it into a certain number of illuminated LEDs. Giving a VU meter effect. The code I used, which was barbarically adapted from Jeremy´s is below:


//Basic VU meter by Cameron Stewart http://hackingismakingisengineering.blogspot.com/2012/09/vu-meter-using-adafruits-led-strip.html
//Based on Jeremy Blum´s Design available at http://www.jeremyblum.com/2011/12/25/tutorial-14-for-arduino-holiday-lights-and-sounds/
//SPI Library
#include "SPI.h"
//Include Library for LED strip using Ada fruit´s library
#include
//Analog Audio Input Pins - from OPamp circuit.
int left_channel = 0;
int right_channel = 1;
//Light Control Pins
int light_data = 2;
int light_clk = 3;
//Setup Strip Constants
const int length = 32;
const int half = length;
//Creat strip object from Object Library
LPD8806 strip = LPD8806(length, light_data, light_clk);
//Initialise strip array.
uint32_t strip_array[length];
void setup()
{
  //Start serial for debugging
  Serial.begin(9600);
  //Fill pixel arrays with zeros
  for(int i=0; i  {
    strip_array[i] = 0;
  }
  //Initialize Strip
  strip.begin();
  strip.show();
}
void loop()
{
  //Uncomment this section to open the serial window for debugging
  //Serial.print("left:    ");
  //Serial.print(analogRead(left_channel));
  // Serial.print("right:    ");
  // Serial.println(analogRead(right_channel));
  //Determine power level
  int power = map(analogRead(right_channel), 0, 800, 0, 32);
  Serial.println(power);
  //Original Strand test function that came with the LED strip
  //colorChase(strip.Color(127, 127, 127), 10); // White

  //My new VU function
  uvMeter(strip.Color(127, 127, 127), power); // White
  //Display the new values
  strip.show();
  delay(0);
}
void uvMeter(uint32_t c, int pow) {
  int i;
  // Start by turning all pixels off:
  for(i=0; i // turn on all pixels below the peak level
  for(i=0; i<=pow; i++) strip.setPixelColor(i, c);

  // Display LEDs
  strip.show();
}
void colorChase(uint32_t c, uint8_t wait) {
  int i;
  // Start by turning all pixels off:
  for(i=0; i  // Then display one pixel at a time:
  for(i=0; i    strip.setPixelColor(i, c); // Set new pixel 'on'
    strip.show();              // Refresh LED states
    strip.setPixelColor(i, 0); // Erase pixel, but don't refresh!
    delay(wait);
  }
  strip.show(); // Refresh to turn off last pixel
}

After the first iteration I plan to add a few more features to the code to make the effect a little more tidy. Future improvmentes:

  • Dynamic ranging - to make use of the full LED strip.
  • Double/Triple sampling - to clean up the signal a bit
  • A top cap bar - similar to the effect in modern stereo VU meters
  • Stereo support 
  • Frequency filtering.



Thursday, September 20, 2012

Ada Fruit breadboard power supply

My package finally arrived from adafruit. The first thin I did was build up the breadboard power supply the breadboard in a little project box I have with an arduino. I plan to wire it up so the power supply will power the board when connected or, when using lower currents the board will run of the USB without powering the electronics on the supply circuit.

Any suggestions on how to do this without too much voltage drop??

A couple of negative things I would like to point out are: 
  • There are no holes in the PCB for mounting the device in a housing.
  • The heatsink is not well suited to the circuit layout because it clashes with the voltage regulator and screw terminals.