Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
MiNDRiVE
Nov 8, 2012

n0tqu1tesane posted:

I did look at LEDs, but I did this before I got into and really understood stuff like Arduinos. I also realized the same things about LEDs, you've got to have a lot of them, and the color can be a bit harsh with white LEDs. The lightbulb is a lot more warm yellow/Orange and sunrise like than a single color led setup would be. You can also tweak the total brightness of the light by changing the wattage of the bulb.

Of course, I might end up having to scrap it and go with an LED setup eventually as incandescent bulb availability goes away...

Have you thought about diffusing the light from the leds?

Adbot
ADBOT LOVES YOU

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer

MiNDRiVE posted:

Have you thought about diffusing the light from the leds?

I was talking more about the color temperature of the light produced, not so much about the individual points of light that LEDs create.

Bad Munki
Nov 4, 2008

We're all mad here.


You can get warm-colored white LEDs same as you can get cool-colored incandescent bulbs. :) Alternately, adjust the color with a gel. OR, get RGB LEDs and pick your color exactly.

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
I would probably do that now, but at the time building the programmable dimmer kit was about the extent of my capabilities. Hell, I should probably bust open the project box and redo a few of my solder joints.

Now? An Arduino, a couple meters of RGB LED strip off ebay for $15, and a couple mosfets.

MiNDRiVE
Nov 8, 2012
A strip of 2700k led's should do the trick.

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
This article is pretty timely: http://makezine.com/video/sunrise-alarm-clock/

MiNDRiVE
Nov 8, 2012

I think i'm going to build one of these. My 2 cell phones and 2 alarm clocks just don't wake me up anymore. Hopefully the blinding light will do the trick. I'll post pictures here in a bit after i get it all setup on perfboard. Going to use 12v superflux led's because its all I have available at the moment. =)

TwystNeko
Dec 25, 2004

*ya~~wn*
Okay, so I've just gotten into Arduino stuff. I've made an LED cube (4x4x4), and I'm currently working on a 24x8 matrix. I was planning to use ShiftPWM, but I'm entirely lost at this point.

the columns are run by 3 daisy chained 74hc595s, with a 4th running the rows. There's this "ShiftMatrixPWM" library, but... it kind of doesn't work. The hardware all works, when tested manually.

Any suggestions? I'd like to do fancy animations, perhaps fed through serial.

Edit: Meh, I've somehow hosed up the control board I made. The LEDs are fine, but I'll have to remake the board. I suspect it's just the transistor board, so maybe not TOO bad.

TwystNeko fucked around with this message at 02:01 on Aug 30, 2013

Sagebrush
Feb 26, 2012

In the future you may consider something like an I2C port expander: http://www.digikey.com/product-sear...d=0&pageSize=25

Uses only the two I2c ports and gives you 16 I/Os for each chip. Several chips can share the same I2C bus as well. Probably the best way to get lots and lots of outputs with minimal additional hardware.

e: I'm not sure how fast you could turn those all on and off though...something to consider.

TwystNeko
Dec 25, 2004

*ya~~wn*
well, my next forays into arduino stuff are going to be with WS2811 LEDs. I have 100 of them coming, so lots of stuff I can do. :D

ShiftPWM seems to be pretty awesome for shift register stuff.

The biggest problem is that I have 2 electronic component shops in town, and neither of them carry more than a bare minimum of ICs - I had to mail-order the 74HC595s I have. So just switching gears to a new chip isn't viable, when I have to wait upwards of 2 weeks to get something.

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
Adafruit also makes these 24 channel PWM expansion breakouts that use SPI:

http://www.adafruit.com/products/1429

A bit pricey if you're looking at that many LEDs though.

EDIT: And this 16 channel one that uses i2c

http://www.adafruit.com/products/815

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five

n0tqu1tesane posted:

Adafruit also makes these 24 channel PWM expansion breakouts that use SPI:

http://www.adafruit.com/products/1429

A bit pricey if you're looking at that many LEDs though.

EDIT: And this 16 channel one that uses i2c

http://www.adafruit.com/products/815

I actually just bought the 16 channel one. After spending over 8 hours trying to etch boards with a 28-TSSOP connection (tip: toner transfer isn't really fine enough to handle that) I finally gave up and decided I'd grab a break-out board to test out the chip. Tuesday should be fun after it arrives. :toot:

Bad Munki
Nov 4, 2008

We're all mad here.


TwystNeko posted:

well, my next forays into arduino stuff are going to be with WS2811 LEDs. I have 100 of them coming, so lots of stuff I can do. :D

ShiftPWM seems to be pretty awesome for shift register stuff.

The biggest problem is that I have 2 electronic component shops in town, and neither of them carry more than a bare minimum of ICs - I had to mail-order the 74HC595s I have. So just switching gears to a new chip isn't viable, when I have to wait upwards of 2 weeks to get something.

Two weeks? Where on earth are you, Antarctica?

Digikey and Mouser are both really good at shipping. Digikey in particular is spooky good at shipping. If you're in the midwest, you'll order something in the afternoon, have it shipped by USPS, and it'll show up the next morning. I'm pretty sure that if I hand-delivered an envelope to my local post office with my own address on it, it wouldn't arrive that fast. Anyhow, even if you're on one of the coasts, you're only looking at a few days.

TwystNeko
Dec 25, 2004

*ya~~wn*
well, for starters, I'm in Canada. So customs can add anywhere from 1 to 3 days. And since I buy from Ebay, a lot of stuff is in China and Hong Kong. Cheap as hell, but takes forever. Example: those 100 LEDs? $20. But I won't see them until mid-september. Oh well.

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
Here's the Arduino controlled LED light thing I've been working on recently:

https://www.youtube.com/watch?v=fleFgcl8dNo

Here's the description from the video, which explains everything pretty well:

quote:

Arduino controlling an analog 5050 RGB LED strip, using one button and one pot for manual control, and a MSGEQ7 to input the audio. Controller has 7 modes, which are cycled through by pressing the one button.

1) Audio visualization. Uses audio input from a headphone jack to change the value of the red, green and blue LEDs based upon low, mid, and high EQ values.
2) Solid color. (2:25) Uses pot to cycle through colors, varying RGB values based upon position.
3) Pulse. (2:47) Pulses last color chosen during setting 2, at a speed based upon pot position.
4) Color cycle. (3:12) Automatically cycles between red, green, and blue, and all the colors in between. Speed of cycle is based upon pot position.
5) Random color cycle. (3:35) "Random" values of RGB are chosen, then transitioned to.
6) Campfire mode. (3:53) Color and flicker programmed to simulate campfire. I still think it's a little too orange, but still tweaking.
7) White. (4:05) Sets red, green and blue to the same value to generate "white" light. Brightness is set by pot position.
8) Off. (4:22) All LEDs set to zero.

Once the button is pushed again, the controller cycles back to the first option.

Will post the code and schematic later.

It's going to go into a rolling sound system a coworker has made out of an Igloo Ice Cube cooler. He's upgraded the wheels to 10" pneumatic tires, has a 12v battery from a riding lawnmower and small automotive amp inside.



I've just got to figure out what I'm going to do for an enclosure, move everything to a PCB, and get it installed.

Here's a poorly done fritzing diagram for those interested:

Econosaurus
Sep 22, 2008

Successfully predicted nine of the last five recessions


I want to build one of these more than anything. Is this an incredibly complicated project or would a dumbed down version be feasible?

Sagebrush
Feb 26, 2012

That project is mostly mechanical in nature; the electrical and software stuff is pretty simple in comparison. If you can build the sliding carriage and the systems to open and close the liquor bottles, you're 80% there.

Phelan
Dec 23, 2004

Econosaurus posted:

I want to build one of these more than anything. Is this an incredibly complicated project or would a dumbed down version be feasible?

I've been looking at building something like this too but I can't decide on a way to pump the liquids that I really like. Pressurising the bottles of coke etc. does really seem to be the easiest way to go unless anyone else has any ideas?

saint gerald
Apr 17, 2003

Phelan posted:

I've been looking at building something like this too but I can't decide on a way to pump the liquids that I really like. Pressurising the bottles of coke etc. does really seem to be the easiest way to go unless anyone else has any ideas?

Those are optic dispensers.



The clear chamber fills with liquid by gravity, and when you push a glass upwards on that three-armed assembly, the liquid drains downwards in a convenient pre-measured quantity. Not sure how that would work with carbonated liquids, I've never tried. If the pressure interferes I'd suggest a siphon assembly for those with an electrically operated valve on the end.

Delta-Wye
Sep 29, 2005

saint gerald posted:

Those are optic dispensers.



The clear chamber fills with liquid by gravity, and when you push a glass upwards on that three-armed assembly, the liquid drains downwards in a convenient pre-measured quantity. Not sure how that would work with carbonated liquids, I've never tried. If the pressure interferes I'd suggest a siphon assembly for those with an electrically operated valve on the end.

Holy poo poo those are perfect. However, that item and ones like it only seem to be sold in the UK. It must be a requirement/popular in bars there, I don't know.

As an American though, finding something for sale on the internet that isn't available in my country is weird, to say the least.

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
I have never seen them individually for sale in the US though, but I've seen quite a few of these 4 bottle dispensers for sale.

Delta-Wye
Sep 29, 2005
I always assumed you twisted the handle on those. :ms: Thanks!

TwystNeko
Dec 25, 2004

*ya~~wn*
So my WS2812 LEDs arrived, and man, they are awesome. Simple to hook up, and easy to use.

I decided, for part of my halloween costume, I was going to do the LED Ampli-Tie project. The tie's all wired up, and the LEDs look amazing. But I need to figure out an alternate circuit for the electret mic. As I said before, I don't have much for components locally. Plus I'm kinda broke at the moment. :ohdear:

Anyways, I've found a one-transistor mic preamp schematic. I breadboarded everything, and.. it doesn't seem to pick up much of anything. I actually have 2 electret mics. One I salvaged from a cheap-rear end computer headset, and another I got when I foolishly bought a Cana-Kit for a sound-activated LED kit, hoping I could use parts. Any suggestions? I mainly want a low cost sound level detector.

On-hand I have a bunch of transistors in NPN and PNP types, a few capacitors, and a bunch of assorted resistors.

a_pineapple
Dec 23, 2005


I'm prototyping a MIDI controller using Teensy++ 2.0. The sketches make extensive use of the usbMIDI library. After the prototyping is finished, I want to port it over to to an ATmega328, like on the Arduino Uno, because DIYing Arduino on the 328 is very well documented.

Will it be possible to use the Teensy usbMIDI libraries with an ATmega328? If not, is there a better solution that doesn't involve DIYing a Teensy?
edit: because i want class compliant usb midi!

Also, if I used a 14 or 16 bit ADC chip, would it be feasible to expect a 14-bit value (for hi res midi) from the average potentiometer, or should I stick to rotary encoders for nice smooth digital stuff?
(is this even necessary? Like do MIDI devices that say they are 14-bit actually use the full 14 bits of data, or are they just tricky with encoders?)

Thanks in advance... These questions are the last two roadblocks to getting this project off the breadboard!

a_pineapple fucked around with this message at 01:56 on Sep 15, 2013

MiNDRiVE
Nov 8, 2012

vas0line posted:

I'm prototyping a MIDI controller using Teensy++ 2.0. The sketches make extensive use of the usbMIDI library. After the prototyping is finished, I want to port it over to to an ATmega328, like on the Arduino Uno, because DIYing Arduino on the 328 is very well documented.

Will it be possible to use the Teensy usbMIDI libraries with an ATmega328? If not, is there a better solution that doesn't involve DIYing a Teensy?
edit: because i want class compliant usb midi!

Also, if I used a 14 or 16 bit ADC chip, would it be feasible to expect a 14-bit value (for hi res midi) from the average potentiometer, or should I stick to rotary encoders for nice smooth digital stuff?
(is this even necessary? Like do MIDI devices that say they are 14-bit actually use the full 14 bits of data, or are they just tricky with encoders?)

Thanks in advance... These questions are the last two roadblocks to getting this project off the breadboard!

I would imagine that the Teensy usbMIDI libs should work on a 328. The Teensy 2.0 is using the same chip as the leonardo so you should be good there. As for the other questions maybe someone else can chime in?

Aurium
Oct 10, 2010

vas0line posted:

I'm prototyping a MIDI controller using Teensy++ 2.0. The sketches make extensive use of the usbMIDI library. After the prototyping is finished, I want to port it over to to an ATmega328, like on the Arduino Uno, because DIYing Arduino on the 328 is very well documented.

Will it be possible to use the Teensy usbMIDI libraries with an ATmega328? If not, is there a better solution that doesn't involve DIYing a Teensy?
edit: because i want class compliant usb midi!

Also, if I used a 14 or 16 bit ADC chip, would it be feasible to expect a 14-bit value (for hi res midi) from the average potentiometer, or should I stick to rotary encoders for nice smooth digital stuff?
(is this even necessary? Like do MIDI devices that say they are 14-bit actually use the full 14 bits of data, or are they just tricky with encoders?)

Thanks in advance... These questions are the last two roadblocks to getting this project off the breadboard!

The teensy implements USB on the same chip as your program runs on. The programs on a Uno run on a 328 and uses a separate chip for USB.

Considering all of the teensy's have native usb, I very much suspect that the teensy libraries were built to take advantage of the native usb, which the 328 would not have.

If you really wanted to diy a 328 based one, there are midi'd drivers for the FTDI chip used on the older arduinos. I don't know how compliant they are, my short bit of research seems to indicate not very, but I'm no expert here. If you want to use same separate programmable chip that does usb midi like on the Uno, well, its basically the same chip as the teensy, and thus you're basically doing the same amount of work as diying a teensy anyway.

The other thing is that to move from a teensy with native midi to a 328 + usb converter could possibly be a pretty substantial architectural change in how your program is setup. But I can only guess here.

There is also a soft USB implementation for avrs, including the 328 (v-usb). There doesn't appear to be an official midi flavor, but their projects page includes a few people that seem to have developed midi capabilities. This would also probably be a large change in architecture for you.

I'd recommend an encoder. Potentiometers are finicky to set precisely, and at 14 bits and 0-5v you're talking .3mV per bit. May consider a ten turn pot as well. Or test it out and see how it sounds. I don't actually know how many of those bits midi actually uses.

poverty goat
Feb 15, 2004



If I connect the arduino to usb and a battery at the same time, is it smart enough to only use the battery when there is no power coming from the usb? If not, is there a shield that does this? I just want a battery backup to keep it from dying on me since the power tends to flicker here whenever the wind blows. I've seen some rechargeable Li-ion shields that look pretty nifty but they seem to run $30+ and that's overkill since I have no need for it to run for extended periods off of the battery like in a solar powered setup; it just needs to keep it alive for a few seconds/minutes here and there.

poverty goat fucked around with this message at 00:19 on Sep 28, 2013

Sagebrush
Feb 26, 2012

I believe the Arduino will selectively choose the battery power over the USB power if both are available, actually. So it handles that situation but not in the way you want.

Someone correct me if I'm wrong, though -- I'm not completely sure of this.

Aurium
Oct 10, 2010

Sagebrush posted:

I believe the Arduino will selectively choose the battery power over the USB power if both are available, actually. So it handles that situation but not in the way you want.

Someone correct me if I'm wrong, though -- I'm not completely sure of this.

This is correct. If power is plugged into the barrel jack or to the vin pin a fet turns off to block power going to or from the usb jack.

TwystNeko
Dec 25, 2004

*ya~~wn*
So I've been working on my Daft Punk helmet, and I've got a couple of simple animations written for the LEDs. I'm running them using the FastSPI_LED library, so it's pretty simple to drive them.

example: https://www.youtube.com/watch?v=W66NiNSlpM0

I'm looking for more animations to do - it's basically 2 columns of 16 pixels. Most of my code is written for one column (leds 0-15), and I can mirror it pretty simply.

I'd like to have a fake Vu-Meter, and I found a water drop animation, but it really fucks with my head to try and make it a single function - each animation is a self-contained function in my code, and this is using classes and stuff. It's also written for a completely different library, as well. Here's the code: https://github.com/DannyHavenith/ws2811/blob/master/src/water_torture.hpp

Can anyone help me with either of these? Or with interesting patterns? :)

Bad Munki
Nov 4, 2008

We're all mad here.


Just to check: you're using fastspi 2, right? It's a pretty major upgrade from the original fastspi library and is better in every way. If you poke around in the header files, there are a whole host of incredibly useful functions. Notably, the hsv->rgb (and reverse) converters. They're highly optimized for the 'duino, and allow you to trivially work in hsv color space instead of rgb, which will net you very vibrant, full-saturation colors without doing any funny math. That is, keep your saturation at full, your value/brightness at full, and just change the hue.

Your water droplet code you found looks interesting, but it's basically a rudimentary particle system that is non-deterministic, and I'm just going to hazard a guess that your current displays and design is deterministic. You'd probably be better served just cooking up a similar pattern in a deterministic way.

As for other interesting patterns:

marching dashes would be good, maybe have them opposite on each side, so that where there's a dash on one side, there's a blank on the other, and vice versa. Then have them march up or down or in opposite directions.

random sparkle? Like randomly colored glitter fritzing along the stripes.

A simple medium-speed strobe of all the lights (that maybe changes color slowly?)

If you post your arduino code, I'd happily plug in one of my strips and play with making some more patterns if you'd like. :)

TwystNeko
Dec 25, 2004

*ya~~wn*
Yea, I'm using FastSPI 2, and it's pretty easy to use. Here's the current code, it's pretty messy. I yoinked a lot of the code from here: http://funkboxing.com/wordpress/?p=1761 - the utility functions, which I'm slowly weeding out.

http://pastebin.com/FSBfVpGK

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer

TwystNeko posted:

I'd like to have a fake Vu-Meter,

Why do fake? Get a MSGEQ7, they can be had for $2 or so on ebay, and using them is pretty simple.

http://nuewire.com/info-archive/msgeq7-by-j-skoba/

TwystNeko
Dec 25, 2004

*ya~~wn*
well, I actually DID pick up one of the AdaFruit mic breakout boards, and had that hooked up. I was using the code from their Ampli-Tie project, but it was being really janky - not responding at times, or picking up stuff when it shouldn't, and I couldn't get it working the way I wanted it to, as a "module" for my helmet. So I figured I'd just disconnect it and fake it. :downs:

But faking it is harder than it seems at first glance - just picking random values doesn't really look good. It's like the drop pattern - I tried making a fake semi-random version, and it just looked like crap. A lot of the issue is that I'm basically working with 16 pixels. it's a 32-pixel strip, but divided in half. And not even a real one, it's hand-soldered.

I have added a couple more patterns, and cleaned the code up just a bit: http://pastebin.com/aHzY6rGy

I rather like the simpleWave function, and the drops function could use a rework, it doesn't look as good as I hoped.

TwystNeko fucked around with this message at 09:10 on Oct 2, 2013

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
The MSGEQ7 actually creates a much better effect than just trying to FFT a microphone on an analog pin. Plus, you can use it to target only a particular frequency range of audio.

TwystNeko
Dec 25, 2004

*ya~~wn*
I can believe that. Sadly, between moving and shipping times, it'll be really tight if I order it now, since this is for my halloween costume. :3: I might take another stab at using the mic I have (this one: http://www.adafruit.com/products/1063), and seeing if I can revamp the code again. I don't think it's using FFT, anyways: http://learn.adafruit.com/led-ampli-tie/the-code

I did find an actual FFT library - and something called the Fast Hartley Transform. Might be something to play with.

Edit: I just remembered I have a scratch-built blue LED matrix that's 24x8, and a second arduino. If I trim down the lovely soldering job I did on the back to make it slimmer, I could add that inside the mask too, and just run a constant FFT on it. I might cut it down to 16x8, just for visibility.

TwystNeko fucked around with this message at 20:20 on Oct 2, 2013

n0tqu1tesane
May 7, 2003

She was rubbing her ass all over my hands. They don't just do that for everyone.
Grimey Drawer
I've got 10 MSGEQ7s that should be getting here next week. If they actually do come in, you're welcome to one for the cost of shipping, and it should make it to you before Halloween. You could even use your mic breakout with it.

Delta-Wye
Sep 29, 2005

TwystNeko posted:

I can believe that. Sadly, between moving and shipping times, it'll be really tight if I order it now, since this is for my halloween costume. :3: I might take another stab at using the mic I have (this one: http://www.adafruit.com/products/1063), and seeing if I can revamp the code again. I don't think it's using FFT, anyways: http://learn.adafruit.com/led-ampli-tie/the-code

I did find an actual FFT library - and something called the Fast Hartley Transform. Might be something to play with.

Edit: I just remembered I have a scratch-built blue LED matrix that's 24x8, and a second arduino. If I trim down the lovely soldering job I did on the back to make it slimmer, I could add that inside the mask too, and just run a constant FFT on it. I might cut it down to 16x8, just for visibility.

Are you using the Arduino's analogread function to feed data into your FFT (or FHT)? Keep in mind that max sample rate is 10khz or so, and I believe that is with the arduino doing nothing but sampling as fast as possible. If you have frequencies in the mix that are >5Khz, roughly speaking, the output of your frequency transforms are going to be hosed thanks to aliasing. Is there a low pass filter before you read it? For doing a VU meter, to be honest, you can probably get away with a cutoff less than 1KHz and a sample rate as low as 3 or 4KHz as you are mostly just trying to do beat tracking with two channels anyways.

EDIT: Beat detection may be a bit easier than doing frequency work by hand. Have you looked into it? A MSGEQ7s makes frequency analysis vary manageable but I would probably give up without it. Arduinos aren't well suited for audio work imho, but tracking zero crossings and trying to figure out an average shouldn't be as bad.

Bad Munki
Nov 4, 2008

We're all mad here.


Anyone know if using the serial rx/tx pins (2, 3) on an atmega328 will interfere with also using the SPI pins (16, 17, 18, 19)? Pretty sure it won't but I wondered if anyone knew for sure. Not in a position to physically test it, but I'd still like to work on a design. :)

Adbot
ADBOT LOVES YOU

TwystNeko
Dec 25, 2004

*ya~~wn*
I haven't gotten around to doing anything with the analogread function or FHT/FFT yet. I'm trying to get my matrix working. I'm trying to use a MAX7219 to control it, but it's not working at all. I've got it hooked up as per the datasheet and what it says on the arduino site, but all I get is all LEDS on, except the ones on row 2. I've redone all the connections twice now, and no dice. I wonder if I've shorted out the chip.. but I've never given it more than 5v, and it's rated for 6v.

Any ideas? I'd really just like a 16x8 blue matrix in the helmet. I suspect I may just have to use more of the RGB leds to make a grid. I have 50 of them left.

Edit: I now have all LEDS on. Still, not what it should be doing.

TwystNeko fucked around with this message at 04:32 on Oct 4, 2013

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply