Show Posts
Pages: [1]
1  Using Arduino / General Electronics / Re: Using a PhotoSensor as a variable resistor on opposite day on: May 10, 2011, 04:07:56 pm
I am actuating some muscle wire. The wire contracts more with more current, causing more movement in my installation. The current range I am going for is 0 to 200mA. I am using an oscillator circuit (with capacitor and 555 timer). The current is already oscillating but what I am trying to do is vary the peak current within that oscillation. For now, I want to vary the current w/o manipulating the sensor data in the code. So I am kind of just using the Arduino as a power supply right now (sorry Arduino!) This will change later but its what I need to do at this stage of the project.

The photosensor is acting as a variable resistor that regulates the current flow to the muscle wire. see circuit diagram attached.
5-50 Ohms gives me the 0-200mA current range I need. (I checked using regular resistors and a multimeter). But the photosensor is actually giving me 200-10K Ohms of resistance.

If I remapped the values using code in Arduino, what kind of output could I have? Could I specify a particular current output in a digital out pin?
2  Using Arduino / Motors, Mechanics, and Power / Can I program Arduino digital out pin to output a particular current? on: May 10, 2011, 03:45:22 pm
I need a variable current output that is responding to sensor data and actuating some muscle wire. Can I get the digital out pin to output a range of currents according to incoming data? I want a range and not just HIGH and LOW.

3  Using Arduino / General Electronics / Using a PhotoSensor as a variable resistor on opposite day on: May 10, 2011, 02:07:25 pm
Hi, I am using a photosensor as a variable resistor to vary the current according to light levels in my project. I am stumped on two problems and I was hoping a kind genius could help me out smiley

1- I need to adjust the values to a much smaller range. According to my multimeter the photosensor has a resistance range from 200 Ohms (light) to 10K Ohms (dark), but I need a range of about 5-50 Ohms. Any quick and dirty way to tweak these values w/o hooking up 40 of these in parallel?

2- I would like to reverse the effect of the photosensor. So instead of increasing resistance with decreasing light, the resistance would decrease with decreasing light.

Any tips would be greatly appreciated!

4  Using Arduino / Project Guidance / Arduino+Processing and Arduino+Grasshopper, advice? on: February 03, 2011, 12:06:57 pm
I am working on a project where sensor data gathered via Arduino causes some movement in an installation. I am in the process of making the actual mechanical piece now but I would like to create a digital simulation of the built work too.
So sensor data would be collected via the Arduino and instead of moving a physical structure, it would move a digital image. This would be interactive in real time. I intend to project the resulting image. Any suggestions on the best way to do this? Should I interface Arduino with Processing? Arduino with Grasshopper? I haven't done either before so I am not sure which would be best.
Any opinions on which would be easier? which would produce a better results?
Any other advice would be so appreciated!

5  Using Arduino / Project Guidance / Re: University project needs help: Serial Communication between arduinos on: February 03, 2011, 11:54:18 am
Sounds like you need a lot of arduino's to get your game to work. Although I'm sure you can find ways around that. For now, I would suggest that you need to get your arduinos to communicate in a multimaster configuration, where each arduino has a specific address and is able to send and receive information.I had a similar problem in my project and the Wire library worked well for me. You can just have each arduino search for its neighbor and wait for a response and if no response then it searches for its neighbor's neighbor.   If you are still having trouble getting the Arduinos to communicate using the Wire library here are a few great resources:

Keith's electronics blog was particularly helpful to me.

And if you want a really dumbed down, step by step explanation of how to do this you can check out my blog where I documented my progress with getting my arduinos to communicate in detail (I'm a newbie so I really go baby step by baby step  smiley)

good luck!
6  Forum 2005-2010 (read only) / Syntax & Programs / Re: MultiMaster send/receive an array over I2C on: January 12, 2011, 02:01:28 pm
oh dear, I forgot the part about how I can only send and receive bytes. I am working up to storing photosensor data in the array. I've seen those values run around 0 to 1000. So I guess that means I have to scale my numbers so I can send them as bytes? Any easier way to do it?

Thanks for pointing out the waste of storing as int. I will definitely revise that as I think it will become a problem later.

7  Forum 2005-2010 (read only) / Syntax & Programs / Re: MultiMaster send/receive an array over I2C on: January 12, 2011, 01:17:00 pm
Hi Paul, thanks for the response. My code seems to work ok. At least it seems to be since the array being received and printed to the serial monitor seems to be correct. All the numbers are where they should be.

But I tried your way and that worked too!
Since I am new to this I am going to trust your judgement and stick to your way. Hopefully I will understand it better eventually smiley-grin

I am working up to filling the arrays with sensor data and definitely need to make sure that the data is being put in the correct position in the array.

hmmm, not sure why thisArray and lastArray are different types. I started with another example that had it that way and just kept it because it worked. Do you see any issues with that? Should they both be byte? int?

I am tracking my progress with my project on my blog. Any comments/ suggestions would be welcome.


8  Forum 2005-2010 (read only) / Syntax & Programs / Re: MultiMaster send/receive an array over I2C on: January 11, 2011, 10:45:16 pm
I figured out what I was doing wrong. its porb just a newbie mistake but I thought I would post it in case anyone else gets stuck like I did.

to receive an array of integers you need a for loop since I guess Wire.receive can only receive one int at a time. (but sending an array all at once wasn't a problem, go figure)

so here is what you need to write to get the whole array:

void receiveEvent(int howMany){
  while (Wire.available() > 0){
    for (int p=0; p< 6; p++) {  //receive and replace all elements of new thisArray
      thisArray[p] = Wire.receive();  
9  Forum 2005-2010 (read only) / Syntax & Programs / MultiMaster send/receive an array over I2C on: January 11, 2011, 08:33:00 pm
Hello, I am having trouble sending an array over I2C. I am a newbie  and starting with a simple sketch that passes a 1x6 array between 3 arduinos.

the communication is initiated by pressing a button attached to arduino#1,  arduino#1 blinks an LED the amount of times indicated by thisArray[0], adds one to all the elements in thisArray and then send the array to
arduino#2, which blinks an LED the amount of times indicated by thisArray[0], adds 1 to each element and then passes thisArray to arduino#3 where same happens and then goes back to arduino#1.
I am also having the program print to the serial monitor at every stage so that I know that the code is being read...

Right now, my LED on arduino#1 blinks when I push the button, the value of thisArray is printed to the serial monitor as well as all of the string notes at every stage. However, arduino#2's LED never blinks which I am guessing means that the array is not being received by arduino#2.

I think my issue may be in this part of the code:


void receiveEvent(int howMany){
 while (Wire.available() > 0){
   thisArray[6] = Wire.receive();


I'm not sure if Wire.receive can receive an array of integers.
I tested the above and it only receives the 6th value in the 1x6 array. I want it to receive all 6 values though. if I just put thisArray[] = Wire.receive(); I get an error message.

any help would be greatly appreciated.

my full code:

//MultiMaster communication
//add 1 to each element in the array, blink LED, print array to serial
//& send array to next arduino

#include <Wire.h>
#define LED 13
#define BUTTON 10
#define THIS_ADDRESS 1

boolean last_state = HIGH;

int lastArray[]={
byte thisArray[]={

void setup() {
  pinMode(LED, OUTPUT);
  digitalWrite(LED, LOW);
  pinMode(BUTTON, INPUT);
  digitalWrite(BUTTON, HIGH);

void loop() {
  if (digitalRead(BUTTON) != last_state){
    for (int i=0; i< 6; i++) {
      thisArray = thisArray + 1;

  if(thisArray[0] != lastArray[0]) {
    for (int j=0; j<thisArray[0]; j++) {
      digitalWrite(LED, HIGH);
      digitalWrite(LED, LOW);
    for (int k=0; k< 6; k++) {
      int n = thisArray[k];

    Serial.println("increment array");
    for (int m=0; m< 6; m++) {  
      thisArray[m] = thisArray[m] + 1;
    Serial.println("transmit array");

    for (int h=0; h< 6; h++) {  //make lastArray = thisArray
      lastArray[h] = thisArray[h];
    Serial.println("wait for response");

void receiveEvent(int howMany){
  while (Wire.available() > 0){
    thisArray[6] = Wire.receive();

**code for arduino#2 and #3 is the same but without the button and strings printed to serial monitor.

10  Forum 2005-2010 (read only) / Frequently-Asked Questions / Re: Unmanned Robot? on: January 23, 2011, 11:57:06 am
hey  neodude112320,

I didn't know any C/C++ when I started using Arduino and it wasn't too hard to get started. Luckily, there are lots of resources on the web. My first project was a Braitenburg vehicle and it took me about 1 day to put it together (and most of the day was spent shopping for the right parts).
You can see my light seeking robot here:
Depending on how much more complex your project is, you can figure out how long it would take you... good luck!
11  Forum 2005-2010 (read only) / Frequently-Asked Questions / Muscle wire, Nitinol, Flexinol, SMAs ? on: January 23, 2011, 11:48:02 am
Hello there,

I am new to muscle wire and getting a little confused about all the lingo out there and was hoping someone could clear some stuff up for me?

I've heard of muscle wire that contracts in length (about 2-5%) when current (generating heat) is applied to it.
I've also heard of muscle wire being trained to remember a particular shape and when heated, reverts back to that shape.
I've heard of Flexinol, Nitinol and SMAs.
So my question is...which is which?
Whats the name of the product that contracts, and which is the one that remembers its shape? or do they all do the same thing?
And whats the difference between Flexinol and Nitinol? or is this a Kleenex vs tissue thing?
I read the literature on the Dynalloy site and I am still confused.
If anyone has used any of these products and could clear this up for me I would really appreciate smiley

Also, any other advice on muscle wire would be greatly appreciated. For example, should I use High Temperature or Low Temperature?

12  Forum 2005-2010 (read only) / Bar Sport / Re: Where to buy part in Toronto on: October 22, 2010, 09:35:58 am
I checked Active Surplus yesterday and they didn't have any Arduino.

Home Hardware on College & Spadina only had one Freeduino left. (Honson's is located inside this Home Hardware now). They didn't have any starter kits, which was what I was looking for. Although they did have plenty of cool accessories and parts. The prices seemed reasonable to me but I am a newbie.

I am thinking of ordering from robotshop dot ca
They are located in Quebec so at least I won't have to worry about it getting stuck in customs or duty charges (as opposed to ordering from US or China).

I saw some great deals on kits from China on ebay. But I am worried shipping time and cost. But if you are willing to take the risk there are some great deals...
Pages: [1]