All about drone and quadcopter shoping guide,review, tutorial, news and info

Jumat, 03 April 2015

Controlling toy quadcopter(s) with Arduino

The last couple of days I have finished some more be sprightly re the little toy quadcopters (now dubbed HCD for Hamster Cage Drone). The take viewpoint was to hack the communication for that gloss that they could be controlled using computer vision software. Basically the poor mans fable of this (don't substitute you have already seen it).

UPDATE: Use this modified code to be compatoble considering SparkFuns NRF24L01 radio.

UPDATE: I have made a Arduino library for controlling this particular Quadrotor (may perform later same products). You will mannerism to fabricate this easy hardware (discribed almost speaking this page) to use the library. All parts (apart from Arduino) may be found inside the remote controller that comes later than the quadcopter.

The first situation I did was to take the detached run handset apart to space what to hand of radio system was used.

 Inside was beautiful much what you'd expect. A couple of cheap paper PCB's associated to than not a lot more or less them.


The radio communication is handled by a small discrete radio module. After a lot of internet digging it turned out that the module was based in description to the BK2421 2.4GHz tranceiver IC. This along with seem to be the substitute for a lot of cheap RC toys coming out now.


With a datasheet for this chip and an oscilloscope it was easy ample to figure out the stick configuration for the SPI communication along amid the radio module and the handset.


Using an ArduinoUNO to eavesdrop concerning the order of this comunication I was practiced to figure out the initialization and thereby the mode of communication. Here is a annotated list of the initialization sequence.

Without going into detail about the low level communication the taking into account happen behind the handset and
Quadcopter are turned once insinuation to:
1) Handset confirm it's unique network habitat or ID.
2) Quadcopter receives the push it acknowledges this and begin listening to data from that ID.
3) Upon comply to the handset later begin transmitting uphill data packet all 20 mS.

Multible Quadcopters can be controlled simultaneously by assigning them other addresses.
The passing of ID is ended upon one conclusive radio channel and on high data is sent upon one of just approximately 12 random radio channels. The quadrotors seem to auto scan the radio channels until they locate data.

Flying data is transmitted as 8 byte packets in bearing in mind format:
Byte 0 = throttle 0-255
Byte 1 =Yaw 0-255
Byte 2 =Yaw_trim 0-128
Byte 3 = Pitch 0-255
Byte 4 = Roll 0-255
Byte 5 = Pitch_trim 0-128
Byte 6 = Roll_trim 0-128
Byte 7 = Fly/manage 0=fly, 16=run (toggle button upon handset)


Next I created a base station that would partner to the quadrotors. I happened to have some RFM-70 modules that contain the same BK2421 chip. Not reading the datasheet properly I initially thought that this module required 3.3V logic and as a upshot every the resistors. They are not needed since the BK2421 has 5V innocent-natured data pins.



NOTE: CE goes to fix 8 (missing upon drawing)

I eventually done occurring gone a much simpler set-taking place using just the module salvaged from the handset and an Arduino.
To enable far-off away ahead experimentation I have written a Arduino library for connecting to one or more of these quadcopters.
The library should operate upon any ATMEGA88 to ATMEGA328P based Arduino boards.
If you twinge to have a go yourself you may pay for in to the HCD's here or here together next totaling places. These are just random hits upon google, you may acquire them elsewhere.


Less crappy video here.


Please part if you regard as bodily supplementary toys that may be hacked using thesame methods.
Happy hacking.

0 komentar:

Posting Komentar

//SEO SCRIPT POWERED BY www.tutorialblogspot.com