Portrait

Arduino

Amplifier Update: Touch Part II, Being Tidy and Not Breaking Things on April 16, 2012
  • amplifier
  • diy
  • electronics
  • arduino
How to use the Sparkfun FTDI Breakout with an Arduino Mini on March 4, 2012
  • arduino
  • sparkfun
  • ftdi
Just blew up (literally) two LEDs, burned four resistors, killed an Arduino and shorted something else. Hardware will cut you. on January 24, 2012
  • arduino
  • amplifier
I put in some time last night working on my amplifier project again after I had received all of the remaining ICs and parts I need for the electronics late last year. One of the decisions I made was to have multiple inputs – a default for an Apple TV (or insert media box) and auxiliary (via minijack and Bluetooth) - and therefore a method of switching between the two. I don’t want to have any physical interaction for input switching when the use case is so clear cut. The default input is always the chosen input unless you want to play music from a phone or iPod (through minijack or BT) at which point it will switch automatically by detecting the signal. It should be (and is) smart enough to do this on its own. There is even a delay before switching back to the default input to accommodate song transitions. I was able to modify Rod Elliot’s Signal Detection Circuit, originally designed to toggle power to a subwoofer, to run on a 5V supply by using a LM358N dual op-amp and 2N3904 transistor and changing some of the resistor and cap values. I especially like this circuit because it allows the logic to be contained within a few chips in the analog section and doesn’t need to involve the Arduino or any of the digital components. It toggles the output high when a signal is detected and this goes to a diode OR gate (to be combined with an “active stream” signal from the BT board) and on to a Maxim MAX4616. The Maxim chip is a 4xSPST analog switch that works perfect for this application (toggling between two inputs) because 2 of the switches are normally open and the others normally closed. Also, it’s available in a DIP package that makes it easy to prototype, something that’s hard to find for this type of IC. Next: Solder the BT breakout board, hook it up to the summing op-amp and add it into the mix (so to speak) Solder all of the LEDs and the two drivers to some stripboard to prototype Troubleshoot until my eyes cave in on January 14, 2012
  • arduino
  • max4616
  • amplifier
  • diy
  • bluetooth
  • A1 Amplifier 2012 arduino
    An experimental physical interface.

  • Done: on November 15, 2011
    • diy
    • arduino
    • amplifier
    I finished wiring up the analog audio side of things a few days ago. Now a Burr Brown OPA2134 opamp at unity-gain buffers the incoming audio signal and a PGA2311 provides volume control. I added a Mean Well +/- 5V PSU to power it all and provide the negative rail for the audio chips. I had a huge breakthrough in reliability when I realized that I need to run separate MOSI lines for each chip’s SPI bus. Often you’ll see a data sheet talk about daisy chaining chips and sharing MOSI lines, but this is only for the same kind of chip. The capacitive sensor reports perfect values now. I rewrote the code from scratch to troubleshoot when the sensor was being unreliable and learned some more about how the chips are actually communicating. Wrapping my head around the LEDControl library was a big help. I found a neat function called fscale that is similar to map, but it accepts floating point variables and can curve the result. I used it to manipulate the volume level to be more linear and predictable as the value of the sensor changes. I adapted the volume control code from linux-works on the Arduino forums to use shiftOut instead of the custom function he had written: void PGA_set_volume(byte value) { byte shifted_val = (value << 1); digitalWrite(PGA_CS_PIN, LOW); // assert CS shiftOut(PGA_SDI_PIN, PGA_SCLK_PIN, MSBFIRST, shifted_val); // right value shiftOut(PGA_SDI_PIN, PGA_SCLK_PIN, MSBFIRST, shifted_val); // left value digitalWrite(PGA_CS_PIN, HIGH); // deassert CS } A cadmium sulphide LDR now provides ambient light values to adjust the brightness of the LEDs dynamically in software. The next step is to tie in the 12V PSU with a relay to power an amplifier stage, and I’m considering just purchasing a Tripath-based board. I’ve backed myself into a bit of a corner by purchasing a 12V supply instead of something higher, and I don’t want to try building and soldering a board based on the complex Tripath chips when they’re so inexpensive to purchase pre-assembled. The really hard part that’s coming up will be building the enclosure to meet the expectations I’ve set for it. on June 22, 2011
    • arduino
    • pga2311
    • opa2134
    • preamp
    • amplifier
    That’s a 120V mains plug in a cardboard box and a switching power supply, which I’m happy to report did not cause any fire or death when they were plugged in for the first time. on June 15, 2011
    • DIY
    • Arduino
    • PGA2311
    • amplifier
    • project
    Just when I was planning to assemble the QT1106 breakout board I received from Rachel’s Electronics in Brooklyn I got my SparkFun shipment with the parts for the LED section of my (secret) project this morning. Even better! I bought a Maxim MAX7219 and some super bright white LEDs to power the display of my project, and the capacitive strip and some buttons will be the input. The LEDControl and QT1106 (.zip) Arduino libraries are fairly straightforward to use, and after a little bit of banging my head against the wall wiring it came together nicely. The results with the linear sensor that was provided with the breakout board is a little bit jumpy, even after playing around with the settings. I will have to build a longer one anyways, so in addition to putting some work into more robust code I’ll see if there’s anything to improve in the sensor. Now I’m going to need to order a Burr-Brown PGA2311 and dive into power supplies and analog/digital ground planes for the second and more difficult part of the project. on May 14, 2011
    • arduino
    • project
    • qt1106
    • max7219
    • LED
    • capacitive
    The secret sauce for my next Arduino project: a capacitive touch IC. on May 11, 2011
    • arduino
    • qt1106
    • project
    • touch
    I’m waiting for some more parts to build my bike computer so I figured I should play around with the parts I got with my Arduino. Here I used a potentiometer to control some LEDs. The output from the pot is connected to an analog pin, and each LED is hooked up to a digital pin. Code: int sensorPin = A0; // select the input pin for the potentiometer int sensorValue = 0; // variable to store the value coming from the sensor int mappedValue = 0; void setup() { // declare the LED pins as OUTPUTs: pinMode(2, OUTPUT); pinMode(3, OUTPUT); pinMode(4, OUTPUT); pinMode(5, OUTPUT); Serial.begin(9600); //for testing } void loop() { // read the value from the sensor: sensorValue = analogRead(sensorPin); // map the sensor range (0-1023) to the number of LEDs (4, plus one for off) mappedValue = map(sensorValue, 0, 1023, 0, 4); // for testing Serial.println(sensorValue); Serial.println(mapped); // loop through all of the pins for(int i = 0; i <= 4; i++){ // if a pin is within the mapped sensor value, turn it on if(i < mappedValue){ // +2 because pins 0 and 1 are for serial I/O digitalWrite(i+2, HIGH); // if a pin is outside sensor value, turn it off } else { digitalWrite(i+2, LOW); } } } on April 2, 2011
    • arduino
    I’m finally starting to try out some things on my Arduino after getting back to Edmonton. I want to make a bike computer for when I’m riding on my stationary trainer. Normally I would use my iPhone and Kinetic, but that doesn’t work when you’re not actually moving. I ordered some Hall effect sensors to sense a magnet attached to the rear wheel and figure out speed and distance “travelled”. Hall effect sensors suck, by which I mean I’m too inexperienced to figure out how to make it work effectively. So now I ordered some reed switches and am waiting on those. They require less components than the Hall sensor anyways (the jerks). on March 23, 2011
    • arduino
    • photo
    • biking