Pages: [1]   Go Down
Author Topic: Color sensor & servo control trouble using 2 Arduino's  (Read 423 times)
0 Members and 1 Guest are viewing this topic.
Rotterdam - Netherlands
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using the TCS230 color sensor and a servo in one single program doesn't work because they both use Timerone.h. So I used two Arduino Uno's with a simple hard-wired master-slave communication line (Tx - Rx) between them. The measured values of the color sensor are corrupted though, as soon as I connect the two units.
Even connecting digital out from the measuring unit to analog in of the servo control unit (to indicate a simple ' go to next servo position') seems to corrupt the measuring data from the color sensor, rendering it useless.
It almost looks like the pwm signal to the servo is creating too much interference... Anyone?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8970
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The example code here uses Timer2 so it might work with the Servo library:

http://www.geeetech.com/wiki/index.php/Arduino_TCS230_Color_Recognition_Sensor_module
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 637
Posts: 34602
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Absoloutly no need to use two arduinos.

The interference  is coming from the servo, you need supply decoupling. You should not be using PWM on a servo anyway you should be using the servo libary.
Logged

Pages: [1]   Go Up
Jump to: