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

dabbling with cylon

I'm playing around with Cylon JS whenever I have the time. in order to use the leap motion for control, the hand control will need to communicate with the pc that is connected to the leap motion device (leap motion does not provide an arm/linux driver). it seems that Cylon devices can communicate with each other through socket.io or http, and I am currently playing around with that.

nodejs migration

Having been playing around with NodeJS recently,  I (naturally?) started re-writing some of the OpenSesame code using Node last night. I think I've only worked on it around 2 hours so far, but I've already set up a basic client interface (a socket.io chat tutorial rip) with a server that the Raspberry Pi can connect to and receive requests to open the door.  This is probably due to socket.io's socket management (socket.io is the WebSocket module for Node); for my first implementation, I had to manually write up a structure that managed sockets, but that is pretty much handled by socket.io. Also, the servo control logic is pretty much recycled (and the Raspberry Pi code is still Python), and I do remember spending some good time figuring that out.  Cool neverthelss. I'll probably keep both versions around.

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.