Show Posts
Pages: [1] 2 3
1  Community / Exhibition / Gallery / "Standard" Remote Control camera trigger for WLtoys V959 camera (AtTiny45) on: February 28, 2013, 06:26:38 pm

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:

red: +5v
black: gnd
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 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 :eek:

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:

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  smiley-grin

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!

Success! smiley-grin

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  :popcorn: ).

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. :censored: 

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 :-)


2  Using Arduino / Programming Questions / Re: Text Array on: January 08, 2013, 11:48:23 am
Strings should be null terminated, hence 4 instead of 3.
3  Using Arduino / General Electronics / Re: Newbie question on designing your own 'board' instead of using wires on: January 03, 2013, 05:44:43 am
+1 for Fritzing - getting the layout right is rather easy.  Watch some of the youtube tutorials smiley
4  Using Arduino / Project Guidance / Re: Duel Motor Control Help on: January 02, 2013, 06:39:33 am
If you are looking to make a small circuit, you might consider building a standalone Arduino circuit with an ATTiny- see this video for more info: also may be helpful for you smiley
5  Using Arduino / Project Guidance / Re: 2 sensors and 1 wireless components with Arduino UNO on: January 02, 2013, 06:29:19 am

This Xbee tutorial might help you:

in terms of the sensors - the LM35 is a fairly simple device - assuming you have the TO-92 package, apply 5V to pin 1 (left pin when looking at the flat face of the TO-92 package), ground to pin 3 (right pin) and hook up the middle pin to an analog port on your Arduino Uno.  To read the temperature, simply perform an analog on the pin and apply the calculations to work out the temperature.  Example code from this tutorial:

//declare variables
float tempC;
int tempPin = 0;

void setup()
Serial.begin(9600); //opens serial port, sets data rate to 9600 bps

void loop()
tempC = analogRead(tempPin);           //read the value from the sensor
tempC = (5.0 * tempC * 100.0)/1024.0;  //convert the analog data to temperature
Serial.print((byte)tempC);             //send the data to the computer
delay(1000);                           //wait one second before sending new data

To convert from centigrade to fahrenheit, simply multiply the C figure by 1.8 and add 32.

Also worth reading this.

you don't specify what you are using as a pulse sensor, so I can't help you there.
6  Using Arduino / Project Guidance / Re: Hacking the Arduino Wifi Shield on: January 01, 2013, 05:07:52 pm

I'm not sure about the firmware side of things, but have you seen Fritzing?  Quite a useful way to design a new PCB...
7  Using Arduino / Motors, Mechanics, and Power / Re: relay to control 18v DC drill on: January 01, 2013, 04:48:07 pm
Is the relay switching power to the drill?  (check with a multimeter).

If so, then it could be the drill has a safety feature that prevents the drill turning on when the trigger is already pulled when power is applied.
8  Using Arduino / Project Guidance / Re: New to arduino here. How do I debounce multiple buttons? on: December 31, 2012, 02:49:07 pm
so what you are saying that using debounce is not advisable and using interrupts is preferable in this situation? How do I use interrupts when I'm planning to use 20 button combinations?

I was suggesting that hardware debounce might be easier than trying to software debounce that many buttons.  I wasn't suggesting that interrupts are preferable, just that they become difficult to use if you use software debounce. 
9  Using Arduino / Project Guidance / Re: New to arduino here. How do I debounce multiple buttons? on: December 30, 2012, 06:30:07 am
One of the problems with a software debounce is that you're introducing delays into your code and also unnecessarilly consuming execution cycles on the AVR.  You also are prevented from debouncing inside an ISR (interrupt service routine) as delay() is not allowed to be used there (although there are some ugly ways to get around that too).  

Check out this video tutorial on how to wire up hardware debounce in your button projects - it'll save you time and effort later in code:


10  Using Arduino / Programming Questions / Re: Simple temperature gauge on: December 29, 2012, 09:41:02 am
'int sensorPin= 0;'

So i need to set it as an output as well?

Suggest you read up on the tutorials for analogRead here
11  Community / Bar Sport / Re: Where did you start with Micro controllers? on: December 28, 2012, 04:02:55 am
G'day Rob,

I remember those Big Boards, what monsters.

Indeed - I don't ever recall my mate ever doing much with it other than zap a few eeproms with the on board programmer (for what, I have no idea!) :-)

I just found the eZ80 (, what a great-looking chip. I'm reading the data sheet now wondering what I could use one for.

I remember enjoying the Z80 - Zilog need to find a way to get them out to the mass market / enthusiasts like they did through education in the 70s and 80s if they hope to stand a chance against the current generation of AVRs.

I grew up in Australia
And now you're in the UK, one can only imagine the terrible circumstances that brought that about smiley

It's a long story mate :-)  Belfast is an interesting spot, too right.


12  Community / Bar Sport / Re: Where did you start with Micro controllers? on: December 27, 2012, 08:45:07 pm
My first start with electronics was with a 150-in-ONE project kit at aged 11.  I have vivid memories of wiring up a crystal radio and tuning into my first AM station (in Jakarta) which was playing the (then) newly released smash hit number one: Eye of the Tiger by Survivor...

As I grew up in Australia, I went through the entire catalog of Dick Smith Electronics (DSE) Funway into Electronics kits, building almost all of them that I could afford with my allowance and any money I earned delivering junk mail and working at a shoe shop on Saturday mornings.

In my mid teens I watched in awe as my best friend built a Z80 based Ferguson Big Board computer.  I, however, got hooked on the software side of things and spent my late teens writing serial (mostly FOSSIL based) communications utilities to interface bespoke POS systems to Gilbarco petrol pumps; linking NEC PBX systems to Qantel hotel billing systems for CDR processing.  I also wrote a tennis school database and a hotel functions event management database while studying at University and working as a night porter/auditor trainee in a hotel.  Fun times!

Between 18 and 20 as I studied computer systems engineering, a wonderful course that covered everything from basic programming to operating systems to electronic peripheral design - in one class, I build a wire-wrap ISA bus AD/DA card for an 8086 based PC and wrote a DOS TSR sound driver in assembly language; and a Telix clone in Pascal - those were the days!  In my 20s I helped my wife with her CompSci studies, in particular with MicMac assignments.

I then spent 20 years working in the Internet and Telecommunications industry as an R&D engineer, designing and building networks and associated peripherals where I designed a system using Z80 based Rabbit (now owned by Digi) microcontrollers for out of band monitoring of remotely deployed microwave systems.  I am now a consulting engineer specialising in next gen IP telephony living and working in Europe.

My most recent return to micro controllers has been with an Arduino Uno and Arduino Fio which I am using to build my vision impaired nephew a talking temperature guage with scrolling LED text display.  The experience has been fantastic!  Mixing the best parts of writing code, soldering small circuits and wiring up different gadgets to talk to each other - heaven!


13  Using Arduino / Audio / Re: SpeakJet output help. on: December 27, 2012, 10:54:04 am
I'm guessing as I can't see your circuit / schematic - but if you are connecting a sound module's output to an amplifier you might need to reduce the gain before going in - I certainly found that to be the case with a circuit I built recently.  Try adding a capacitor and resistor or two to the circuit - e.g.:

soundPin ------ (+)10uF CAP(-) ------ 10kΩ --+-- 220Ω ----- GND
14  Using Arduino / Audio / Re: Elechouse MP3 Shield on: December 27, 2012, 10:46:00 am
The website for the product has a library containing all the code you should need, including examples, plus a manual.  I'd recommend starting with both of those.
15  Using Arduino / Audio / Re: electronic game sounds on: December 27, 2012, 10:40:35 am
Many of those games programmed their sounds directly using code, rather than recorded digital media - thosee were the good old days.

Take a look at SimpleSDAudio for a way to do it from SD media directly on the board using SPI, or alternatively a more low-tech approach is described here.
Pages: [1] 2 3