|Feb 28, 2013, 06:12 PM|
WLtoys v959 video camera R/C hack
The camera which came with my WLToys V959 RC quadcopter does a reasonably good job of recording video - audio is of course there but never much to listen to with motors buzzing ...
But lately, I've been flying my Bixler more than the V959 and I was thinking about mounting the camera on the Bixler instead - but in order to do that, I need a way to trigger the camera record function (and optionally photo function).
So I did some tinkering and I've managed to find out what the four pins on the V959 flight controller header do:
yellow: +3.3v nominal, pull to ground for 250ms to start or stop video fuction
white: +3.3v nominal, pull to ground for 250ms to take a still photograph
One of the nice folk at 9xforums (Kilrah) suggested I would need some active circuitry between the receiver and camera, pointing me to the rc-cam.com project page for some examples.
So I decided to get hacking with my Arduino Uno to see if I could power and trigger the V959 camera's video function from my plane's Turnigy 9X8Cv2 receiver
I hooked up my Arduino Uno to the 9x RX thusly:
+5V from the Uno to +BAT on the RX
GND from the Uno to -BAT on the RX
Digital Input pin 5 on the Uno to channel 8 SIG on the RX
I then used pulseIn to read the pulses on channel 8 which I had mixed as "CH8 100% FULL GEA" in er9x.
I initially just printed out the values - 1400ish when the gear switch was off, 1900ish when the gear switch was on.
A little video of the output from the Arduino's serial monitor is here: http://www.flickr.com/photos/allandrick/8509087140/
Next step was to wire up the camera, powered by the Arduino 5V rail, and trigger the camera trigger somehow when the gear switch was toggled..
Kilrah to the rescue again with a little hint that allows you to not need a level converter on the 3.3v pin of the camera by using the Arduino's output as an open collector: When you need it LOW, turn it LOW. When you need it high, do NOT turn it HIGH, but switch it to input mode instead. The camera's pull-up will do its job and hold it at 3.3V. As long as you're careful not to set the pin HIGH you're good.
That made the design a bit simpler! So I ordered some attiny45 chips and, after a bit of googling and micrometer measuring (image search for the win), I found a molex 1.25mm pitch plug/header connector that looked like it was a match for the one on the WLtoys V959 flight controller camera port - that way I wouldn't have to hack up the camera cable and could move it between the plane and the quad as desired
I got some servo extension cables from ebay and waited for the deliveries to arrive.
Two days later (today) the packages had landed and I set out building a test circuit on a breadboard. I soldered one of the molex connectors to some jumper cables so I could plug them into the board and prototype with the attiny45 - what a nightmare!
My eyesight isn't that good up close (I wear reading glasses) and even with a magnifying glass, I was struggling. Thankfully, the trusty Multimeter confirmed that there was no short circuit... *phew* - the testing on attiny45 could begin!
Here's a pair of videos demonstrating the functionality (one from my perspective, one from the WLtoys camera which I am triggering with my er9x gear switch ).
My crappy filming view:
WLtoys camera view:
Credit goes to the folks at the High-Low Tech group (MIT) for the great article on how to use the Arduino Uno as an AVRISP for the AtTiny45.
The next task was to package it all up in one small package and try to protect the tiny connector, somehow...
Phew, that was hard work!
Soldering wires to the end of the molex male socket was a pain in the you-know-what.
The sockets I got were meant for surface mount boards, so I had to gently bend the bottom lugs up into little pins jutting out from the bottom of the connector - I then used the ends of some breadboard jumper wire with the pins removed from the crimped end, pushing the crimp over the tiny pins on the bottom of the molex plug. I then wicked solder into the crimp, making a nice secure connection to each pin on the molex plug - heat-shrinking each joint before starting the next. Rosin Flux for the win!
Even with the smallest heatshrink tube, it was a tight squeeze fitting them in the 1mm gap between each pin - thankfully I only needed 3 out of the 4 pins connected (video mode is all I care about, taking still photos is only as good as a single video frame on this camera anyway). I then pushed the wires through the square end of a servo cable shroud and glued it all together in a neat package:
This should remove any possibility of strain being put on the solder joints.
Soldering the wires to the AtTiny45 pins was easy enough - a bit of rosin flux (dispensed by my handy flux pen) followed by a dab of solder on the chip pins, and the solder on the ends of the tinned wires was enough to make a perfect connection without needing too much heat for too long. Six connections later and it was done :-)
I then twisted the wires gently on each end of the circuit and wrapped them around the chip and servo cable shroud for some extra strain relief and got it ready for heatshrink:
Just like a bought one!
All hooked up ready for installation in my plane:
I tested it and, as with the prototype above, it worked perfectly! I didn't bother adding the LED and resistor, even though the sketch still tries to turn it on, because the camera has an LED status anyway - which was enough for me to confirm I hadn't fried the chip with my soldering efforts nor had I created any shorts between wires in the molex plug end!
Happy days! I now have a remotely controlled camera controller for the princely sum of £2.50 ($4.00) worth of components and a few hours of labour. Given that I didn't have all the right tools for this kind of project, I am rather pleased with the result.
I'll be shooting some remotely activated video this weekend :-)
|Mar 01, 2013, 03:57 AM|
MOLEX - 53398-0471 - HEADER, VERTICAL, SMT, 4WAY which I found on Farnell. Sadly I didn't realise it was surface mount but found a work-around for that anyway
|Mar 02, 2013, 04:30 AM|
good luck. as your camera is on top of aircraft it could be not good if it's sunny. I made lens hood on mine as on v959 it also not covered from above. I used plastic card peaces which I glued around lens so lens is protected from sun light from above and sides.
|Mar 03, 2013, 10:17 PM|
|May 14, 2013, 01:40 PM|
Joined Feb 2013
Hey Imhart - did you only use this camera for recording or were you getting a live video feed for FPV?
Sorry dude, I don't have time to read the whole thread to find out for myself LOL. Very interested in getting a video feed from this camera for FPV - I have some Hubsan Spyhawk gear lying around and figure if I could get a video feed from the camera I could use the VTx from the spyhawk on the V959 for quadcopter FPV.
|May 15, 2013, 07:18 AM|
|May 15, 2013, 09:50 PM|
Joined Feb 2013
TBH never been impressed with the video from those keychain cameras.
The video from this wee camera is 60fps that's why I was interested; that and it does a pretty good job with colours.
I am going to have a rethink. I could certainly rig up an 808 cam to the spyhawk VTx board.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Mini-Review WLtoys V959 Quad (with Video Recording Function) Mini-Review||FyreSG||Mini Multirotors||1034||Dec 06, 2013 07:38 PM|
|Mini-Review JamesChen072's WLToys V959+modules review||jameschen072||Mini Multirotors||1360||Oct 31, 2013 11:21 PM|
|Mini-Review WLtoys V959 Quadcopter with on-board Video||old4570||Mini Multirotors||7||Jul 23, 2013 03:57 PM|
|Discussion Torsional rigidity gone on WLToys V959 boom||1auriec||Mini Multirotors||7||Feb 20, 2013 06:52 AM|