Show Posts
Pages: [1] 2
1  Using Arduino / Project Guidance / Re: BlinkM MaxM 3 wire control on: August 09, 2011, 06:54:01 pm
Yup, you can do that.  If the MaxM is already being powered, then all you need to talk to it is three wires: Gnd, SDA, & SCL. (aka '-','d','c').

2  Forum 2005-2010 (read only) / Troubleshooting / Re: reading piezo sensor on: November 14, 2006, 10:50:14 am
The charge generated by the piezo when it is whacked is very tiny.  You'll likely find that adding a resistor smaller than 1M will result in lower values read from analogRead().  This is because the smaller the resistor is, the faster the piezo's charge will be dissipated.  Trying to accurately capture the tiny voltage peak generated by the piezo is tough.  Ideally I think you'd have no resistor at all and then use Arduino itself to discharge the built-up charge once it has been read.  Something like this might work (note, not tested at all):
  val = analogRead(piezoPin);  // read piezo
  digitalWrite(piezoPin,LOW);   // discharge piezo

This assumes the input resistance of the Arduino is very high, >10M at least.  I think this is the case, but I've not checked. And it runs the risk that you'll miss the whack on the piezo when you're spending time draining the charge.  This is the reason for the 1M resistor in the original circuit: it acts as a constant charge drain so you don't need to worry about doing it yourself, at the expense of accuracy because you're never sure of getting an accurate reading.

I solved this quite accurately before by sticking an op-amp configured as a comparator between the piezo and microcontroller. The op-amp amplified the signal and turned it into a digital value where the HIGH time measured the intensity of the hit on the piezo.

And you'll still probably want the zener though. Piezos can generate kilovolts, more than enough to fry the input pins of your Arduino.

3  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino and Carbon on: December 06, 2006, 11:21:31 pm
stealthtransam, that's a great example.

For another take, using vanilla POSIX C (so should work on Linux and Windows-with-Cygwin), check out:
4  Forum 2005-2010 (read only) / Syntax & Programs / Re: Arduino and Carbon on: December 03, 2006, 04:24:06 am
Hi Jeremy,
The Arduino doesn't appear as a USB device really.  The USB-to-serial chip on the Arduino and the driver software you installed for it make Arduino look like a serial port. If you were writing straight C code (which I assume you are since Carbon is a set of C APIs), then you would just use the normal C open() file function on the path to the serial port (e.g. something like "/dev/tty.usbserial") and then the standard read(), write(), and close() functions on the file descriptor returned by open().  If you're unfamiliar with those C functions, just about any C reference guide will help.  Speaking to serial ports is a little more complex than reading/writing files, but not much.  Do a search on the net for C code that talks to modems, serial terminals, GPS receivers, or other things that use serial ports.  You'll find lots of code.

If after all hunting around and it still doesn't make sense, let me know and I can post some simple command-line C examples that talk to Arduino.

5  Forum 2005-2010 (read only) / Interfacing / Re: blinkm addressing problem.. (try it on your blink) on: January 21, 2011, 09:30:08 pm

Have you tried using the "BlinkMTester" Arduino sketch that comes as part of the BlinkM Examples bundle?  It has the ability to let you re-address BlinkMs and I use it all the time.

The home of the BlinkM Examples bundle lives here:
You can download the examples as a zip file here:
Or you can examine the source code to BlinkMTester here:

Let me know if BlinkMTester works.  If it doesn't, but otherwise the BlinkM appears to function, then you may have a bad BlinkM.  We can arrange an exchange for you then.
6  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 15, 2008, 12:20:27 am
Hehe, yeah most things I do with Arduino is pretty hacky. :-)

justfred replied to me separately that he figured out the problem by using "nunchuck_init_with_power()" instead of "nunchuck_init()".  The former is used when you have have the nunchuck plugged directly into the Arduino (pins 2&3 supply power) while the latter is used when you have the nunchuck plugged into breadboard and powered from a proper supply.  I really should've documented that better as it's confused a few people.
7  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 14, 2008, 07:20:39 pm
Oh and the practice of using I/O pins as a power source isn't as odd as one might think.  In battery powered or other power-critical applications, you'll often seen sensors powered by I/O pins (particular in AVR-based designs, since AVRs can source 40mA per pin), so they can be switched on and off as the application deems it necessary.

Of course, in the wiichuck adapter case, it was done purely for convenience of the user.  If it bugs you (i.e. you think it "lazy") you can simply plug the wiichuck adapter into a breadboard, wire it up, and power the Nunchuck off the normal +5V supply provided by Arduino.
8  Forum 2005-2010 (read only) / Interfacing / Re: i2c, wire.h and digital pin problems on: April 14, 2008, 07:04:22 pm
Hi,  I'm the creator of the "wiichuck adapter" and the "nunchuck_funcs.h" library referenced by the OP.  Everything said above is correct as far as I know.  I've used a '595 with a Wii Nuchuck with no problems.  The "Wire" library and the underlying I2C stuff doesn't interfere with any digital or analog pins beyond analog pins 4 & 5.

justfred, the fact that the your '595 is "going crazy" makes me wonder if you've got some PWM going on.  Are you doing 'analogWrite() anywhere?  Alternatively, it could be that the pins going to the '595 aren't being configured as outputs.  Also what do you mean by "For this example, I'm not even connecting to the 595 pins from my program."  Do you mean you can't get data from the Nunchuck when it's the only thing connected to the Arduino?   Have you tried this?  Also, have you gotten the '595 to work with it being the only thing connected to the Arduino?
John_Ryan, I'm unclear what you mean by "The 'hack' seems to be on a continuous journey of corrections".  The only change made to the wiichuck adapter hardware & software in the two months since my blog post went online was the addition of the function "nuchuck_init_with_power()" to enable analog pins 2 & 3 to be used as power & ground so one doesn't need a breadboard and wiring to play with a Nunchuck with an Arduino.  This has been really popular with new Arduino users.

9  Forum 2005-2010 (read only) / Troubleshooting / Re: Programmer is not responding on Serial Arduino on: November 25, 2006, 01:34:57 pm
Perhaps a better explanation in the docs would be to say "Press reset and Upload buttons *simultaneously*".
10  Forum 2005-2010 (read only) / Bugs & Suggestions / Arduino NG schematic & layout? on: September 21, 2006, 12:25:40 pm
Is the schematic and board layout for the new NG board available?  The schematic/board zip file on is for the older board.

11  Forum 2005-2010 (read only) / Interfacing / Re: 16 BlinkM mini's Arduino and Max MSP PLEASE HELP!! on: December 23, 2010, 07:49:41 pm

Each BlinkM can have its own I2C address.  To set the address, you send a BlinkM the "Set Address" command.  See the BlinkM datasheet for details on how to do this in your own code.  The datasheet also contains some diagrams on how to hook up multiple BlinkMs.  Also, check out my "BlinkM Cylon" for an example using 13 BlinkMs.

Probably the easiest way to set the address of each BlinkM is to use the Tools menu of the BlinkMSequencer2 application (available the downloads section of the "linkm" Googlecode project.  The sequencer works with both Arduino and our LinkM USB-to-I2C adapter.

Let me know if you have any more questions about BlinkMs. We also have a BlinkM support forum on Get Satisfaction with other people using BlinkMs.

-=tod  (creator of BlinkM)
12  Forum 2005-2010 (read only) / Interfacing / Re: cabling for arduino + breadboards on: July 19, 2006, 07:33:41 pm
Those flex jumpers are a great idea.
If you search on Mouser for "flex jumpers .10" you get a bunch.
Not exactly what you reference, but close.
For instance, one of them is part number "571-FSN-24A-8", $1.28 each.
It's 8 conductor, 4 inch, with tinned leads on each end.
It's part of a whole series with different conductor count and lead length.

13  Forum 2005-2010 (read only) / Interfacing / Re: cabling for arduino + breadboards on: July 12, 2006, 01:47:02 am
I created a quick breadboard shield for Arduino that's pretty easy to put together in a few minutes.  
Check out:
14  Forum 2005-2010 (read only) / Interfacing / Re: Arduino with USB? on: November 14, 2006, 12:53:41 am
The Fluke "IR-USB" cable that is used to communicate with the meter over infrared is just a simple infrared transceiver and USB-to-serial chip.  That's what it seems after reading the FlukeView manual.  You can verify this by checking to see if the IR-USB cable appears as a normal USB serial port to Windows (or Linux or whatever), just like how the Arduino appears.

So then, the Fluke is just outputting simple serial data at some baud rate (probably 9600 or 57600 bps), with a modulation very similar to how TV remote controls work.  You can easily read this with Arduino by adding an IR detector like the Sharp GP1U52X to the RX & TX pins of the Arduino.  Search around on the net and you'll find pages on how to use it with other microcontrollers, like this one:

Regardless of whether you get the Arduino to do this or use some more advanced microcontroller board, you'll need to know the protocol sent by the meter. I did a quick search and found these pages:

If those commands do what you want, then great. Otherwise I'd suggest you find a simpler, less proprietary, means of doing your data logging.

If your application is only looking at digital events (on/off) or analog values that only need 8-bit resolution, I'd just use the Arduino itself as the "meter".

In general, going to something as complex as a computer that can be a proper USB host is overkill, it's rarely needed in the realm of embedded systems like multimeters and Arduino.
15  Forum 2005-2010 (read only) / Interfacing / Re: Arduino with USB? on: November 11, 2006, 08:17:36 pm
Arduino's USB connector is exactly standard -- for a USB peripheral, not a USB host (or master as your friend called it).  USB is designed with different connectors like this to make it obvious which 'end' of the cable a USB devices are meant for.  The host connector (flat rectangle) is called a "type A" connector, while the peripheral connector (square with one side curved) is called a "type B" connector.

The current Arduino board cannot act as a USB host.  Being a USB host requires a fairly substantial amount of computing power to run the host side of the USB protocol.  USB peripherals need much less power to communicate with the host.  A protocol that requires one side to be more powerful than the other is sometimes called an "asymmetric" protocol.

So you're out of luck if you want Arduino to talk to other USB peripherals unaided.  You can get tiny embedded Linux boxes for <$100 that have USB host ports and can communicate with USB peripherals.  If you're interested, I can give some pointers.
Pages: [1] 2