I am making a wireless pan tilt bracket for my home security camera. I’m utilizing 2 Pro Mini 328p’s running at 5 volts, and a set of 433mhz RF transmitter and receiver.
I first developed the servo movement on one board via a 2 axis analog joystick. I had great smooth accelerations and movement. Than I added in the other board, moved the joystick over, and set the transmit/receive pair.
I am utilizing the standard Servo library and a modified VirtualWire library that operates on timer2 for it’s required interrupts instead of timer1 since the Servo library requires that for driving the servo’s. Everything successfully compiles. I am running the Servo’s on a separate ULTRA beefy 10 Amp desktop supply with 450uf caps for added insurance. Obivously this is not a “not enough power” issue. And the serial readout on the receiver shows a beautifully rock solid stream of the appropriate Joystick inputs. My servos’ signal pins are on 5 and 6.
When I power the system on both pan and tilt servo’s jitter +/- 4 or so degrees in each direction. The whole entire time. I have control of them more or less, all be it, jittery, and jumpy control… But successful wireless control, well succesfullish. Note that the transmitter and receiver pair are about an inch from each other. Just in case anyone was thinking this was a dropped RF signal issue.
Obviously I am not generating my servo signals properly. At least that is what I assume. Am I flawed in thinking that I can use the virtual wire on timer 2 and still utilize the Servo library. Also before anyone suggests I have tried using soft serial, and virtual wire. The jitter is there, but just different problems in controlling the servo’s smoothly.
Anyway. I can throw another pro mini into the mix and use direct serial communication between them to split the tasks of servo control, and RF receiver. But of course I’d rather limit my receiving servo control foot print since it makes the security camera that much bigger… but not a huge deal.
Code is attached.
Receiver & Servo Control.cpp (6.19 KB)
Transmitter.cpp (1.82 KB)