I have a temperature sensor that is connected to a Arduino Diecimila (Arduino1). The temperature sensor output (temperature is indicated by a voltage 0 - 3.3V) is connected to Analogue In (pin 5). This is the sender unit.
I am trying to send the data from Analogue Output (pin pwm 11) of that board to a Arduino Duemilanove (Arduino2), where the data is received on Analogue In (pin 5) and read by the PC to which it is connected. This is the receiver unit.
So basically the data goes from Temp Sensor -> Arduino1 (Analogue In pin 5) -> Arduino1 (Analogue Out pin pwm 11) -> Arduino2 (Analogue In pin 5) -> PC (via USB).
Arduino1 (sender) is powered by 9v external supply and has code:
Unfortunately it does not seem to be working. The correct voltages are coming out of Arduino1, but it all seem to get messed up as soon as it enters Arduino2.
Is there anything that stands out as glaringly wrong (all signals are grounded by the way).
Eventually the link between the 2 boards will be wireless (XBEE Pro) but until I can get it sorted with wires I can't progress.
This is part of a Uni Final Year project so your help is very much appreciated.
I dont think analogue read on the second Arduino would read the pwm from the first.
Doesnt analogue read just read a voltage, wheras pwm is not a voltage level.
Wouldnt sending the info to the second Arduino by serial message or I2C be more reliable and less prone to error?
This could still be done wirelessly or you could stick to a wire over a fair distance.
Im not sure what you are working on, but do you even need a second Arduino?
If all you are doing is sending a value representing the temp from the sensor you could do that directly to the pc without a second Arduino.
What I'm working on is a wireless weather station.
The idea is I will have 3 sensors, each will be an individual portable unit:
Tempeature sensor
Humidity Sensor
Windspeed senor.
I was going to put an arduino in each sensor unit. Technically I know I don't need one with each as they are all going to communicate with a basestation containing an arduino.
The idea of them each having an arduino was for a later development where a hand held display could be attached to each unit to get that units readings alone. This is because this station will be used on a golf course and the senors will be placed at differnet locations (a sort on maintenance check option if you like).
Ignoring the fact I don't need the 2. How would I attach them serially as you suggested and how would I alter the code?
I'm guessing it would be attach tx of Arduino1 to rx of arduino 2
You are going to have to be careful with your code as the tx/rx lines are all connected together with your pc, both arduinos and the ide. So things can get a bit confusing.
Your sender is sending to the receiver and the ide terminal.
Your receiver, if it does get the data, is then sending to both the ide terminal and the original sender board.
You will have to output your debug code to maybe an lcd rather than the terminal in the ide.
Also there could be interference when uploading your sketches unless you disconect the connections between the two boards.
You might want to dive straight in with the xbee stuff.
Have you looked at the examples in the playground?
Under Communication and wireless. http://www.arduino.cc/playground/Main/InterfacingWithHardware#Communication
They might get you running quicker and get some more inspiration on how to solve your problem.
I am trying to send the data from Analogue Output (pin pwm 11) of that board to a Arduino Duemilanove (Arduino2), where the data is received on Analogue In (pin 5) and read by the PC to which it is connected. This is the receiver unit.
You cannot wire a PWM "analog" output pin directly to a analog input pin as a PWM signal is not a real analog voltage but rather a series of highs and low of variable duty cycle. One must first filter the PWM signal with a low pass filter to obtain a true analog voltage that can then be wired to a analog input pin.
While I'm waiting to get hold of a I2C and or LP filter, I've decided to have a go at the XBee as I have 2 pro modules.
As it was suggested earlier that I don't need 2 Arduinos, I've deciede to connect the temp sensor to and XBee module (XBee2) and the other to an Arduino (XBee1).
Having looked through the playground stuff on XBee I have set the modules up as follows:
As stated before the output from the temp sensor is 0-3.3V. Can I connect the sensor straight to AD0 if I set that pin up as a ADC in X-TCU or do I need a buffer or anything?
Am I also correct in saying as the 2 module have been set up as detailed above in X-TCU, they will automatically communicate with each other without having an Xbee setup function on the arduino.
Finally I want the the data to enter the arduino on a analogue in pins, so I presume I need a DAC between XBee1 and the arduino.
Also do I have to import any particular libraries into the arduino code in order for it to communicate with XBee.