Skip to main content

finally got around to it (nrf24l0+ and servo)

On a previous post, I used the nrf24l01+ wireless chip to communicate between the Raspberry Pi and an Arduino, but only got lights to turn on.

I remember being confused as to why servos would not work, and somewhat left it there.

I started messing around with it again, and I am concluding that it might have been just a power issue.

Here is the servo moving properly:


The Arduino is on the ground due to the short length of the wires powering them.

Just as a recap, what is happening is:

- a C++ program using the RF24 library is compiled in the Raspberry Pi (connected to an nrf24l01+ chip) to broadcast a message. When executed, it will broadcast the message.
- the Arduino (connected to another nrf24l01+ chip) programmed to receive messages receives the message, and upon receipt sends a signal to an Arduino that is wired to the servo to move the servo.

Two separate Arduinos are used, as it seems that the servo library and the RF24 library do not seem to run properly together.

Anways, this finally opens up the potential of having a single Raspberry Pi control various devices in separate locations.

With these nrf24l01+ chips being as cheap as ~$2 a piece, (and ~$5 for an Arduino Pro Mini), it definitely sounds like a cheap way to automate various things around the house.

I might move out of my current apartment in a couple of weeks; maybe I'll start having the Raspberry Pi control more things around the house.

Comments

Popular posts from this blog

websockets and mobile networks and ssl

Gahhh. Just going to ramble on this one: Websockets is unstable going through cellular networks Searched Google and solution seems to be SSL connections Tried to implement, and it works to some extent,  but realized that I'll have to have both Apache, which was running my web front end, and Tornado both listen to 443 which cannot happen Realize finally that Tornado is a SERVER just like Apache Try to implement web client through Tornado It works but Websocket server and the web client still different instances so still can't have both listen, or that's what I'm thinking but I don't have time to think about it at present. Gotta sleep.

duty cycle testing

Now that I saw a physical response, I should try to make it similar to how a servo should be controlled. Servos are actuators that receive (expect) position input (as opposed to motors, which receive speed/intensity input). Simply put, it registers input as pulses, decoding the ratio of high (a "on" signal) to low in a given period as a position value.  A better explanation :  http://learn.adafruit.com/adafruits-raspberry-pi-lesson-8-using-a-servo-motor/servo-motors As I am waiting for my servo to be shipped, I will continue to work with the LED light.  As opposed to my previous setup of having the light turn on every time the request is given, I will have the light turn on and off in a regular pattern until a request is given, upon which the pattern will change for one "cycle" (on-and-off pair). The on-and-off logic (previously the LED control logic) will be run in a separate thread: def dCycle(*args):    global dCVal   ...