I am wanting to do a home automation project to control my thermastat and eventually other things via the web. I was thinking to use two WIXEL boards and an arduino with ethernet and WIXEL shields. I would like to put the arduino in my basement and have it connected to my router. Then on the wall where my current thermastat is i would like to build a box and use a WIXEL connected to a LCD, couple push buttons, relays for AC switching and a temperature sensor to be the new thermastat.
The Arduino would be the main brain “controller” and the WIXEL more or less acting as a remote I/O point driving the I/O and menu for the LCD. The WIXEL will be sending inputs and setpoint changes wirelessly back to the Arduino.
Before I start buying parts and such I would like to make sure this is going to work and see what problems I might run into. So I have a few questions about this setup.
How good are the WIXEL boards at talking to each other through floors/walls etc It would need to constantly send information from where my thermastat is upstairs to my arduino in the basement. which is only like 20 or so feet away but through the floor.
I have not used the WIXEL before but is the programming enviorment user friendly with ample example apps for me to figure out how to use the WIXEL as not only a wireless transmitter but also a LCD driver and I/O controller or should i use another arduino as the thermastat and the keep the wixel just as the transmitter (I would prefer not for box size reasons).
Any ideas, comments, links to examples, source code, information, would be greatly appreciated. I’m just trying to figure out the best way to do this before I begin purchasing equipment.
Thanks in advance,
In our tests here, we have gotten Wixels to communicate through several walls over a distance much longer than 20 feet, so I think the Wixel’s radio should work fine for your application. If you are worried about it, you can compile the test_radio_signal_tx and test_radio_signal_rx applications in the Wixel SDK and use them to get an idea of the signal strength between your two points.
The Wixel’s programming environment is not as user friendly as the Arduino’s. The main reason is that the Wixel has a lot more responsibilities than the programmable microcontroller on your Arduino: the Wixel needs to maintain a USB connection, maintain a radio connection, and do any other tasks that you want to be done, such as blinking LEDs. To do this, you need to remember to call certain functions frequently. As a result, it’s usually best to write all your code in a non-blocking way, but we do have an example app (example_servo_sequence) that shows you how to write blocking code. We have written a GPIO library that will help you write the LCD code, and it is documented here:
There are currently 21 apps available in the Wixel SDK for you to look at:
You can read the “Writing Your Own Wixel App” section of the user’s guide to get an idea of what it would be like to write a Wixel app:
I just want to add that this sounds like a really interesting project, and we would love to hear how it turns out if you do end up using Wixels! We’d also love any feedback you have about what it’s getting started with Wixels (e.g. things that you liked, things you got stuck on, things that we can improve, etc). As David basically mentioned in his above post, all of our Wixel resources are available online, so you can get a pretty good idea of what Wixel development would be like before you purchase anything.
Thanks for the responses and information, I will check out those links and report back progress/questions.
I appreciate the help,
Instead of trying to implement my own LCD library in wixel i was thinking i could combine the functionality of the I/O repeater program with the adc wireless program and do all the programing on the arduino (ie LCD interface, temp sensor, buttons etc) for the thermostat and the wixel would truly be just remote I/O for both digital and analog signals.
My question is would the I/O update delay from using the arduino LCD library output to the wireless wixel mess up the signals needed for the LCD. I am using a HD4478 type lcd could do either 4 or 8 bit output though would prefer 4 bit to the lcd so i can use more i/o for expansion.
Yes, the delay of the Wixel’s wireless link is likely to cause some problems if you try to control an LCD in that way. You could look at the source code of your Arduino LCD library, finding the places where it reads and writes from I/O pins, and seeing if it depends on the LCD responding quickly or makes any other assumptions that won’t hold.
I went ahead and picked up a couple wixels with the arduino shield and have begun to mess around with the wixel SDK. But I have a few questions I wanted to ask.
I have been looking at a bunch of example wixel apps and it looks like I am going to need to create a non-blocking button debouncing function. I have 4 push buttons I am going to be connecting to P0_1 - P0_4. These push buttons are connected to ground on the other side so i was going to configure the inputs with pullup resistors which is default i believe. I have looked at a few debouncing routines but they all seem to have a inline delay. Any suggestions/examples would be awesome.
Also does anyone know of a cheap product that is a switching regulator and diode bridge package that I could use to power the wixel from the 24Vac where the thermostat is? I realize I can make my own but if there is a cheap product out there that does it all then I would rather do that.
Also i decided to go ahead and write my own lcd library for the wixel so we will see how it goes.
Project Update: I have the wixel acting as a thermostat working and transmitting successfully to another wixel on a arduino shield (I implemented a LCD and Button Debounce Library). However I am struggling with the getting the wixel on the shield to then transmit the packet it received from the thermostat wixel to the arduino (you would think this would be the easy part ).
It doesn’t appear the arduino is receiving anything as once i receive the packet i write it to the com port on my computer.
I’m not sure if this is a problem with my wixel code (most likely) or arduino code, though there really is much to the latter.
Anyway, I have tried a bunch of different things with no success and am sure its just something small I am overlooking but I’m burnt out for now and am seeking another perspective.
Any help would be appreciated,
Controller.c (2.19 KB)
wireless_hub.c (4.23 KB)
Congratulations on your progress so far!
In wireless_hub.c, which appears to be the code for the Wixel connected to the Arduino, I noticed you have lines of code like this:
if ((rxPacket = (Report XDATA *)radioQueueRxCurrentPacket()) && usbComTxAvailable() >= 64)
Is that Wixel plugged into a computer via USB and are you connected to it with a terminal program? If not, then the usbComTx buffers will eventually fill up and you will be unable to process any radio packets.
It looks like you are printing data to the USB virtual COM port for debugging. What does the debugging output look like? If the Wixel is printing packets to its virtual COM port then it probably is sending them to the Arduino.
In Controller.c, you wrote “flag == 1;”. You probably meant “flag = 1;”, but you could easily refactor your code to get rid of the flag variable.
Yes the Wixel is plugged into my computer via USB and im running windows terminal for debugging purposes only.
Yea, the only reason i have those print statements is debugging, once its working i will be removing them, and all data coming over the wireless will go straight to arduino via uart. The debuggin output looks fine, all the info coming from the thermostat wixel is being received by this wixel and i can print it to the usb just fine. Its sending it over UART to the arduino that isn’t working.
Yea i originally put that flag check in there so that it would only print once all 9 of the bytes were received. I can easily remove it now but that’s not my problem.
Thanks for the reply, I will keep working on it but if you can think of anything else let me know. Just to make sure all you have to do to send our the UART is command below correct? No command to tell it your done loading the buffer and to send right?
uart1TxSendByte(32); // if i want to send a 32 over the UART
That flag is definitely one of your problems. You are never setting it to 1, but you are depending on it to be 1 at a later point in your code.
Thanks for the help, when saying its not my problem i just meant that i added the flag thing after trying a bunch of other stuff to get the uart to work. So though it was incorrect it wasn’t the underlining issue.
However I did figure out what my problem was, the transmission was working but the way i was trying to view it was the problem. If you use Serial.print(byte) then viewing with the com viewer on the arduino ide works but the format gets jacked up when it sends it back to the wixel so viewing it over usb on the wixel is messed. however if you use Serial.write(byte) then the format is jacked up viewing it on the arduino com viewer but transmits fine to the wixel for viewing. If that made sense.
Anyway thanks again I will try to keep the post updated with progress.
I’m planning on doing a similar project, and I’m wondering how your project worked out for you. I am especially interested in how to write to the LCD.
Keith E. Cooper