Posts

Showing posts with the label nRF24l01

PS2 controller as a radio controller!

Image
Turning a PS2 controller into a wireless radio controller with Arduino Mini and an nRF24l01 radio module I have previously described a project to transmit PS2 controller signals by radio .  The project featured an Arduino Nano that read the PS2 signals and transmitted them with an nRF24l01 module.  Recently I have been inspired to incorporate the battery, charging circuit and Arduino right into the controller - heavily inspired by this project here:

Controlling my quadcopter with a PS2 controller

Image
I can now control my quadcopter with a PS2 controller - really cool!  The magic control box is powered either from the Arduino Nano inside and communicates with the quadcopter via radio, or a lipo battery, which is rechargeable over USB.  LEDs on the top feedback about the drone status and look really awesome. UPDATE: I have now incorporated the control electronics, and a long distance radio module directly into the PS2 controller!

Radio control

Image
Accessing  quadcopter memory over radio The usual method of controlling quadcopters is to transmit a train of PPM signals from a radio transmitter, measure the length of the individual pulses on a microcontroller, via a radio receiver .  As part of my DIY ethos, and as a learning exercise, I have made the above controller with an nrf24l01 moduled and an Arduino Nano.  In a nutshell, the Arduino Nano captures the 2D joystick positions, used for yaw, throttle, pitch and roll, and the button presses.  A data packet is then sent by radio to the Quadcopter.  In fact there is a more powerful implementation going on.  What is interesting is how the controller sends data to the Quadcopter - it actually manipulates the memory directly on the Quadcopter AVR - how does it do that? Well, first of all the Quadcopter defines the memory addresses that the controller has access to by setting recording a pointer to the desired variable - note that the cast means...

Programming Atmega328p chip wirelessly with nRF24L01+ module - Part II

Image
Fitting nRF24L01+ code into a bootloader A brief follow up to an earlier  post .  I previously had a system working whereby I was able to program an Atmega328p chip, using a connected Arduino Nano, but crucially using an nRF24L01+ module rather than a wired UART/PC connection.  What I really wanted however was to remove the Arduino Nano, and to program the MCU chip 'directly' by use of a bootloader with nRF24L01+ code to replace with the usual UART functionality.  I thought initially that I wouldn't be able to cram the radio module code into a bootloader, but in fact it wasn't too difficult.  I used Optiboot as a starting point and implemented bi-directional radio control within the bootloader.  I think it ended up being less than 1024 words (2048 bytes). I'm not an expert here - but I had to modify the compiler and linker parameters to get things to work: Compiler flags: -g -Wall -Os -fno-split-wide-types -mrelax Linker flags: -Wl,-section-s...

Programming Atmega328p chip wirelessly with nRF24L01+ module - Part I

Image
I recently got my hands on a bunch of nRF24L01+ modules.  They're really easy to use and dirt cheap to pick up.  I followed this tutorial , which uses maniacbug's fantastic arduino library.  Although they are fairly ubiquitous as a radio transceiver of choice, I first heard about them on the excellent Julian Ilett's Youtube channel: I'm actually new to Arduino, but have messed about with programming chips and designing electronic devices for a couple of years.  I can see the attraction of Arduino, and I can see it's a great gateway for more fundamental electronics.  I picked up a couple of Arduino nanos (well, cheap Chinese knockoffs - they worked fine, incidentally), plugged them into the radios and installed some transmitting code on one (the joystick TX example in the  tutorial ) and some receiver code on the other - they worked great, out the box first time! Well that was just too easy!  The range was impressive too, at least twenty metres...