Monthly Archives: April 2018

DIY Moteino guide

via Dangerous Prototypes

p-image9-600

Felix writes, “I posted a short illustrated guide for making your own Moteino from SMD components. It also includes details how to burn the bootloader and fuses. Check it out here. Thanks and credit goes to forum user LukaQ for his contribution of the images and test sketches in this guide!

See the full post at LowPowerLab.

Enginursday: LilyPad and Minecraft Heads

via SparkFun: Commerce Blog

It is widely acknowledged that children love Minecraft. They also tend to love things that glow. So why not combine these into a super-mega-happy-awesome project? Behold, the Enderman head:

Enderman Costume

Spawned from an overabundance of cardboard boxes, a few extraneous Pixel Boards, and some spray paint and fancy sewing, we now have a glowy-eyed Enderman head that brings all the neighborhood kids to the yard.

To make this project, I used the following:

LilyPad Arduino USB - ATmega32U4 Board

DEV-12049
$24.95
7
Lithium Ion Battery - 850mAh

PRT-13854
$9.95
2
Conductive Thread Bobbin - 12m (Smooth, Stainless Steel)

DEV-13814
$3.95
LilyPad Pixel Board

DEV-13264
$3.95

The LilyPad line has some pretty amazing documentation - I followed the LilyPad Pixel Board Hookup Guide to get my board and pixel boards all hooked up. There’s also a wishlist in this hookup guide that has pretty much everything you need!

LilyPad Pixel Board Hookup Guide

If you’ve never worked with e-textiles or the LilyPad line, I recommend starting here:

Getting Started With LilyPad

In addition to the hookup guide wishlist, you will also need the following:

  • A box that fits your child’s head (SparkFun boxes are PERFECT)
  • Some black foam board
  • Black spray paint
  • Glue, tape, or a glue gun
  • Two opaque acrylic rectangles
  • A child

For the box, we glued the top flaps shut for the painting and left the bottom open for ease of assembly. Once we were all painted up, we cut an appropriately sized hole out of the bottom for the head to fit through. We also measured about halfway down the box and cut holes for the acrylic eye plates. Keep in mind that you will need to cut another hole above these eye plates so your kiddo can see out of the box. Also - don’t mount those acrylic plates yet!

Box and foam board cutouts

Now for the fun stuff! The Pixel Boards, Arduino and LiPo battery are all mounted on a foam board strip inside the box head.

I cut the foam board strip a little longer than the box width to help with mounting. I centered it on the box and folded the ends back as flaps. Once it was folded and in place, I marked where I wanted the glowing eyes from the front of the box.

Once I knew where the Pixel Board eyes would go, I set about sewing the Pixel Boards as well as the Arduino to the foam board strip. I mounted the Arduino controller on the backside of the strip so that the lithium battery could also be mounted on the back of the strip. This makes for easy access to the on/off switch and for battery charging. Again, refer back to the tutorials listed above if you have never worked with conductive thread.

Foam Strip with Arduino and Pixel boards

After verifying that the circuits were working and my Pixel Boards glowed a beautiful purple color, it was time to mount everything!

Start with the acrylic plates. I just used clear tape on the inside of the box to affix these guys into place. I also used spacers - three sets of them - to offset and stabilize the foam strip carrying the Pixel Boards. I used the same foam board (four thick) and my trusty glue gun to fix these into place. I then glued the Pixel Board flaps into place and switched it on.

Box Interior Lit up

A few notes:

  • Before sewing the circuits, I used a ballpoint pen to draw the connection lines on my foam strip to ensure connections would be made appropriately and that there would be no shorts. I also used the needle to poke holes along those circuit lines so that the actual sewing would be easier.

  • After sewing the circuits, I used a glue gun to seal the loose ends to the foam board. This prevents shorts from happening!

  • While I used clear packing tape to set both the acrylic eye plates as well as the battery in place, I used a glue gun to secure the foam board spacers as well as the Arduino and the flaps of the Pixel Board strip.

  • We ended up using black yarn to sew a baseball cap into the interior of the box (which was no small feat) to keep the box from sliding around on the kiddo’s head. We also ended up cutting an eye slot above the glowing eyes and putting a black mesh on the inside of it to keep his face obscured.

We had a great time making this project and it was a great way to get a kiddo involved and learning about circuits! What projects have you made with LilyPad? Let us know in the comments!

comments | comment feed

Continued: the answers to your questions for Eben Upton

via Raspberry Pi

Last week, we shared the first half of our Q&A with Raspberry Pi Trading CEO and Raspberry Pi creator Eben Upton. Today we follow up with all your other questions, including your expectations for a Raspberry Pi 4, Eben’s dream add-ons, and whether we really could go smaller than the Zero.

Live Q&A with Eben Upton, creator of the Raspberry Pi

Get your questions to us now using #AskRaspberryPi on Twitter

With internet security becoming more necessary, will there be automated versions of VPN on an SD card?

There are already third-party tools which turn your Raspberry Pi into a VPN endpoint. Would we do it ourselves? Like the power button, it’s one of those cases where there are a million things we could do and so it’s more efficient to let the community get on with it.

Just to give a counterexample, while we don’t generally invest in optimising for particular use cases, we did invest a bunch of money into optimising Kodi to run well on Raspberry Pi, because we found that very large numbers of people were using it. So, if we find that we get half a million people a year using a Raspberry Pi as a VPN endpoint, then we’ll probably invest money into optimising it and feature it on the website as we’ve done with Kodi. But I don’t think we’re there today.

Have you ever seen any Pis running and doing important jobs in the wild, and if so, how does it feel?

It’s amazing how often you see them driving displays, for example in radio and TV studios. Of course, it feels great. There’s something wonderful about the geographic spread as well. The Raspberry Pi desktop is quite distinctive, both in its previous incarnation with the grey background and logo, and the current one where we have Greg Annandale’s road picture.

The PIXEL desktop on Raspberry Pi

And so it’s funny when you see it in places. Somebody sent me a video of them teaching in a classroom in rural Pakistan and in the background was Greg’s picture.

Raspberry Pi 4!?!

There will be a Raspberry Pi 4, obviously. We get asked about it a lot. I’m sticking to the guidance that I gave people that they shouldn’t expect to see a Raspberry Pi 4 this year. To some extent, the opportunity to do the 3B+ was a surprise: we were surprised that we’ve been able to get 200MHz more clock speed, triple the wireless and wired throughput, and better thermals, and still stick to the $35 price point.

We’re up against the wall from a silicon perspective; we’re at the end of what you can do with the 40nm process. It’s not that you couldn’t clock the processor faster, or put a larger processor which can execute more instructions per clock in there, it’s simply about the energy consumption and the fact that you can’t dissipate the heat. So we’ve got to go to a smaller process node and that’s an order of magnitude more challenging from an engineering perspective. There’s more effort, more risk, more cost, and all of those things are challenging.

With 3B+ out of the way, we’re going to start looking at this now. For the first six months or so we’re going to be figuring out exactly what people want from a Raspberry Pi 4. We’re listening to people’s comments about what they’d like to see in a new Raspberry Pi, and I’m hoping by early autumn we should have an idea of what we want to put in it and a strategy for how we might achieve that.

Could you go smaller than the Zero?

The challenge with Zero as that we’re periphery-limited. If you run your hand around the unit, there is no edge of that board that doesn’t have something there. So the question is: “If you want to go smaller than Zero, what feature are you willing to throw out?”

It’s a single-sided board, so you could certainly halve the PCB area if you fold the circuitry and use both sides, though you’d have to lose something. You could give up some GPIO and go back to 26 pins like the first Raspberry Pi. You could give up the camera connector, you could go to micro HDMI from mini HDMI. You could remove the SD card and just do USB boot. I’m inventing a product live on air! But really, you could get down to two thirds and lose a bunch of GPIO – it’s hard to imagine you could get to half the size.

What’s the one feature that you wish you could outfit on the Raspberry Pi that isn’t cost effective at this time? Your dream feature.

Well, more memory. There are obviously technical reasons why we don’t have more memory on there, but there are also market reasons. People ask “why doesn’t the Raspberry Pi have more memory?”, and my response is typically “go and Google ‘DRAM price'”. We’re used to the price of memory going down. And currently, we’re going through a phase where this has turned around and memory is getting more expensive again.

Machine learning would be interesting. There are machine learning accelerators which would be interesting to put on a piece of hardware. But again, they are not going to be used by everyone, so according to our method of pricing what we might add to a board, machine learning gets treated like a $50 chip. But that would be lovely to do.

Which citizen science projects using the Pi have most caught your attention?

I like the wildlife camera projects. We live out in the countryside in a little village, and we’re conscious of being surrounded by nature but we don’t see a lot of it on a day-to-day basis. So I like the nature cam projects, though, to my everlasting shame, I haven’t set one up yet. There’s a range of them, from very professional products to people taking a Raspberry Pi and a camera and putting them in a plastic box. So those are good fun.

Raspberry Shake seismometer

The Raspberry Shake seismometer

And there’s Meteor Pi from the Cambridge Science Centre, that’s a lot of fun. And the seismometer Raspberry Shake – that sort of thing is really nice. We missed the recent South Wales earthquake; perhaps we should set one up at our Californian office.

How does it feel to go to bed every day knowing you’ve changed the world for the better in such a massive way?

What feels really good is that when we started this in 2006 nobody else was talking about it, but now we’re part of a very broad movement.

We were in a really bad way: we’d seen a collapse in the number of applicants applying to study Computer Science at Cambridge and elsewhere. In our view, this reflected a move away from seeing technology as ‘a thing you do’ to seeing it as a ‘thing that you have done to you’. It is problematic from the point of view of the economy, industry, and academia, but most importantly it damages the life prospects of individual children, particularly those from disadvantaged backgrounds. The great thing about STEM subjects is that you can’t fake being good at them. There are a lot of industries where your Dad can get you a job based on who he knows and then you can kind of muddle along. But if your dad gets you a job building bridges and you suck at it, after the first or second bridge falls down, then you probably aren’t going to be building bridges anymore. So access to STEM education can be a great driver of social mobility.

By the time we were launching the Raspberry Pi in 2012, there was this wonderful movement going on. Code Club, for example, and CoderDojo came along. Lots of different ways of trying to solve the same problem. What feels really, really good is that we’ve been able to do this as part of an enormous community. And some parts of that community became part of the Raspberry Pi Foundation – we merged with Code Club, we merged with CoderDojo, and we continue to work alongside a lot of these other organisations. So in the two seconds it takes me to fall asleep after my face hits the pillow, that’s what I think about.

We’re currently advertising a Programme Manager role in New Delhi, India. Did you ever think that Raspberry Pi would be advertising a role like this when you were bringing together the Foundation?

No, I didn’t.

But if you told me we were going to be hiring somewhere, India probably would have been top of my list because there’s a massive IT industry in India. When we think about our interaction with emerging markets, India, in a lot of ways, is the poster child for how we would like it to work. There have already been some wonderful deployments of Raspberry Pi, for example in Kerala, without our direct involvement. And we think we’ve got something that’s useful for the Indian market. We have a product, we have clubs, we have teacher training. And we have a body of experience in how to teach people, so we have a physical commercial product as well as a charitable offering that we think are a good fit.

It’s going to be massive.

What is your favourite BBC type-in listing?

There was a game called Codename: Druid. There is a famous game called Codename: Droid which was the sequel to Stryker’s Run, which was an awesome, awesome game. And there was a type-in game called Codename: Druid, which was at the bottom end of what you would consider a commercial game.

codename druid

And I remember typing that in. And what was really cool about it was that the next month, the guy who wrote it did another article that talks about the memory map and which operating system functions used which bits of memory. So if you weren’t going to do disc access, which bits of memory could you trample on and know the operating system would survive.

babbage versus bugs Raspberry Pi annual

See the full listing for Babbage versus Bugs in the Raspberry Pi 2018 Annual

I still like type-in listings. The Raspberry Pi 2018 Annual has a type-in listing that I wrote for a Babbage versus Bugs game. I will say that’s not the last type-in listing you will see from me in the next twelve months. And if you download the PDF, you could probably copy and paste it into your favourite text editor to save yourself some time.

The post Continued: the answers to your questions for Eben Upton appeared first on Raspberry Pi.

Getting started with Arduino cryptography

via SparkFun: Commerce Blog

I’m always looking for a way to teach difficult concepts in classroom settings, especially if I can lean on the confluence of my love of tinkering and my love of puzzles.

alt text

An Enigma code machine

I bought a new house several months ago and it has a garage. I don’t want to buy new garage remotes (that would be much too easy) when I can build them out of parts that SparkFun sells everyday. The thought occurred to me that it would be fun to do in encrypted wireless using an XBee module; that way I could program not only commands for the garage door, but for lights and the front door and anything else that I can put on electronic control.

alt text

A basic substitution cipher

At the heart of the way we do business on the web is RSA encryption. RSA is a brilliant and complicated way to encrypt information using large prime numbers. As many of us can remember from algebra, the prime factorization of large numbers can be very difficult. RSA relies on using this within a framework of modular exponentiation and totient equations to pass information safely.

All of this is very effective for secure banking transactions, but probably not necessary for turning on lights at my house.

alt text

alt text

An early puzzle box I built with BASIC STAMP.

When I started thinking about this problem I did, however, take some of the way we think about RSA encryption and applied it to a simple Arduino program. Here is how I thought about my problem:

  1. Using an Arduino base station to store an array of three-digit numbers.

  2. Use the random function in Arduino to generate a random number, store it in a variable and subtract it from a random place in the array.

  3. Pass the place in the array and difference generated to a client device as values separated by commas.

  4. If the client device has the matching array as the base station, it will subtract the number it received from the specific place in the array, and pass the difference back to the base station.

  5. The base station will add the answer it receives from the requesting device to the number stored in the variable. If the sum of these two things is equivalent to the place in the array that the base station has been working with, it will grant access to the client device.

Let’s look at this in action!

My array = {103,147,171,199}

My random number generated = 59

My random pace in the array = 2

So: 171-59 = 112

I pass to a device requesting access (2,112).

If that device has the same array stored on it as my key array on the base station, it will subtract what it received from the specified place in the array.

 171-112 = 59

I send back to the base station a request (like the character “r”) and 59, so the transmission would be (r,59).

The base station then adds the number it receives - if that number and the number it sent are equivalent to the value in that place in the array, it grants the request. In my Arduino code I have set it up so that our lights are red LEDs.

Here’s some Arduino code; test it with the serial terminal.

///////////////////////

int keys[]=

{117,161,173,187,199};

int arryPos=0;

char request;

int arrayPos;

int subtractNum;

int returnVal;

int red=0;

int blue=0;

int green=0;

void setup()

{
Serial.begin(9600);



pinMode(13,OUTPUT);

pinMode(12,OUTPUT);

pinMode(11,OUTPUT);

pinMode(10,OUTPUT);

pinMode(9,OUTPUT);


}


void loop()

{


//subtractNum=10;




  if(Serial.available()!=0)

  {

request= Serial.read();

 digitalWrite(13, HIGH);

if(request=='a')

{

arrayPos=(random(0,4));

subtractNum=(random(1,100));



delay(10);

Serial.print(arrayPos);

Serial.print(",");

Serial.println(keys[arrayPos]-subtractNum);


}

if(request=='r')

{

 returnVal=Serial.parseInt();

Serial.print("array val =");

Serial.println(keys[arrayPos]);

Serial.print(returnVal + keys[arrayPos]-subtractNum);//subtractNum=10+ x = 117

delay(50);

if(returnVal + keys[arrayPos]-subtractNum==keys[arrayPos])

{

digitalWrite(9,HIGH);

delay(350);

digitalWrite(9,LOW);

delay(350);

digitalWrite(9,HIGH);

delay(350);

digitalWrite(9,LOW);

delay(350);

digitalWrite(9,HIGH);

delay(350);

digitalWrite(9,LOW);

delay(350);

}

}


}

digitalWrite(13,LOW);

}

//////////////////////

When you get this code loaded to the Arduino, you can then follow these steps:

  1. Open a terminal in Arduino and send your board the character “a.”

alt text

  1. You will receive two values separated by commas. The first value is the place in the array, and the second value is what to subtract from the value in the array.

alt text

  1. Return the character “r,” separated from the difference with a comma.

alt text

  1. You should get a return equivalent to the array value and the sum of the two values. If you have an LED connected to pin 9, it should blink.

alt text

The next step is creating a device to send the serial commands. This could be another Arduino, and this is where it really opens up. The client could be a traditional remote with push-button function, or a keypad, or even a fingerprint reader.

I think the classroom applications of this project are particularly interesting. The idea I had was to let students “tune into” the traffic being passed back and forth, and try to figure out the key array based on the behavior of the packets – seems like a great hacking/cryptography prompt.

I am adding code to my GitHub page, so you are welcome to dig around there and take this further. Happy hacking!

comments | comment feed

How servo motors work and how to control servos using Arduino

via Dangerous Prototypes

p-Arduino-and-PCA9685-PWM-Servo-Driver-600

Dejan Nedelkovski over at HowToMechatronics shared detailed tutorial on how servo motors work and how to control servos using Arduino and PCA9685 PWM driver:

There are many types of servo motors and their main feature is the ability to precisely control the position of their shaft. A servo motor is a closed-loop system that uses position feedback to control its motion and final position.
In industrial type servo motors the position feedback sensor is usually a high precision encoder, while in the smaller RC or hobby servos the position sensor is usually a simple potentiometer. The actual position captured by these devices is fed back to the error detector where it is compared to the target position. Then according to the error the controller corrects the actual position of the motor to match with the target position.
In this tutorial we will take a detailed look at the hobby servo motors. We will explain how these servos work and how to control them using Arduino.

More details at HowToMechatronics.

Check out the video after the break.

 

Tackling climate change and helping the community

via Raspberry Pi

In today’s guest post, seventh-grade students Evan Callas, Will Ross, Tyler Fallon, and Kyle Fugate share their story of using the Raspberry Pi Oracle Weather Station in their Innovation Lab class, headed by Raspberry Pi Certified Educator Chris Aviles.

Raspberry Pi Certified Educator Chris Aviles Innovation Lab Oracle Weather Station

United Nations Sustainable Goals

The past couple of weeks in our Innovation Lab class, our teacher, Mr Aviles, has challenged us students to design a project that helps solve one of the United Nations Sustainable Goals. We chose Climate Action. Innovation Lab is a class that gives students the opportunity to learn about where the crossroads of technology, the environment, and entrepreneurship meet. Everyone takes their own paths in innovation and learns about the environment using project-based learning.

Raspberry Pi Certified Educator Chris Aviles Innovation Lab Oracle Weather Station

Raspberry Pi Oracle Weather Station

For our climate change challenge, we decided to build a Raspberry Pi Oracle Weather Station. Tackling the issues of climate change in a way that helps our community stood out to us because we knew with the help of this weather station we can send the local data to farmers and fishermen in town. Recent changes in climate have been affecting farmers’ crops. Unexpected rain, heat, and other unusual weather patterns can completely destabilize the natural growth of the plants and destroy their crops altogether. The amount of labour output needed by farmers has also significantly increased, forcing farmers to grow more food on less resources. By using our Raspberry Pi Oracle Weather Station to alert local farmers, they can be more prepared and aware of the weather, leading to better crops and safe boating.

Raspberry Pi Certified Educator Chris Aviles Innovation Lab Oracle Weather Station

Growing teamwork and coding skills

The process of setting up our weather station was fun and simple. Raspberry Pi made the instructions very easy to understand and read, which was very helpful for our team who had little experience in coding or physical computing. We enjoyed working together as a team and were happy to be growing our teamwork skills.

Once we constructed and coded the weather station, we learned that we needed to support the station with PVC pipes. After we completed these steps, we brought the weather station up to the roof of the school and began collecting data. Our information is currently being sent to the Initial State dashboard so that we can share the information with anyone interested. This information will also be recorded and seen by other schools, businesses, and others from around the world who are using the weather station. For example, we can see the weather in countries such as France, Greece and Italy.

Raspberry Pi Certified Educator Chris Aviles Innovation Lab Oracle Weather Station

Raspberry Pi allows us to build these amazing projects that help us to enjoy coding and physical computing in a fun, engaging, and impactful way. We picked climate change because we care about our community and would like to make a substantial contribution to our town, Fair Haven, New Jersey. It is not every day that kids are given these kinds of opportunities, and we are very lucky and grateful to go to a school and learn from a teacher where these opportunities are given to us. Thanks, Mr Aviles!

To see more awesome projects by Mr Avile’s class, you can keep up with him on his blog and follow him on Twitter.

The post Tackling climate change and helping the community appeared first on Raspberry Pi.