Pages: [1]   Go Down
Author Topic: Color sensor & servo control trouble using 2 Arduino's  (Read 433 times)
0 Members and 1 Guest are viewing this topic.
Rotterdam - Netherlands
Offline Offline
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?

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

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

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

Manchester (England England)
Offline Offline
Brattain Member
Karma: 639
Posts: 34724
Solder is electric glue
View Profile
 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.

Pages: [1]   Go Up
Jump to: