Hi there,
I'm using and going to use different sensors on my arduino, such as the Sharp infrared and the Maxbotix EZ0/1 sonic. Both work a charm with code floating on the 'web.
I recently loaded my Arduino with Firmata to allow processing to handle all the code. This works just fine as well.
However, I might've been a bit overzealous trying to get the maxbotix as well as the sharp running on the same board. Sure, i get readings from both plugged into 5v via breadboard and analog pins 0 and 5, but they seem to spike alot when testing.
After some testing and turning off one of the sensors in the code (commenting out the function for infrared for instance), the spiking still occured. My guess is that both sensors want 5v for themselves, or something. When i cut off power to either sensor on itself, the reading of the left-over sensor become very accurate. I've tried reading with digitalPins, but i think arduino doesn't supply enough power to ensure stable readings.
So my question is: should i look for external powersources for either my arduino or the sensors - or am i missing something here? Mind you, more sensor will be added (such as the thermistor and LDR), and I need to be sure that the readings are reliable.
I've got the 5v pin connected to the maxbotix and the sharp via the breadboard. the analogpins are read via the analog output of each sensor. ground speaks for itself. If you need code or anything else i forgot to mention, feel free to swear at me for being noob. :![]()
EDIT
Found this at http://www.maxbotix.com/MaxSonar-EZ1__FAQ.html#New_Flash_UAV_and_Mobile_Robotic_Users
When electrical noise is introduced on the line, it can cause the MaxSonar sensors to output unstable readings. Known items that cause excessive power supply noise are Sharp infrared range sensors, XBee radios, some wireless control systems, some switching power supplies, some servos, etc.
There is a simple solution that eliminates the effects of a dirty power supply to the sensor. By placing a resistor in series with the V+, along with a 100uF capacitor (Digi-Key part number: P803-ND or equivalent) to ground, you create an effective filter (i.e. almost a placebo battery) for the sensor. This ensures that almost any noise introduced onto the line is captured and only clean stable power is supplied to the sensor.