Monday 30 November 2015

Hackaday Links: November 29, 2015

The Raspberry Pi Zero was announced this week, so you know what that means: someone is going to destroy a Game Boy Micro. If you’re interested in putting the Zero in a tiny handheld of your own design, here are the dimensions, courtesy of [Bert].

[Ahmed] – the kid with the clock – and his family are suing his school district and city for $15 Million. The family is also seeking written apologies from the city’s mayor and police chief.

There are a lot — a lot — of ‘intro to FPGA’ boards out there, and the huge variety is an example of how the ‘educational FPGA’ is a hard nut to crack. Here’s the latest one from a Kickstarter. It uses an ICE40, so an open source toolchain is available, and at only $50, it’s cheap enough to start digging around with LUTs and gates.

Over on Hackaday.io, [Joseph] is building a YAG laser. This laser will require a parabolic mirror with the YAG rod at the focus. There’s an interesting way to make one of these: cut out some acrylic and beat a copper pipe against a form. A little polish and nickel plating and you have a custom mirror for a laser.

You know those machines with wooden gears, tracks, and dozens of ball bearings? Cool, huh? Tiny magnetic balls exist, and the obvious extension to this line of thought is amazing.

[David WindestÃ¥l] is awesome. Completely and totally awesome. Usually, he’s behind the controls of an RC plane or tricopter, but this time he’s behind a slo-mo camera, an RC heli, and a watermelon. That’s a 550-sized heli with carbon fiber blades spinning at 2500 RPM, shot at 1000 FPS.

How do you label your cables? Apparently, you can use a label printer with heat shrink tubing. Nothing else, even: just put heat shrink through a label maker.


Filed under: Hackaday Columns, Hackaday links

from Hackaday » raspberry pi http://ift.tt/1Pm13pI
via Hack a Day

Thursday 26 November 2015

Grab the Raspberry Pi Annual now!

Everything you need to get the most from Raspberry Pi!

Our second Raspberry Pi Annual comes out as Raspberry Pi gears up to celebrate it’s fourth birthday and the staggering 5 million units that have been sold so far. In this book we’ll show you how to set up, supercharge and hack your Pi.

You can get your copy now from the best newsagents, supermarkets and, as ever, the Imagine Shop

001_RPA_002_Eshop 022_RPA_01 166_RPA_01

from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1Oiodff
via IFTTT

The $5 Raspberry Pi Zero

Monday 23 November 2015

Hackaday Links: November 22, 2015

There’s a new documentary series on Al Jazeera called Rebel Geeks that looks at the people who make the stuff everyone uses. The latest 25-minute part of the series is with [Massimo], chief of the arduino.cc camp. Upcoming episodes include Twitter co-creator [Evan Henshaw-Plath] and people in the Madrid government who are trying to build a direct democracy for the city on the Internet.

Despite being a WiFi device, the ESP8266 is surprisingly great at being an Internet of Thing. The only problem is the range. No worries; you can use the ESP as a WiFi repeater that will get you about 0.5km further for each additional repeater node. Power is of course required, but you can stuff everything inside a cell phone charger.

I’ve said it before and I’ll say it again: the most common use for the Raspberry Pi is a vintage console emulator. Now there’s a Kickstarter for a dedicated tabletop Raspi emulation case that actually looks good.

Pogo pins are the go-to solution for putting firmware on hundreds of boards. These tiny spring-loaded pins give you a programming rig that’s easy to attach and detach without any soldering whatsoever. [Tom] needed to program a few dozen boards in a short amount of time, didn’t have any pogo pins, and didn’t want to solder a header to each board. The solution? Pull the pins out of a female header. It works in a pinch, but you probably want a better solution for a more permanent setup.

Half of building a PCB is getting parts and pinouts right. [Josef] is working on a tool to at least semi-automate the importing of pinout tables from datasheets into KiCad. This is a very, very hard problem, and if it’s half right half the time, that’s a tremendous accomplishment.

Last summer, [Voja] wrote something for the blog on building enclosures from FR4. Over on Hackaday.io he’s working on a project, and it’s time for that project to get an enclosure. The results are amazing and leave us wondering why we don’t see this technique more often.


Filed under: Hackaday Columns, Hackaday links

from Hackaday » raspberry pi http://ift.tt/1I5aYxq
via Hack a Day

Sunday 22 November 2015

Inferno OS on Raspberry Pi

Unix isn’t the only operating system that came out of Bell Labs. In an effort to decouple hardware from user interfaces over a network, Bell also developed an OS named Plan 9 (named after the famously bad Ed Wood movie).  While Plan 9 is still in use, it never got the momentum that Unix did. In 1996, Bell Labs (now AT&T) decided to shift its focus to Inferno, an operating system  that was meant to challenge Java as a cross-platform virtual machine environment. Now LynxLine Labs has ported Inferno to the Raspberry Pi.

Not only did they do the work, they documented it in 26 labs if you want to follow along. Or, you can just head over to the project page and get the results along with updates (judging from the commit log, the project is under active development).

Dante would be proud, as the company that is now maintaining Inferno is  named Vita Nuova Holdings. The virtual machine is named Dis, the base language is Limbo, and the communications protocol is named Styx. Styx, by the way, is identical to the latest Plan 9 file system protocol.

Given its heritage, it isn’t very surprising that Plan 9 and Inferno share a lot of common ideas. In particular, all resources are files, even network resources. Styx manages all communications to resources, both local and remote. It isn’t quite the same as Raspberry Pi, but Sandia National Labs has even ported Inferno to an Android phone (see video below).

If you are looking for more education on using the Pi for OS development, we found a course for that. If you are impressed that Plan 9 and Inferno make all resources look like files via software, don’t forget that you can do it with hardware, too.


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1I8K0zr
via Hack a Day

Saturday 21 November 2015

DOE Announces a High Performance Computing Fortran Compiler Agreement

The U.S. Department of Energy’s National Nuclear Security Administration (NNSA) and its three national labs this week announced they have reached an agreement for an open-source Fortran front-end for Higher Performance Computing (HPC). The agreement is with IBM? Microsoft? Google? Nope, the agreement is with NVIDIA, a company known for making graphics cards for gamers.

The heart of a graphics card is the graphics processor unit (GPU) which is an extremely powerful computing engine. It’s actually got more raw horsepower than the computer CPU, although not as much as many claim. A number of years ago NVIDIA branched into providing compiler toolsets for their GPUs. The obvious goal is to drive sales. NVIDIA will use as a starting point their existing Fortran compiler and integrate it with the existing LLVM compiler infrastructure. That Fortran, it just keeps chugging along.

You can try out GPU programming on your Raspberry Pi. Yup! Even it has one, a Broadcom. Just follow the directions from Raspberry Pi Playground. You’re going to get your hands dirty with assembly language so this is not for the faint hearted. One of the big challenges with GPUs is exchanging data with them which gets into DMA processing. You could also take a look at [Pete Warden’s] work on using the Pi’s GPU.

Still wondering about the performance of CPU vs GPU? Here’s Adam Savage taking a look…


Filed under: news

from Hackaday » raspberry pi http://ift.tt/1QAOaIB
via Hack a Day

Friday 20 November 2015

Code Craft-Embedding C++: Hidden Activities?

What is an embedded system? The general definition is a computer system dedicated to a specific purpose, i.e. not a general purpose system usable for different tasks. That is a very broad definition. I was just skimming the C++ coding guidelines for the Joint Strike Fighter. That’s a pretty big embedded system and the first DOD project that allowed C++! When you use an ATM to get money you’re using an embedded system. Those are basically hardened PCs. Then at the small end we have all the Internet of Things (IoT) gadgets.

The previous articles about embedding C++ discussing classes, virtual functions, and macros garnered many comments. I find both the positive and critical comments rewarding. More importantly, the critical comments point me toward issues or questions that need to be addressed, which is what got me onto the topic for this article. So thank you, all.

Let’s take a look at when embedded systems should or should not use C++, taking a hard look at the claim that there may be hidden activities ripe to upset your carefully planned code execution.

Limits of Embedded Development Boards

Embedded systems are often thought of as having limited resources, e.g. memory, processing power. Having real-time constraints is another requirement frequently brought up. While those do occur in embedded systems they are not defining characteristics.

At some point a processor or memory limits preclude using C++, and often even C. Vendors might resort to a restricted version of C on some processors to provide a high-level language capability, an effort that would be silly for C++.

But we’ve not hit the limit on the boards used in these articles. We see with the Arduino Uno and its relatives that C++ is usable. The Uno is restricted to a subset of C++, in part because the developers did not have a C++ standard library available. (If you really want one, there are ports of the STL for the Uno.) The compiler in the Uno toolset supports C++11 and there is some support for C++14, but I haven’t explored the latter to know what is usable. There are capabilities in C++11, and C+14, that improve C++ use in embedded systems.

The Due, a larger Arduino board I’ve used to contrast with the Uno, does have the full standard library. Switch over to the Raspberry Pi, or equivalents, where you not only get the GCC toolset but can run Eclipse on the board, and it feels like the sky’s the limit.

Should You C++?

While all the above is valid, it misses a critical point. The issue isn’t whether you can use C++ on the smaller systems but whether solving the problem needs C++’s capabilities. What I’m suggesting is changing the question from “Can you use C++?” to “Should you use C++?”

We’ve addressed some of the really basic objections to using C++. Code bloat is not the great explosion folks imagine. Virtual functions are not super slow. But the comments raise other issues. One comment advised against using C++ because of the hidden activities. Specifically mentioned were copy constructors, side effects, hidden allocation, and unexpected operations.

What is a copy constructor, and why do we need one? It’s a constructor that makes a copy of an existing instance. Any time a copy is made the copy constructor is called. Recall that all constructors initialize instances so they are ready to be used.

A copy constructor is required if you pass a parameter by value. That’s a copy. Returning a value from a function causes a copy, although a decent compiler will optimize it away. Assignment also involves making a copy.

With built in types the cost of a copy is low, except maybe if you are using long doubles at 16 bytes a value. For large data structures a copy can be expensive and can be tricky. Rather than bemoan that C++ does copies, we need to recognize they are a necessity. That recognition means we can work to avoid them and get them right when they are needed.

One way to avoid copies is to pass structures by reference. In C, passing by pointer is a pass by reference. C++ allows that and introduces the reference operator. The reference operator is not just syntactic sugar. For example, references eliminate the dangling pointer problem since you cannot have a null reference.

Which brings up the ownership problem with pointers and the questions they raise for data structure copies. Quite frequently, even in C++, a data structure contains a pointer to another data structure. When you make a copy who owns the structure at the end of the pointer? Do you copy the pointer or the data? If you just copy the pointer you are sharing data between the two copies. One copy can modify the data in the other copy. That is usually not a good thing. Copying the data might be expensive. Also, who ultimately decides when the target of a pointer is deleted, or even if it should be deleted?

C++ doesn’t introduce a problem with copy constructors; it highlights a requirement that needs to be addressed, sometimes by looking to the problem requirements. What is needed by the solution when a copy is made?

Copying Data

In my robotics work I use an inertial measurement unit (IMU) to help track position and bearing, the robot’s pose. Inside the IMU are an accelerometer, a gyroscope, and a compass. The accelerometer and gyroscope both provide data as a triple of data, i.e. measurements in x, y, and z axis. There are a number of operations that need to be done on that data to make it usable, many more than we want to look at here. But we can look at how to handle this triple of data and to add a triple of values together. This is done with the gyroscope since it reports the angular rate of change per unit of time. By accumulating those readings you can obtain, theoretically, the bearing of the robot.

C++ Implementation

Here’s the declaration of the class Triple and the overloaded addition operator:

class Triple {
public:
        Triple() = default; // C++11 use default constructor despite other constructors being declared
        Triple(const Triple& t);    // copy constructor so we can track usage
        Triple(const int x, const int y, const int z);

        const Triple& operator +=(const Triple& rhs);

        int x() const;
        int y() const;
        int z() const;
private:
        int mX { 0 };   // C++11 member initialization
        int mY { 0 };
        int mZ { 0 };
};

inline Triple operator+(const Triple& lhs, const Triple& rhs);

I’m using a number of C++11 features here. They’re marked, and the implications for most are obvious if you are familiar with earlier versions of C++. The line with Triple() = default; probably isn’t obvious. It requests that the compiler generate the default constructor. Without it we couldn’t create a variable with no arguments on the constructor: Triple t3;. Normally the default constructor is only created by the compiler when no other constructors are defined. Since Triple has two other constructors there would be no default constructor. I requested one using the notation so variables could be created without arguments.

The next constructor, Triple(const Triple& t), is the copy constructor. It is not needed for this class since C++ would have generated one by default that would have worked fine for this simple class. I created it to show how one works and illustrate where it is invoked. This uses a new C++11 feature where a constructor can invoke another constructor to handle the initialization. This came into being to avoid code duplication, which often led to errors, or the use of a class member to perform initialization.

The final constructor allows us to initialize a Triple with three values. Those three values are stored in the data members of the class.

The next function overloads the plus equals operator. It turns out that the most effective way to implement the actual addition operator, seen a few lines below, is to first implement this operator.

The remaining functions are getters because they allow us to get data from the class. Some classes also have setters that allow setting class values. We don’t want them in Triple.

Here are the implementations of the arithmetic operators:

inline const Triple& Triple::operator +=(const Triple& rhs) {
        mX += rhs.mX;
        mY += rhs.mY;
        mZ += rhs.mZ;
        return *this;
}

inline Triple operator+(const Triple& lhs, const Triple& rhs) {
        Triple left { lhs };
        left += rhs;
        return left;
}

The first operator is straightforward; it simply applies the plus equal operator to each value in the class and returns the instance as a reference. This operator modifies the data in the calling object so the returned reference is valid.

The addition operator uses the plus equal operator in its implementation. Here is where the copy constructor comes into play. We have to create a new object to hold the result so one is created from the lhs value. That’s a copy.

The rhs is added to the new object using plus equal operator and the result returned by value, not by reference. The return is another copy. It cannot be returned by reference because the result object, left, was created inside the function.

There are two possible copies in any arithmetic operator. However, C++ in the standard specifically allows compilers to optimize away the copy for the return value. This is the return value optimization. You’re welcome to try adjusting the code, but there is no way you can avoid creating a copy or two somewhere during this operation.

This code will run on an Arduino, but I created it and ran it on Linux so I could step through the operations to verify where the copy constructor was called and where it wasn’t.

How do you use this? Pretty much the same as any arithmetic operation:

        Triple t1 { 1, 2, 3 };
        Triple t2 { 10, 20, 30 };

        Triple t3 { t1 + t2 };

C Implementation

What would a similar implementation look like in C? How about this:

struct Triple {
        int mX;
        int mY;
        int mZ;
};

void init(struct Triple* t, const int x, const int y, const int z) {
        t->mX = x;
        t->mY = y;
        t->mZ = z;
}
struct Triple add(struct Triple* lhs, struct Triple* rhs) {
        struct Triple result;
        result.mX = lhs->mX + rhs->mX;
        result.mY = lhs->mY + rhs->mY;
        result.mZ = lhs->mZ + rhs->mZ;
        return result;
}

Overall it looks shorter and neater. The struct Triple contains the three data items for the axis. The routine init sets them to user specified values. The add function adds two Triples and returns the result. The add routine avoids initializing result because we know its content will be overwritten by the addition operations. That’s a bit of a savings for C. There is still a copy when the function returns the value. You just don’t have any control of how that copy is done. In this simple situation it doesn’t matter but with a more complicated data structure, say, one with pointers, the copy might be more challenging. We’d probably need to resort to an output parameter using pass by reference with pointers instead of a return value.

Here is how it is used:

        struct Triple t1;
        init(&t1, 1, 2, 3);

        struct Triple t2;
        init(&t2, 10, 20, 30);

        struct Triple t3 = add(&t1, &t2);

Two values are created and initialized and then added. Simple, but you’ve got to remember to take the addresses of the structures and to assure the init routine is only called once.

Consider how the two different versions would look if you implemented a complicated expression. I’ll just say I know which I would prefer.

Wrap Up

I didn’t start this article intending to do a direct comparison between the two languages. I only wanted to illustrate that the copy constructor is, if you insist, a necessary evil. Copies occur in multiple places in both C++ and C. They become critical to understand in C++ when using user defined data types, i.e. classes. Copying in C is less obvious but still necessary.

Since I didn’t intend to make a comparison, I don’t have code size or timings for the two versions. As I pointed out and demonstrated in the article on virtual functions, comparing these simple examples on those parameters is often misleading. A C++ capability is used to solve a problem, not just as an exercise of the language features. Only if an equivalent solution in C is created is a comparison valid.

The Embedding C++ Project

Over at Hackaday.io, I’ve created an Embedding C++project. The project will maintain a list of these articles in the project description as a form of Table of Contents. Each article will have a project log entry for additional discussion. Those interested can delve deeper into the topics, raise questions, and share additional findings.

The project also will serve as a place for supplementary material from myself or collaborators. For instance, someone might want to take the code and report the results for other Arduino boards or even other embedded systems. Stop by and see what’s happening.


Filed under: Hackaday Columns, Software Development

from Hackaday » raspberry pi http://ift.tt/1PExorD
via Hack a Day

Thursday 19 November 2015

Pick up the Linux & Open Source Annual now

Get the inside track on all of the latest Linux and open source news and developments with the brand new Linux & Open Source Annual.

001_L&OSA_001_US

Featuring LinuxCon Europe 2015, Linux mobile systems and practical tutorials to help enhance your open source system, this is a comprehensive read for all Linux users.

041_L&OSA_001 103_L&OSA_001 133_L&OSA_001

With reviews of a selection of the year’s distros and features to help you master the command line, virtualise Linux and much more, don’t miss this annual. You can get your copy now from the best newsagents, supermarkets and, as ever, Imagine Shop, for the price of £14.99.



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1PPJq07
via IFTTT

DevOps explained in issue #159

The new issue of Linux User & Developer hits the shelves today – you can also order a copy from our eshop, or download it on Android, Zinio and iOS.

DevOps is in the spotlight this month. We show you how to use some of the key tools for deploying and managing containers, like Vagrant, Docker and Puppet, so you can develop and launch your software faster than ever. We also go in-depth with CoreOS, the distro built for clustered containers, and we speak to Mitchell Hashimoto about Otto, the successor to Vagrant.

DevOps explained in issue #159

As well as that, there are some great tutorials on getting the perfect Plasma 5 desktop, compiling your own software and creating GUIs with MonoDevelop – we’ll be tackling graphics in MonoGame next month, the framework behind Fez, so stay tuned if you’re interested in coding cross-platform games. The systems programming and computer science series also continue in this issue, with a look at the stat() family of system calls and a guide to storing and retrieving key-value pairs in hash tables.

For the Rasperry Pi fans, we return to the Pi-Mote IR and show you how to hack robots, and we start out on a re-creation of arcade classic Tempest using FUZE BASIC – you can also win one of three FUZE workstations that we’re giving away in the new year! Plus, there’s this excellent guide to the new Pygame Zero, which simplifies game creation with the Pygame library by removing the boilerplate material and enabling you to get straight to your ideas:

Pygame Zero

Finally, Gareth Halfacree tests out Compulab’s fanless mini PC, the Fitlet iA10, and we’ve rounded up the best backup tools for you along with some excellent FOSS packages. We hope you enjoy the new issue!

Linux User & Developer #159



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1Yi1LFS
via IFTTT

Monday 16 November 2015

Win a FUZE Special Edition

 

FUZE T2-SE-R

With decidedly retro roots, the award-winning FUZE is a programmable computer and electronics workstation. Born out of a passion for programming and love of electronics, the solid aluminium case features an integrated keyboard, a specially designed GPIO header and a breadboard for simple electronics. Housing the Raspberry Pi safely below the keyboard, the FUZE comes complete with FUZE BASIC already installed.

FUZE BASIC is an advanced, modernised version of the BASIC programming language, which was first developed at Dartmouth College back in 1964 and is widely accepted as the easiest beginner language to teach and learn. Featuring a redesigned interface and advanced graphics support, including sprite and image scaling, angle and alpha controls and rotation, FUZE BASIC is fully configured to run with all models of the Raspberry Pi. The whole FUZE system is slick and intuitive, and more than capable of programming web and mobile games.

The FUZE Special Edition T2-SE-R pays tribute to home computers of the 1980s like the BBC Micro, and comes complete with a robotic arm kit to integrate with your projects. The FUZE Special Edition also provides you with a projects pack and directs you to plenty of online resources at the FUZE Lair, giving you everything you need to get started. For more information, head over to www.fuze.co.uk.

To be in with a chance of winning one, just answer the following question:

When was the first BASIC program run?

This competition closes on 10th February 2016.

Raspberry Pi Robot Arm

FUZE



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1Li1eKY
via IFTTT

Sunday 15 November 2015

Processing for Raspberry Pi

You know Processing? It is the programming language and IDE aimed at the electronic arts, new media art, and visual design communities. [Gottfried Haider] recently got Processing working on the Raspberry Pi and included a hardware input/output library to manipulate the Pi’s I/O pins.

If you want to experiment with Processing, you can download it right on your Pi with the following command:

curl http://ift.tt/1MbxcfN | sudo sh

You can also download it from the download page. There’s a specific tutorial available or you can watch some general videos on Processing (see below).

[Ben Fry] and [Casey Reas] started Processing in the spring of 2001, while both were graduate students at the MIT Media Lab within John Maeda’s Aesthetics and Computation research group. It has proven popular as a first programming language, particularly for art classes.

There are many places you can download Processing sketches online. Presumably some Raspberry Pi-specific sketches will appear soon. We’ve seen Processing a few times in the past, but having it available on the Pi opens up a lot of opportunity if you want to use Processing or want to introduce students to the Pi with it.


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1lpK49k
via Hack a Day

Monday 9 November 2015

Gravity Pong Reaches Into the Sky

For a recent event [Norwegian Creations] decided to make something fun. They built what might just be the tallest free-standing gravity pong game out there. It’s 4.5m tall, and the LEDs in it draw over 100 amps!

What is Gravity Pong anyway? Well it’s a single person game where you get three “bounces”. A ball of light will drop from the top of the tube and the closer to the bounce-line you hit the button, the higher it will bounce. Your high score consists of how high you get the light — but if you miss the bounce line, you lose!

The structure itself is quite impressive. They’ve wrapped acrylic tubes with 1792 individually controllable RGB LEDs, in groups of four. Each section requires a power supply capable of putting out 27A @ 5V! The game is controlled by a Raspberry Pi 2 which controls a Pixelpusher to manipulate the LEDs. It’s connected to the Internet, so high scores can be automatically uploaded!

When it comes to pong though, we quite enjoy playing it with $5,000 construction crane controllers — because why not?


Filed under: led hacks, Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1MG7MUt
via Hack a Day

Thursday 5 November 2015

NEW! Raspberry Pi The Complete Manual

From the makers of Linux User & Developer comes the newly revised edition of Raspberry Pi The Complete Manual.

001_RPICM_005Eshop

From setting up your new device to Scratch and Python programming, this book will take you through the basics of your device, from setting up and basic navigation to tutorials that’ll help you take your skills a step further.

015_RPICM_001R3

There are also over 90 pages dedicated to step-by-step guides that’ll help you set up amazing practical projects such as adding a reset switch, printing wirelessly and more!

065_RPICM_02

The essential handbook for all Raspberry Pi users, Raspberry Pi The Complete Manual is on sale now from http://ift.tt/1v8N9K5 for just £7.99!



from Linux User & Developer - the Linux and FOSS mag for a GNU generation http://ift.tt/1Pd1OBf
via IFTTT

RPiTX Turns Rasberry Pi into Versatile Radio Transmitter

Since the discovery that some USB TV tuner dongles could be used to monitor radio waves across a huge amount of spectrum, the software-defined radio world has exploded with interest. The one limiting factor, though, has been that the dongles can only receive signals; they can’t transmit them. [Evariste Okcestbon, F5OEO] (if that is his real name!) has written some software that will get you transmitting using SDR with only a Raspberry Pi and a wire.

There have been projects in the past that use a Pi to broadcast radio (PiFM), but this new software (RPiTX) takes it a couple steps further. Using just an appropriately-sized wire connected to one of the GPIO pins, the Raspberry Pi is capable of broadcasting using FM, AM, SSB, SSTV, or FSQ signals. This greatly increases the potential of this simple computer-turned-transmitter and anyone should be able to get a lot of use out of it. In the video demo below the break, [Evariste] records a wireless doorbell signal and then re-transmits it using just the Rasbperry Pi.

The RPiTX code is available on GitHub if you want to try it out. And it should go without saying that you will most likely need an amateur radio license of some sort to use most of these features, depending on your locale. If you don’t have a ham radio license yet, you don’t need one to listen if you want to get started in the world of SDR. But a ham license isn’t hard to get and at this point it shouldn’t take much convincing for you to get transmitting.


Filed under: radio hacks

from Hackaday » raspberry pi http://ift.tt/1WByinK
via Hack a Day

Tuesday 3 November 2015

Dalek-Berry-Pi Mower

There’s something about lawn mowers and hackers. A desire to make them into smart, independent robots. Probably in preparation for the day when Skynet becomes self-aware or the Borg collective comes along to assimilate them into the hive. [Ostafichuk] wanted his to be ready when that happens, so he’s building a Raspberry-Pi powered, Dalek costumed Lawn Mower that is still a work in progress since starting on it in 2014. According to him,  “commercial robot lawn mowers are too expensive and not nearly terrifying enough to be any fun, so I guess I will just have to build something myself…”

His first report describes the basic skeletal structure he built using scrap pieces of wood. Two large lawn tractor wheels and a third pivot wheel help with locomotion. The two large wheels are driven by geared motors originally meant for car seat height adjustments. A deep cycle 12V battery, and solar panels for charging would take care of power. A raspberry-pi provides the brain power for the Dalek-Mower and L298N based drivers help drive the motors. The body was built from some more planks of scrap wood that he had lying around. While waiting around for several parts to arrive – ultrasonic sensors, accelerometer, 5V power supply modules – he started to paint and decorate the wood work. Generous amounts of water repellent paint and duct tape were used to make it weather proof. His initial plan was to use python for the code, but he later switched to programming in c along with wiringPi library. Code for the project is available from his bitbucket git repository. Load testing revealed that the L298N drivers were not suitable for the high current drawn by the motors, so he changed over to relays to drive them.

Before starting work on the lawn mowing part, the Dalek-Mower was put to good use during Halloween, after which he put the hardware in storage and got to work on the code. One of his goals was to use the Raspberry-pi cameras for a vision system and markers spread around his yard as waypoints. Getting the RaspiCam to work proved more difficult than he anticipated. After a fruitless struggle to get his c code working he moved to using C++. This part still looks like it needs refinement and it seems to be stretching the Pi to its computing limits. Eventually, he removed all of the raspicam functionality that he had coded, and instead used another video streaming solution.

A web interface now allows him to remotely control functions on the Dalek-Mower such as motor movement controls, playing audio clips, lighting control and several others for future use – Mower, Patrol, Fire Nerf Gun. [ostafichuk] has put in quite a lot of work over almost a year, and we hope he gets the Dalek-Mower ready for whatever sci-fi scenario comes our way in the future. Check the video below of the Dalek-Mower controlled via tablet by [ostafichuk]-junior.

And while on the subject, check out this Robotic Lawn Mower which is the only household robot to make the semifinalists in The Hackaday Prize this year.


Filed under: Holiday Hacks, robots hacks

from Hackaday » raspberry pi http://ift.tt/1iz0ni2
via Hack a Day

Monday 2 November 2015

Tracking the Hamster Marathon

[Michelle Leonhart] has two Roborovski hamsters (which, despite the name, are organic animals and not mechanical). She discovered that they seem to run on the hamster wheel all the time. A little Wikipedia research turned up an interesting factoid: This particular breed of hamster is among the most active and runs the equivalent of four human marathons a night. Of course, we always believe everything we read on Wikipedia, but not [Michelle]. She set out to determine if this was an accurate statement.

She had already added a ball bearing to the critters’ wheel to silence it by cannibalizing an old VCR. What she needed was the equivalent of a hamster pedometer. A Raspberry Pi and a Hall effect sensor did the trick. At least for the raw measurement. But it still left the question: how much distance is a hamster marathon?

01_hamster_stride_measurement[Michelle] went all scientific method on the question. She determined that an average human female’s stride is 2.2 feet which works out to 2400 strides per mile. A marathon is 26.2 miles (based on the distance Pheidippides supposedly ran to inform Athens of victory after the battle of Marathon). This still left the question of the length of a hamster’s stride. Surprisingly, there was no definitive answer, and [Michelle] proposed letting them run through ink and then tracking their footsteps. Luckily, [Zed Shaw] heard about her plan on Twitter and suggested pointing a webcam up through the plastic bottom of the cage along with a scale. That did the trick and [Michelle] measured her hamster’s stride at about 0.166 feet (see right).

Now it was a simple matter of math to determine that a hamster marathon is just under 10,500 steps. Logging the data to SQLite via ThingSpeak for a month led [Michelle] to the conclusion: her hamsters didn’t run 4 marathon’s worth of steps in a night. In fact, they never really got much over 2 marathons.

Does [Michelle] have lazy hamsters, or did she just add to our body of scientific knowledge about rodents? We don’t know. But we couldn’t help but admire her methods and her open source data logging code would probably be useful for some non-hamster activities.

If you are super competitive, you could use [Michelle’s] data to handicap yourself and challenge your pets to a race. But it would probably be cooler to build them their own Starship Trooper-style walkers. Either way, you can check out [Michelle’s] little marathon runners in the video below.


Filed under: Raspberry Pi

from Hackaday » raspberry pi http://ift.tt/1RL3XSb
via Hack a Day

Amazon

Donate

Donate Towards More Raspberry PI's for Projects