FYP: Shonky Wifi & Radio Frequency

So the initial goal today was to essentially hook up the already completed Arduino & MQTT volume control setup to the Acorn webapp. So instead of manually inputting a number into an MQTT client, I was intending on adding a volume slider on Acorn. This would mean that I could simply slide the slider to allow control over the servo, and thus volume. The completed portion (made around December 2013) can be seen here:


However that didn't end up happening. The hurdle was that the WiFi shield I'd hastily grabbed from the university appeared to be a dud. I could have still gotten on with the webapp side, but I figured that I'd rather spend another day doing that when I could test it properly with the servo stuff. Instead I decided to get on with the communication stuff. I needed a way for all the Arduinos to talk to each other. A while ago I purchased some 433MHz radio frequency transmitters and receivers. I chose the 433 ones because of their low cost and my remote control mains adapters operated over the 433MHz frequency too. I was hoping I could interface these with the Arduino and RF transceivers, eliminating the need for the remote.



So to begin with I needed to get the RF transceivers hooked up to the Arduinos. They're clearly labeled so this was no issue. The next step was the code. I had met Tom Halliday at Exeter Space Apps. Tom had built a system using two slave Arduinos, each hooked up with a sensor, to send this sensor data over RF to a third master Arduino. This third Arduino would process the data and forward it over Bluetooth to a smartphone. After asking him about it, he graciously uploaded the source and posted about it on TechyHeadz. Unfortunately he'd used 2.4GHz transceivers, with what looked like a specific library for 2.4s. After a quick look online I managed to find a library for 433s called VirtualWire. Finally with a little help from this Instructable I managed to get one Arduino talking to another.

I'd hooked up the transmitter to an Uno, and the receiver to a Mega 2560. The function is pretty simple. The Uno has an LED which intermittently switches states between on and off. When this happens the Uno sends the state over RF in the form of ones and zeros. The receiver on the Mega sniffs the RF out and sets its LED state to on or off depending on whether it receives a one or a zero. So in theory the two LEDS should be doing the same thing. In practice they were, but only if they were no further than a few centimeters from each other. Any further and the reliability would drop, and eventually the Mega wouldn't pick anything up and stop flashing in unison with the Uno.


So I was kind of expecting this, as I was aware that the modules didn't come with an antenna. To remedy this I simply soldered a 165mm jumper wire to the allocated antenna connection on each. As if by magic the range increased substantially. Now being able to reliably communicate across my room.

That's what I achieved today. I'm a bit disappointed with the WiFi, but fortunately this RF stuff seemed to work out. I thought I'd lay out a plan for what I need to accomplish tomorrow because having clear goals is much better for productivity than not.

Tomorrow's goals:

  • Establish a communication protocol for effective and reliable data transfer.
    • I'm going to have lots of these talking to each other, so I need to transmit an ID, and effective non-binary data across these. Fortunately for me Tom's accomplished this with his project, so I'll be looking at that in greater detail in the morning. 
  • Control the servo using RF.
    • As I'm intending on having one master, I'll need that master to be able to send and receive data to all the slaves telling them what they need to do. I'll build a master that uses RF to transmit a value over RF to a slave, which will be hosting the servo that . The slave then needs to send an RF packet back to the master confirming that the servo has been set to the correct value.

I'm going to attempt to keep this blog up to properly document this project and keep myself motivated, with clarity of direction. I doubt I'll do daily updates, but I will update when I feel like I've got something significant to update on. 

Comments

Popular posts from this blog

Logitech G502 Proteus Core Teardown & Scroll Wheel Replacement

Turning a laptop screen into an external monitor.

FYP: Accessibility, and Justification of Equipment