Stuff

How to tell Raspberry Pi from BeagleBone Black in C

Published by:

If you’ve got a cross-platform C or C++ program and want to compile it correctly for BeagleBone Black or Raspberry Pi, you can just use the C macro that corresponds with the ARM version. For example:

#include <stdio.h>

int main(int argc,char **argv)
{
#if defined __ARM_ARCH_6__
printf("Hello from RPI\n");
#elif defined __ARM_ARCH_7A__
printf("Hello from BBB\n");
#endif
return 0;
}

Arduino Neutrino

Neutrino Weather Is IN!

Published by:

Note: This is a continuation of a project started earlier.

 

The project details are outlined in the README of the github repo at neutrino-weather github

I got my boards this weekend. Luckily, they seem to work for the most part, with the one exception being that the DFN6 package I copied from somewhere seems to be a bit too small. I have a revision 1.2 being printed now. Still, I was able to carry on with the Bosch BMP180 sensor and get the modules sending data to my Raspberry Pi.

I learned a neat trick for soldering one-off surface mount boards. If you want to learn how to do surface mount soldering, I’d suggest trying this. ┬áThe guys at SparkFun swear by hotplate soldering. I didn’t want to mess with the nasty, toxic soldering paste, or solder mask for this small job. Instead, I touched each pad with solder, leaving a little bubble of raised solder on each one.

neutrino-solderbubble

Next, I put the board in a pan, and then carefully placed each part in its correct position. This isn’t that hard, but you do need some decent tweezers. I’d recommend curved ones like the Wiha 44510, as it’s easier to work around the parts and get into a populated board with the curved tip. Note, I used a teflon pan. You probably should not, as it will begin to smoke and release noxious gases if you get too hot. Here’s a pre-heated shot of the parts placed:

neutrino-partplace

Then, just carefully place the pan on a burner, turn the heat on high, and wait 60-90 seconds for the solder to look like it is flowing, and for the parts to sink into place. You can also use the tweezers to fine tune the position during this stage. When you’re done, you should end up with a professional-looking SMD solder job.

neutrino-soldered

Once done, you can solder any bigger pieces by hand. You need to ensure that all small parts are on one side of the board for this to work, of course.

Here’s a shot of the back of the board, with the battery clip and nRF24L01+ module installed.

neutrino-radio

I’m pretty excited about the progress I’m making with these little radios. I have them publishing data to my Raspberry Pi. The client publishes the data to a Zabbix server that I run at home, and also to an sqlite database. From this point, someone can do pretty much whatever they want by reading the data from the DB, and not have to mess with the radio or any C code. I’ve uploaded my work to github.

Here’s an example of two nodes publishing temperatures to Zabbix:
neutrino zabbix

Arduino Engineering

Lepton… Smallest Arduino-compatible Board?

Published by:

Update: fabbed boards are in. Waiting on parts.

leptonboard

 

I thought I’d take a shot at making my own AVR board. I wanted to see if I could fit four of them panelized on a 5cm x 5cm board, but still keep all of the features and access to the pins. This board is about the same area as a “Teensy 2.0”, but with more features. I chose an ATMega32u4, because it has USB built-in. I succeeded in cramming the design into the space, even preferring larger components for easier assembly. It even has a 3v3 regulator. The one thing I ended up cutting was a reset button, which I seem to never use anyway. The pins are accessible to wire one up if needed. My plan is to use female headers, like the BeagleBone does, so there’s no need to be breadboard compatible.Lepton

I dub thee Lepton. Now I’ve just got to get some fabbed and try them out.

Engineering

Software Defined Power

Published by:

I’ve got an idea for a new project. I’ve been working on the details over the last few weeks. As networking and server control in the datacenter are evolving into cloud and software-defined solutions, we need to pay attention to power control and evolve that as well. I’d like to initiate a solution for software-defined power controls.

Software defined power would consist of things like:

* Controlling the voltage of a port
* Controlling the branch circuits or lines feeding a port
* Auto detection of hardware connected to port, with software, not proprietary hardware
* Providing an open API standard that PDUs speak for configuration and data collection

PDUs already tend to have a lot of interesting software-defined features like port groups, load shedding, limits and alerts. These are usually only controllable through a proprietary web UI on the PDU or via a separate DC management software product. As such, there will never be advancement in the area because there can be no integration of tooling with third parties. There’s not much incentive for PDU vendors to provide this, because they want to sell their own solutions, but it hampers innovation for the end user.

Right now, if I have a 208v PDU and I want it to have a 120v port, I have to order a new PDU. It shouldn’t have to be that way. If I find a circuit is running hot and need to balance the lines, I have to go physically swap plugs. That shouldn’t be necessary. If I want to know which system is plugged into which outlet, I have to go trace cables and label the PDU in software. We shouldn’t have to. We should be able to fetch statistics and configure PDUs via an easy to use API, not SNMP.

To this end, I’m designing a reference board that will enable some of these features. I’m not sure what to do with it yet, perhaps if it works well and there’s interest I can go to kickstarter with it so that others can have copies of it to play with. I’ll figure out a name later.

Arduino Engineering Neutrino

NeutrinoWeather 1.0 – Design

Published by:

UPDATE: Over the weekend I made a minor tweak to NeutrinoWeather 1.0, rev’ing it to 1.1. This adds a 100uF cap to buffer the coin cell’s power output, which should extend life. I also designed NeutrinoWeather 2.0, which takes a stab at integrating the wireless onto the board rather than breaking it out into a pluggable module. I almost ditched that idea until I came across an awesome little antenna from Molex (for those who don’t know, a custom designed antenna technically requires FCC approval. A PCB antenna would probably be ok for personal use, but to give/sell to others without proper approval would probably be a no-no). It’s supposed to be better than the average pcb antenna, so we’ll see. 2.0 adds .2″ to the width of the board, but 1.8″ x 1.0″ is still pretty good, I think.

Original:

I’ve had this idea for awhile that I’d put temperature sensors in every room of the house. These would drive the HVAC based on an overall average, or on the room you choose at the moment, or whatever. Perhaps eventually they’d control dampers in the ducts. To be an ideal sensor (for me), it needs to be small, low maintenance, double as a hygrometer, be inexpensive, and be capable of going unnoticed. Most importantly, it needs to work, and this means having easy feedback that it’s doing its thing.

To these ends, I began looking for solutions and ran across Nathan Chantrell’s TinyTX project. It ultimately didn’t fit the bill, but it gave me some ideas. I ultimately designed my own small wireless temperature and humidity sensor device that can be hidden away on a shelf or dropped into a tiny project box and mounted via “Command Strip”. It has LED indicators that are capable of notifying the user that it is successfully sending radio updates (or not) and a low battery indicator. It also has three jumpers that allow the user to set one of eight radio addresses per-device (in binary), so the user can deploy up to seven transmitters and a receiver, without having to hardcode the addresses and flash each one. It will run off a single CR2450 coin cell (purchasable online in 5 or 10 pack for under $.50 each), and my hope is that each one will last at least 18 months. I thought about making a device that would hang off of a wall outlet, but such a device is far less flexible, and more difficult to make aesthetically pleasing for a homebrew project.

Screen Shot 2014-06-06 at 9.33.37 PM

For wireless, it utilizes the nRF24L01+ module that I’ve mentioned in the past, attaching via header on the back side. This will radio in to the raspberry pi base station, where I’ll control the HVAC via relays and serve up the controls via web interface.

The LEDs are high-output, low power. I expect to blink them for just a few milliseconds every time a measurement is made, and I’ve included a resistor to limit the current to just a few mA. Green for ‘radio transfer succeeded’ and red for failure. Amber will indicate low battery, less noticeable than a smoke alarm chirp I suppose. Of course, all of this notification can and will probably be done via the data, but there’s something about onboard indicators that make a product feel polished and complete.

As a bonus, I added a barometer onto the package, mostly just because I could. In all, the device measures 1.6″ wide and 1.0″ tall. With the wireless module and battery attached, it should end up about 8-10mm thick.

I’ve dubbed this tiny microcontroller platform ‘Neutrino’, since it both fits in with the particle theme of my blog and rhymes with Arduino. I named this particular one ‘NeutrinoWeather’, and hope to build several other Neutrino devices based on the same microcontroller on front, coin cell on back design. I toyed a bit with making a flexible design that exposed all of the pins via headers, but opted for the smaller single purpose design because 1) it’s cheap and easy to get small boards made, and 2) if I want to build something on a board that requires jumper wires, I’ve already got quite a few ATMega328 and ATTiny microcontroller boards floating around, and 3) If I do use jumper wires, it’s probably just intended as a prototype anyway.

I drew up the prototype in Eagle, the defacto hobbyist PCB making software. I tried to use Fritzing this time around, and while I found it a bit more intuitive and liked the visuals, I had a few issues (it crashed once, defining/editing packages via SVG seemed more difficult, and much simple and limited feature set) so I switched back to Eagle. It is advertised as beta software, after all. The board prototype has been shipped off to manufacturing, and with any luck I’ll be able to write an update in a couple of weeks and cover the code it will be running.

Screen Shot 2014-06-06 at 9.34.28 PM