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
TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Here's an arduino-ish project I've started:

I heard about the Teasmade from a MetaFilter post. It's a British alarm clock that also makes tea, but it's a real pain to convert to US circuits because heating elements draw a lot more current than your typical travel adapter puts out.

So I've decided to try to make my own out of a $10 coffee pot. It's kludgy, unfinished, and might not be that great, but I really wanted to try building something.

Here's a video of the first run, with some goony, awkward, unscripted narration. Guess who never has taken a public speaking course. Jump to 5:30 for the actual draining the tea. I'd edit it, but :effort:.

https://www.youtube.com/watch?v=ZgNdF-RVViQ

In the final version, I plan to add an alarm clock mechanism using an outlet timer (I really don't want to have to make my own interface for the alarm clock, and I already have one handy), and a radio tuner or buzzer or something that turns on when the tea is done.

Here's some photos of it, without the servo.

I have a piezo buzzer, so it'd be easy to make it make noise, but I kind of want to do something more ambitious, such as randomly playing something interesting to wake me up, like a "This I Believe" segment from NPR. I guess I could do that with an MP3 shield or one of those cheap iPod Shuffle clones you find for $10 on Ebay/Deal Extreme.

I'm also thinking about a relay so I can shut down the heating element sooner, although the cup did not warm up at all during the brewing process.

This is my first time working with servos. I probably messed something up, or am doing something horribly wrong. :doh: It's mounted on with pieces from an old Erector set.

And for the final version, I'll use a perf-board with an Atmega soldered on, or maybe even an ATTiny (although I'd have to use C and registers), so I can use the Teensy for other projects.

Thanks, goons, for recommending the Teensy. It's really a lot easier than juggling wires between the Arduino and a breadboard. Considering I don't have any shields to use with either my Arduino or the Teensy, I really don't miss that feature.

Adbot
ADBOT LOVES YOU

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Sh4 posted:

Also I would need a bunch of relays, are the arduino outputs able to drive relays ?

Not directly. Mechanical relays have two problems for the arduino: They draw more power than the pin can deliver, and they can send back a jolt of current when they switch. This is bad, as either of those things can hurt the pin, or even the whole processor. So, you build a circuit that uses the arduino's pin to switch a transistor, which then draws current from the 5V rail (capable of more amps than the arduino's pin). And a diode prevents that charge from hurting anything.

See the schematic on this page for a description of a circuit for this.

What do you need the relay for, exactly? I'm not questioning your decision, I'm just curious. Are they components from a car that need a 12V battery?

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Is anyone using the new Due version? I was intrigued, until the Raspberry Pi started catching up with demand and I got a new toy. :3:

Admittedly, that's not ideal for beginners, as it's a departure from the AVR chips and uses 3.3v logic as opposed to other Arduino boards using 5v.

If there were an easier way to hook the teensy chips up to shields, I'd recommend that, as I tend to reach for it since it fits on a breadboard. It'd probably be trivial to design a PCB that links the teensy to shields, though. Maybe it does exist...

TVarmy fucked around with this message at 11:22 on Jan 31, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

bobsacks posted:

They sell Arduino at RadioShack? I haven't been in one of those in a decade - creepy lookin guy behind the counter. You know the dude was some kind of serious perv.

Yep, along with shields and decent component kits now, too. They're starting to improve.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Am I the only person who doesn't like using shields? I'd rather just use discrete components so that if I want to keep the project, I can solder everything to a perfboard and use a bare Atmega to control everything.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

huhu posted:

Decided what better way to spent Saturday night then to get out the Arduino. :science: Made a dimmer that goes through the full range of the RGB colors. Was rather confusing to setup because I used PWM pins as grounds so all the values were inverted so that 0 was high and 255 was low. Any suggestions for another way to do this?

View My Video

You could do 255 - value you'd use if it were 255 = high, I think.

This could be a total brain fart, though. I'm a write and test, then check kind of coder.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

huhu posted:

Following along with this question. If you do something like plug in a 9V battery into a battery clip and then let the wires accidentally fall onto the board and create a current could that cause the Arduino to fail? Also, could using a center positive, 12V/1A output wall wart into the Arduino cause it to fail? Somehow I believe I hosed my board up and those are the two things I think might have caused it to fail.

A reverse power supply is not such a big deal, as there is a diode to stop current from flowing backwards.

The 9V battery could be problematic, though.

If you have a DIP (dual inline pin) socket Arduino with a chip inside a socket, like this:



You can replace the ATMega328 chip with one that comes with the arduino bootloader, or burn the bootloader on a bare one using another Arduino or AVR programmer. Adafruit and Sparkfun sell the ATMega 328s pre-programmed. They're actually quite cheap, as the ATMegas are mass-produced for commercial purposes, and can be bought from sites like Digikey for about $4. This is part of why Arduinos replaced hobbyist microcontrollers like the BASICStamp so handily, because aside from being about 1/4 the cost for the whole board, the "brains" of the board could be replaced cheaply and easily. This meant hobbyists could experiment and do things outside their comfort zone, as if they killed the chip, say by doing something that overloads an IO pin with too much current like driving a motor, they would only be out $6 instead of $130 (The price BASIC Stamps were when I took a robotics class in high school).

When replacing the chip, or taking it out for whatever reason, carefully pry it out gently, alternating sides. I like to use an eyeglasses screwdriver. The pins bend really easily if you aren't careful.

However, if your Arduino looks like this (unlikely, these were only sold for a short period at the same price as the other Arduino solely due to a brief chip shortage, and it was a while ago now):



Your chip is soldered on very finely to the board using a smaller package than what is typically used on this generation of arduinos (SMD). As the chip is surface mount, it's not possible to replace without good solder skills and a quality solder station. If I saw this type for sale, I'd avoid it. I've never burnt out an ATMega, but I don't want to be out $30 if it does happen.

I'm assuming you have an Arduino Uno. I think the Arduino Mega is only SMD, and the Arduino Leo and Due come in chips that don't come in DIP, IIRC.

TVarmy fucked around with this message at 02:13 on Feb 16, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

ANIME AKBAR posted:

http://www.seekway.com.cn/e/3D/ledsys28.htm

I think they're up to 64x32x32, fully tricolor.

I wonder how many arduinos they use??

It says something about an "sd card controller," but I'm guessing you could probably manage a decent refresh rate still with a ton of cascading shift registers and one arduino and a bunch of jumper wires, assuming you splice out the "SD card controller."

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

The Teensy and Digisparks are cool if you're interested in either a smaller/cheaper footprint, which is great for certain projects.

Get some mosfets and an led light strip roll for big led projects.

If you're interested in controlling an appliance, say a rice cooker for sous vide cooking, a relay kit or solid state relay is nice. Be careful of mains power, though. And never plug the Arduino into a bare mechanical relay, as it takes too much power, and if it does switch, when it turns off, it can send a jolt that fries can fry the board.

A raspberry pi is kind of a peripheral, in the way that a tall wags a dog, but the two boards work really well together, and it really simplifies stuff like hosting a server that works with physical input/output, logging data, tweeting, processing images from a camera, etc. Just send the Arduino commands from python or c over serial.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Delta-Wye posted:

I think switching to an ATTiny will require a heavy rewrite of the code because he is relying on the Arduino framework for a lot of stuff.

Digisparks and a few forks of Arduino for the ATiny exist, so it wouldn't be ASM or c minus the Arduino code necessarily, but the savings are minimal, and it opens the door for a lot of headaches, and you'll have to check what features are supported.

It's about $1-2 vs $3-5 per chip, if I recall digikey's prices right.

TVarmy fucked around with this message at 22:06 on Mar 27, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

I'm hoping to make a circuit that detects claps with an electret microphone. Do I just need a good reference voltage for the threshold volume and an op amp wired as a comparator to get the result on a digital pin on the arduino, or do I need to also work in amplification?

Also, how can I measure the voltages I can expect from the electret microphone without an oscilloscope? I can't figure it out from the data sheet or Google.

I'm using the one from sparkfun, at http://www.sparkfun.com/products/8635

EDIT: Reading around, it sounds like I might actually want the amplitude of the signal coming off of it, so the comparator might be the last thing I want? And instead I should be amplifying it and taking the sum divided by the number of samples of the absolute value of the inputs or something like that?

TVarmy fucked around with this message at 16:58 on May 8, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Sagebrush posted:

I picked up some Teensys and a miniature OLED screen for a project I'm working on. Runs great:



:laffo:

Man, I really wish more Arduinos and Arduino clones/accessories would embrace the Teensy form factor. It's so much easier to breadboard with than to have one board to the side with a bunch of jumper wires going to a separate breadboard, just waiting for you to nudge it loose. Protoshields with breadboards don't count, as they are tiny.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

You can go even cheaper if you don't need color by buying LED light strips of one color from amazon.

Control them from the arduino by wiring in a 12 volt power supply and a mosfet.

You can get a really bright spot by mounting the cut strips on a square surface and soldering the strips together.

To make timing really simple, figure out a good wakeup duration for fading in the lights with PWM, and plug in the power supply and arduino to an outlet timer from a hardware store set for when you want the lights to begin, and have it run the routine on powering up. It'd be trivial to add on a piezo speaker to add a buzz after the routine is over if you still aren't up. The arduino clock should be okay for waking you up over 20 minutes - 2 hours. It just wouldn't keep good time over days.

EDIT: Considering you'll need the LED, mosfet and power supply at least, you're probably out about $30. The timer outlets are a really common gadget, so I'm not factoring that in, but I guess you can add $5 if you don't have it.

TVarmy fucked around with this message at 21:05 on Aug 8, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

I have an idea for a project that would essentially call for asking an Arduino or similar microcontroller to accept a tone as input.

In other words, recognition of multiple single tones, from a flute, recorder or ocarina. Preferably, it would detect 8 tones.

I saw guides for the 567 tone decoder, but it seems to only detect one tone at a time based on how the circuit is hardwired. I could build 8 variations of the circuit and feed that into the Arduino chip, but I was hoping to fit this into a relatively small space. However, I've been looking into trying SMD soldering, and a small circuit using the SOIC package might work.

But I was wondering if there was a way to do this in software or with an integrated circuit that could detect multiple tones from one package? I see a lot of DTMF tone detection packages, but I don't really get if they can detect arbitrary tones other than the phone system's tones.

Based on a quick google search, some sites say you can kind of do this in software with an FFT library for the Arduino, but people report that it's slow, and often people get mad in the threads and say that FFT is not the optimal way to detect tones.

I'm also open to checking out other microcontrollers for this project if there are any that are better suited for audio processing. Preferably, it'd be one that has an arduino-style library for it so I don't have to learn some platform specific ASM or C libraries. I tried programming AVR chips from straight C, and while it was great for learning how to use timers and interrupts, it also took me a while to get things working.

To be clearer, I don't need the output from the tone detection to be complicated. I just want a simple binary test for if the tone is playing or not.

TVarmy fucked around with this message at 19:56 on Oct 13, 2013

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Bad Munki posted:

Teensyduino is killer, for what it's worth.

Teensy is great, if you don't need shields. I find myself using my teensy more than a "real" arduino because it fits nicely on a breadboard, but if you find yourself looking at guides that use shields, get an Uno.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

SquadronROE posted:

I talked with a few people about Arduino/Raspberry Pi/Beaglebone yesterday, and finally got some good ideas for projects that I could use the arduino for. Looking forward to going down this rabbit hole, but I'm really not sure what exact board I should start with (more than likely the Uno).

Basically the idea I want to pursue is using the Arduino as a way to take temperature samples in a house (multiple rooms), average them and display them on a very simple website. I could use this to see how effective heating/AC is overall throughout the day.

Would the Uno let me plug 4-5 temperature sensors and a wi-fi board into it, and store temperature from 5 rooms taken at 30 minute intervals throughout the day? That's only something like 3600 samples, so maybe 7 kilobytes of data each day for just storing the text?

I think I'm understanding that right...

Temperature sensors would be pretty easy. There's a lot of ways to do that, with ones that work via serial, i2c, or analog output, all of which are really easy to read on an arduino. With shift registers, pins are no issue for analog pins, and i2c is designed to work with multiple sensors on a few shared pins.

Wifi is where it gets harder. You could get a yun that has built in wifi, or get a wifi shield, but it's surprisingly expensive because the arduino doesn't have enough processing to handle much networking without another processor to handle it (so all the shields that are any good have another processor for wifi). You might be better off hooking up the arduino to a raspberry pi with a USB wifi dongle, or running the whole thing off a raspberry pi or beaglebone (it also has support for i2c). Or you could plug the arduino into an always-on PC and have it handle the networked stuff. PC-arduino communication is pretty easy.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Adafruit also has 15% off everything, and they also are offering free shipping above $75 and some free goodies for large orders, such as a free Raspberry Pi on orders over $250. The freebies aren't groundbreaking deals, but they're nice if you had a big project in mind that needed a lot of components. And 15% off is pretty awesome regardless of the other stuff.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Worst case, I guess you could desolder the female headers and solder on a new block? You'd want to be careful about solder bridges, though.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

I've not done sleep mode recently, but the arduino docs seem to say you want to use attachInterrupt(0... instead of 1 for using pin 2 as the interrupt pin. 1 should map to pin 3.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

If you want sample code and guides, amp meters hooked up to a pwm pin seem to be the most common solution to making an arduino dashboard. But I like the servo idea better. It probably comes down to whatever is easier to attach to the existing meters.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

I think you're missing the libraries it needs?

Here's a list from the source code:

code:
// PID Library
#include <PID_v1.h>
#include <PID_AutoTune_v0.h>
// Libraries for the Adafruit RGB/LCD Shield
#include <Wire.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
// Libraries for the DS18B20 Temperature Sensor
#include <OneWire.h>
#include <DallasTemperature.h>
They should be somewhere on Adafruit's website. (EDIT: Here it is: https://learn.adafruit.com/sous-vide-powered-by-arduino-the-sous-viduino/downloads-and-links ) Usually, they're linked with the relevant part, and I think I saw a few links through the tutorial.

Instructions on adding Arduino libraries. Basically, if the file is a zip, you can just import it from the Arduino interface, and if it's not in a zip or you've unzipped it yourself, you can drag it into the right directory inside the Arduino directory.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

The arduino is single threaded, but that doesn't mean you can only do one thing at a time. With interrupts, you can get the arduino to drop what it's doing and do something right away (after a timer runs out or a pin is pulled high or low after you set an interrupt). http://playground.arduino.cc/Code/Interrupts

There's a synthesizer plan on sparkfun. https://learn.sparkfun.com/tutorials/build-an-auduino-step-sequencer

You might also want to Google the Atari Punk Console for a simple audio toy you can make out of two 555 timers and simple components. It's not an arduino project, but it's still fun.

TVarmy fucked around with this message at 00:43 on Dec 16, 2014

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

There's one thing I want to note. You don't really want to scrimp too much on breadboards if you buy one separately. The cheap ones can have such stiff springs that it's near impossible to insert components without damaging them, which kind of ruins the point of prototyping.

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

I've had good luck with insanely cheap ebay electronic components. I imagine there's probably knockoffs, counterfeits, and bad labeling, but for hobbyist purposes they're a great deal.

If you look up prices for AVR chips, they're insanely cheap in bulk, and Arduino designs are fairly simple and open source, so cheap clones make sense. The biggest problem is probably just bad build quality. But if you're getting a board for sub-$5 when you'd normally pay $20 for an official board with the same design, it's hard to complain.

But I learned the hard way that you shouldn't buy the cheapest Taiwanese breadboard. The stiff springs are a major pain and ruin components and jumper wires that don't have a thin pin at the end.

Adbot
ADBOT LOVES YOU

TVarmy
Sep 11, 2011

like food and water, my posting has no intrinsic value

Yeah, you just need to add "int leds_value;" up above void setup().

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