Lateo.net - Flux RSS en pagaille (pour en ajouter : @ moi)

🔒
❌ À propos de FreshRSS
Il y a de nouveaux articles disponibles, cliquez pour rafraîchir la page.
À partir d’avant-hierRaspberry Pi

IoT gets a machine learning boost, from edge to cloud

Today, it’s easy to run Edge Impulse machine learning on any operating system, like Raspberry Pi OS, and on every cloud, like Microsoft’s Azure IoT. Evan Rust, Technology Ambassador for Edge Impulse, walks us through it.

Building enterprise-grade IoT solutions takes a lot of practical effort and a healthy dose of imagination. As a foundation, you start with a highly secure and reliable communication between your IoT application and the devices it manages. We picked our favorite integration, the Microsoft Azure IoT Hub, which provides us with a cloud-hosted solution backend to connect virtually any device. For our hardware, we selected the ubiquitous Raspberry Pi 4, and of course Edge Impulse, which will connect to both platforms and extend our showcased solution from cloud to edge, including device authentication, out-of-box device management, and model provisioning.

From edge to cloud – getting started 

Edge machine learning devices fall into two categories: some are able to run very simple models locally, and others have more advanced capabilities that allow them to be more powerful and have cloud connectivity. The second group is often expensive to develop and maintain, as training and deploying models can be an arduous process. That’s where Edge Impulse comes in to help to simplify the pipeline, as data can be gathered remotely, used effortlessly to train models, downloaded to the devices directly from the Azure IoT Hub, and then run – fast.

This reference project will serve you as a guide for quickly getting started with Edge Impulse on Raspberry Pi 4 and Azure IoT, to train a model that detects lug nuts on a wheel and sends alerts to the cloud.

Setting up the hardware

Hardware setup for Edge Impulse Machine Learning
Raspberry Pi 4 forms the base for the Edge Impulse machine learning setup

To begin, you’ll need a Raspberry Pi 4 with an up-to-date Raspberry Pi OS image which can be found here. After flashing this image to an SD card and adding a file named wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert 2 letter ISO 3166-1 country code here>

network={
	ssid="<Name of your wireless LAN>"
	psk="<Password for your wireless LAN>"
}

along with an empty file named ssh (both within the /boot directory), you can go ahead and power up the board. Once you’ve successfully SSH’d into the device with 

$ ssh pi@<IP_ADDRESS>

and the password raspberry, it’s time to install the dependencies for the Edge Impulse Linux SDK. Simply run the next three commands to set up the NodeJS environment and everything else that’s required for the edge-impulse-linux wizard:

$ curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
$ sudo apt install -y gcc g++ make build-essential nodejs sox gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base gstreamer1.0-plugins-base-apps
$ npm config set user root && sudo npm install edge-impulse-linux -g --unsafe-perm

Since this project deals with images, we’ll need some way to capture them. The wizard supports both the Pi Camera modules and standard USB webcams, so make sure to enable the camera module first with 

$ sudo raspi-config

if you plan on using one. With that completed, go to the Edge Impulse Studio and create a new project, then run the wizard with 

$ edge-impulse-linux

and make sure your device appears within the Edge Impulse Studio’s device section after logging in and selecting your project.

Edge Impulse Machine Learning screengrab

Capturing your data

Training accurate machine learning models requires feeding plenty of varied data, which means a lot of images are required. For this use case, I captured around 50 images of a wheel that had lug nuts on it. After I was done, I headed to the Labeling queue in the Data Acquisition page and added bounding boxes around each lug nut within every image, along with every wheel.

Edge Impulse Machine Learning screengrab

To add some test data, I went back to the main Dashboard page and clicked the Rebalance dataset button, which moves 20% of the training data to the test data bin. 

Training your models

So now that we have plenty of training data, it’s time to do something with it, namely train a model. The first block in the impulse is an Image Data block, and it scales each image to a size of 320 by 320 pixels. Next, image data is fed to the Image processing block which takes the raw RGB data and derives features from it.

Edge Impulse Machine Learning screengrab

Finally, these features are sent to the Transfer Learning Object Detection model which learns to recognize the objects. I set my model to train for 30 cycles at a learning rate of .15, but this can be adjusted to fine-tune the accuracy.

As you can see from the screenshot below, the model I trained was able to achieve an initial accuracy of 35.4%, but after some fine-tuning, it was able to correctly recognize objects at an accuracy of 73.5%.

Edge Impulse Machine Learning screengrab

Testing and deploying your models

In order to verify that the model works correctly in the real world, we’ll need to deploy it to our Raspberry Pi 4. This is a simple task thanks to the Edge Impulse CLI, as all we have to do is run 

$ edge-impulse-linux-runner

which downloads the model and creates a local webserver. From here, we can open a browser tab and visit the address listed after we run the command to see a live camera feed and any objects that are currently detected. 

Integrating your models with Microsoft Azure IoT 

With the model working locally on the device, let’s add an integration with an Azure IoT Hub that will allow our Raspberry Pi to send messages to the cloud. First, make sure you’ve installed the Azure CLI and have signed in using az login. Then get the name of the resource group you’ll be using for the project. If you don’t have one, you can follow this guide on how to create a new resource group. After that, return to the terminal and run the following commands to create a new IoT Hub and register a new device ID:

$ az iot hub create --resource-group <your resource group> --name <your IoT Hub name>
$ az extension add --name azure-iot
$ az iot hub device-identity create --hub-name <your IoT Hub name> --device-id <your device id>

Retrieve the connection string with 

$ az iot hub device-identity connection-string show --device-id <your device id> --hub-name <your IoT Hub name>
Edge Impulse Machine Learning screengrab

and set it as an environment variable with 

$ export IOTHUB_DEVICE_CONNECTION_STRING="<your connection string here>" 

in your Raspberry Pi’s SSH session, as well as 

$ pip install azure-iot-device

to add the necessary libraries. (Note: if you do not set the environment variable or pass it in as an argument, the program will not work!) The connection string contains the information required for the device to establish a connection with the IoT Hub service and communicate with it. You can then monitor output in the Hub with 

$ az iot hub monitor-events --hub-name <your IoT Hub name> --output table

 or in the Azure Portal.

To make sure it works, download and run this example to make sure you can see the test message. For the second half of deployment, we’ll need a way to customize how our model is used within the code. Thankfully, Edge Impulse provides a Python SDK for this purpose. Install it with 

$ sudo apt-get install libatlas-base-dev libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
$ pip3 install edge_impulse_linux -i https://pypi.python.org/simple

There’s some simple code that can be found here on Github, and it works by setting up a connection to the Azure IoT Hub and then running the model.

Edge Impulse Machine Learning screengrab

Once you’ve either downloaded the zip file or cloned the repo into a folder, get the model file by running

$ edge-impulse-linux-runner --download modelfile.eim

inside of the folder you just created from the cloning process. This will download a file called modelfile.eim. Now, run the Python program with 

$ python lug_nut_counter.py ./modelfile.eim -c <LUG_NUT_COUNT>

where <LUG_NUT_COUNT> is the correct number of lug nuts that should be attached to the wheel (you might have to use python3 if both Python 2 and 3 are installed).

Now whenever a wheel is detected the number of lug nuts is calculated. If this number falls short of the target, a message is sent to the Azure IoT Hub.

And by only sending messages when there’s something wrong, we can prevent an excess amount of bandwidth from being taken due to empty payloads.

The possibilities are endless

Imagine utilizing object detection for an industrial task such as quality control on an assembly line, or identifying ripe fruit amongst rows of crops, or detecting machinery malfunction, or remote, battery-powered inferencing devices. Between Edge Impulse, hardware like Raspberry Pi, and the Microsoft Azure IoT Hub, you can design endless models and deploy them on every device, while authenticating each and every device with built-in security.

You can set up individual identities and credentials for each of your connected devices to help retain the confidentiality of both cloud-to-device and device-to-cloud messages, revoke access rights for specific devices, transmit code and services between the cloud and the edge, and benefit from advanced analytics on devices running offline or with intermittent connectivity. And if you’re really looking to scale your operation and enjoy a complete dashboard view of the device fleets you manage, it is also possible to receive IoT alerts in Microsoft’s Connected Field Service from Azure IoT Central – directly.

Feel free to take the code for this project hosted here on GitHub and create a fork or add to it.

The complete project is available here. Let us know your thoughts at hello@edgeimpulse.com. There are no limits, just your imagination at work.

The post IoT gets a machine learning boost, from edge to cloud appeared first on Raspberry Pi.

Learn the Internet of Things with “IoT for Beginners” and Raspberry Pi

Want to dabble in the Internet of Things but don’t know where to start? Well, our friends at Microsoft have developed something fun and free just for you. Here’s Senior Cloud Advocate Jim Bennett to tell you all about their brand new online curriculum for IoT beginners.

IoT — the Internet of Things — is one of the biggest growth areas in technology, and one that, to me, is very exciting. You start with a device like a Raspberry Pi, sprinkle some sensors, dust with code, mix in some cloud services and poof! You have smart cities, self-driving cars, automated farming, robotic supermarkets, or devices that can clean your toilet after you shout at Alexa for the third time.

robot detecting a shelf restock is required
Why doesn’t my local supermarket have a restocking robot?

It feels like every week there is another survey out on what tech skills will be in demand in the next five years, and IoT always appears somewhere near the top. This is why loads of folks are interested in learning all about it.

In my day job at Microsoft, I work a lot with students and lecturers, and I’m often asked for help with content to get started with IoT. Not just how to use whatever cool-named IoT services come from your cloud provider of choice to enable digital whatnots to add customer value via thingamabobs, but real beginner content that goes back to the basics.

IoT for Beginners logo
‘IoT for Beginners’ is totally free for anyone wanting to learn about the Internet of Things

This is why a few of us have spent the last few months locked away building IoT for Beginners. It’s a free, open source, 24-lesson university-level IoT curriculum designed for teachers and students, and built by IoT experts, education experts and students.

What will you learn?

The lessons are grouped into projects that you can build with a Raspberry Pi so that you can deep-dive into use cases of IoT, following the journey of food from farm to table.

collection of cartoons of eye oh tee projects

You’ll build projects as you learn the concepts of IoT devices, sensors, actuators, and the cloud, including:

  • An automated watering system, controlling a relay via a soil moisture sensor. This starts off running just on your device, then moves to a free MQTT broker to add cloud control. It then moves on again to cloud-based IoT services to add features like security to stop Farmer Giles from hacking your watering system.
  • A GPS-based vehicle tracker plotting the route taken on a map. You get alerts when a vehicle full of food arrives at a location by using cloud-based mapping services and serverless code.
  • AI-based fruit quality checking using a camera on your device. You train AI models that can detect if fruit is ripe or not. These start off running in the cloud, then you move them to the edge running directly on your Raspberry Pi.
  • Smart stock checking so you can see when you need to restack the shelves, again powered by AI services.
  • A voice-controlled smart timer so you have more devices to shout at when cooking your food! This one uses AI services to understand what you say into your IoT device. It gives spoken feedback and even works in many different languages, translating on the fly.

Grab your Raspberry Pi and some sensors from our friends at Seeed Studio and get building. Without further ado, please meet IoT For Beginners: A Curriculum!

The post Learn the Internet of Things with “IoT for Beginners” and Raspberry Pi appeared first on Raspberry Pi.

Raspberry Pi smart IoT glove

Animator/engineer Ashok Fair has put witch-level finger pointing powers in your hands by sticking a SmartEdge Agile, wirelessly controlled by Raspberry Pi Zero, to a golf glove. You could have really freaked the bejeezus out of Halloween party guests with this (if we were allowed to have Halloween parties that is).

The build uses a Smart Edge Agile IoT device with Brainium, a cloud-based tool for performing machine learning tasks.

The Rapid IoT kit is interfaced with Raspberry Pi Zero and creates a thread network connecting to light, car, and fan controller nodes.

The Brainium app is installed on Raspberry Pi and bridges between the cloud and Smart Edge device. MQTT is running on Python and processes the Rapid IoT Kit’s data.

The device is mounted onto a golf glove, giving the wearer seemingly magical powers with the wave of a hand.

Kit list

  • Raspberry Pi Zero
  • Avnet SmartEdge Agile (the white box attached to the glove)
  • NXP Rapid IoT Prototyping Kit (the square blue screen stuck on the adaptor board with the Raspberry Pi Zero)
  • Brainium AI Studio app
  • Golf glove
Waking up the Rapid IoT screen

To get started, the glove wearer draws a pattern above the screen attached to the Raspberry Pi to unlock it and wake up all the controller nodes.

The light controller node is turned on by drawing a clockwise circle, and turned off with an counter-clockwise circle.

The full kit and caboodle

The fan is turned on and off in the same way, and you can increase the fan’s speed by moving your hand upwards and reduce the speed by moving your hand down. You know it’s working by the look of the fan’s LEDs: they blinker faster as the fan speeds up.

Make a pushing motion in the air above the car to make it move forward, and you can also make it turn and reverse.

“Driving glove”

If you wear the glove while driving, it collects data in real time and logs it on the Brainium cloud so you can review your driving style.

Keep up with Ashok’s projects on Twitter or Facebook.

The post Raspberry Pi smart IoT glove appeared first on Raspberry Pi.

Build an IoT device with Ubuntu Appliance and Raspberry Pi

Par : Helen Lynn

The new Ubuntu Appliance portfolio provides free images to help you turn your Raspberry Pi into an IoT device: just install them to your SD card and you have all the software you need to make a media server, get started with home automation, and more. Canonical’s Rhys Davies is here to tell us all about it.

We are delighted to announce the new Ubuntu Appliance portfolio. Together with NextCloud, AdGuard, Plex, Mosquitto and openHAB, we have created the first in a new class of Ubuntu derivatives. Ubuntu Appliances are software-defined projects that enable users to download everything they need to turn a Raspberry Pi into a device that does one thing – beautifully.

The Ubuntu Appliance mission is to enable you to build your own secure, self-updating, single-purpose devices. Tell us what you want to see next, or let’s talk about turning your project into the next Ubuntu Appliance in Discourse. For now, we are excited to bring these initial appliances to your attention.

The initial portfolio of five

  • Plex Media Server allows its users to organise and stream their own collection of movies, TV, music, podcasts and more from one place.
  • Mosquitto is a lightweight open source MQTT message broker, for use on all devices from low power single board computers to full-scale industrial grade servers.
  • OpenHAB is a pluggable architecture that allows users to design rules for automating their home, with time- and event-based triggers, scripts, actions, notifications and voice control.
  • AdGuard Home blocks annoying banners, pop-ups and video ads to make web surfing faster, safer and more comfortable.
  • NextCloud is an on-premise content collaboration platform that allows users to host their own private cloud at home or in the office.

How it all works

Head over to the Ubuntu Appliances website, click the appliance you would like, select download, follow the instructions, and away you go. Once you get to this stage, there are links to tutorials and documentation written by the upstream project themselves, so you can get next steps from the horse’s mouth. If you run into any bother let us know with a new topic and we’ll get on it.

But why bother?

The problem we are trying to solve is to do with the fragmentation in IoT. We want to give publishers and developers a platform to get their software in the hands of their users and into their devices. We work with them to securely bundle the OS, their applications and configurations into a single download that is available for anyone to turn a Raspberry Pi into a dedicated device. You can go to the portfolio and download as many of the appliances as you like and start using them today.

How to add your project to the Ubuntu Appliance portfolio

All of this gives a stage and a secure, production-grade base to projects. There are no restrictions on who can make an Ubuntu Appliance; all you need is an application that runs on a Raspberry Pi or another certified board, and to let us know what you’ve got so we can help you over the line. If you need more information, head to our community page where you’ll find the rules and the exact steps to become featured as an Ubuntu Appliance.

Try them out!

All that’s left to say is to try them out. All five of the initial appliances work on Raspberry Pi, so if you have one, you can get started. And if you don’t have one – maybe your Raspberry Pi is still in the post – then you can also ‘try before you Pi’: install the appliance in a virtual machine and see what you think.

The list of appliances is already growing. This launch marks the first five appliances, but we are already working with developers on the next wave and are looking for more. Start with these ones and go to our discourse to tell us what you think.

Thanks for having me, Raspberry Pi <3

The post Build an IoT device with Ubuntu Appliance and Raspberry Pi appeared first on Raspberry Pi.

Design your own Internet of Things with HackSpace magazine

In issue 31 of HackSpace magazine, out today, PJ Evans looks at DIY smart homes and homemade Internet of Things devices.

In the last decade, various companies have come up with ‘smart’ versions of almost everything. Microcontrollers have been unceremoniously crowbarred into devices that had absolutely no need for microcontrollers, and often tied to phone apps or web services that are hard to use and don’t work well with other products.

Put bluntly, the commercial world has struggled to deliver an ecosystem of useful smart products. However, the basic principle behind the connected world is good – by connecting together sensors, we can understand our local environment and control it to make our lives better. That could be as simple as making sure the plants are correctly watered, or something far more complex.

The simple fact is that we each lead different lives, and we each want different things out of our smart homes. This is why companies have struggled to create a useful smart home system, but it’s also why we, as makers, are perfectly placed to build our own. Let’s dive in and take a look at one way of doing this – using the TICK Stack – but there are many more, and we’ll explore a few alternatives later on.

Many of our projects create data, sometimes a lot of it. This could be temperature, humidity, light, position, speed, or anything else that we can measure electronically. To be useful, that data needs to be turned into information. A list of numbers doesn’t tell you a lot without careful study, but a line graph based on those numbers can show important information in an instant. Often makers will happily write scripts to produce charts and other types of infographics, but now open-source software allows anyone to log data to a database, generate dashboards of graphs, and even trigger alerts and scripts based on the incoming data. There are several solutions out there, so we’re going to focus on just one: a suite of products from InfluxData collectively known as the TICK Stack.

InfluxDB

The ‘I’ in TICK is the database that stores your precious data. InfluxDB is a time series database. It differs from regular SQL databases as it always indexes based on the time stamp of the incoming data. You can use a regular SQL database if you wish (and we’ll show you how later), but what makes InfluxDB compelling for logging data is not only its simplicity, but also its data-management features and built-in web-based API interface. Getting data into InfluxDB can be as easy as a web post, which places it within the reach of most internet-capable microcontrollers.

Kapacitor

Next up is our ‘K’. Kapacitor is a complex data processing engine that acts on data coming into your InfluxDB. It has several purposes, but the common use is to generate alerts based on data readings. Kapacitor supports a wide range of alert ‘endpoints’, from sending a simple email to alerting notification services like Pushover, or posting a message to the ubiquitous Slack. Multiple alerts to multiple destinations can be configured, and what constitutes an alert status is up to you. More advanced uses of Kapacitor include machine learning and anomaly detection.

Chronograf

The problem with Kapacitor is the configuration. It’s a lot of work with config files and the command line. Thoughtfully, InfluxData has created Chronograf, a graphical user interface to both Kapacitor and InfluxDB. If you prefer to keep away from the command line, you can query and manage your databases here as well as set up alerts, metrics that trigger an alert, and the configurations for the various handlers. This is all presented through a web app that you can access from anywhere on your network. You can also build ‘Dashboards’ – collections of charts displayed on a single page based on your InfluxDB data.

Telegraf

Finally, our ’T’ in TICK. One of the most common uses for time series databases is measuring computer performance. Telegraf provides the link between the machine it is installed on and InfluxDB. After a simple install, Telegraf will start logging all kinds of data about its host machine to your InfluxDB installation. Memory usage, CPU temperatures and load, disk space, and network performance can all be logged to your database and charted using Chronograf. This is more due to the Stack’s more common use for monitoring servers, but it’s still useful for making sure the brains of our network-of-things is working properly. If you get a problem, Kapacitor can not only trigger alerts but also user-defined scripts that may be able to remedy the situation.

Get HackSpace magazine issue 31 — out today

HackSpace magazine issue 31: on sale now!

You can read the rest of HackSpace magazine’s DIY IoT feature in issue 31, out today and available online from the Raspberry Pi Press online store. You can also download issue 31 for free.

The post Design your own Internet of Things with HackSpace magazine appeared first on Raspberry Pi.

IoT ugly Christmas sweaters

Par : Alex Bate

If there’s one thing we Brits love, it’s an ugly Christmas sweater. Jim Bennett, a Senior Cloud Advocate at Microsoft, has taken his ugly sweater game to the next level by adding IoT-controlled, Twitter-connected LEDs thanks to a Raspberry Pi Zero.

IoT is Fun for Everyone! (Ugly Sweater Edition)

An Ugly Sweater is great-but what’s even better (https://aka.ms/IoTShow/UglySweater) is an IoT-enabled Ugly Sweater. In this episode of the IoT Show, Olivier Bloch is joined by Jim Bennett, a Senior Cloud Advocate at Microsoft. Jim has built an Ugly Sweater using Azure IoT Central, Microsoft’s IoT app platform, and a Raspberry Pi Zero.

Jim upgraded his ugly sweater to become IoT-compatible using Microsoft’s IoT app platform Azure IoT Central, Adafruit’s programmable NeoPixel LED Dots Strand and, of course, our sweet baby, the Raspberry Pi Zero W.

After sewing the LED strand into the ugly sweater and connecting it to Raspberry Pi Zero, Jim was able to control the colour of the LEDs. Taking it one step further, he then built a list of commands within Azure IoT Central and linked the Raspberry Pi Zero to a Twitter account to create the IoT element of the project.

Watch the video above for full details on the project, and find all the code on Github.

The post IoT ugly Christmas sweaters appeared first on Raspberry Pi.

The world’s first Raspberry Pi-powered Twitter-activated jelly bean-pooping unicorn

Par : Alex Bate

When eight-year-old Tru challenged the Kids Invent Stuff team to build a sparkly, pooping, rainbow unicorn electric vehicle, they did exactly that. And when Kids Invent Stuff, also known as Ruth and Shawn, got in contact with Estefannie Explains it All, their unicorn ended up getting an IoT upgrade…because obviously.

You tweet and the Unicorn poops candy! | Kids Invent Stuff

We bring kids’ inventions to life and this month we teamed up with fellow youtube Estefannie (from Estefannie Explains It All https://www.youtube.com/user/estefanniegg SHE IS EPIC!) to modify Tru’s incredible sweet pooping unicorn to be activated by the internet! Featuring the AMAZING Allen Pan https://www.youtube.com/channel/UCVS89U86PwqzNkK2qYNbk5A (Thanks Allen for your filming and tweeting!)

Kids Invent Stuff

If you’re looking for an exciting, wholesome, wonderful YouTube channel suitable for the whole family, look no further than Kids Invent Stuff. Challenging kids to imagine wonderful inventions based on monthly themes, channel owners Ruth and Shawn then make these kids’ ideas a reality. Much like the Astro Pi Challenge, Kids Invent Stuff is one of those things we adults wish existed when we were kids. We’re not jealous, we’re just…OK, we’re definitely jealous.

ANYWAY, when eight-year-old Tru’s sparkly, pooping, rainbow unicorn won the channel’s ‘crazy new vehicle’ challenge, the team got to work, and the result is magical.

Riding an ELECTRIC POOPING UNICORN! | Kids Invent Stuff

We built 8-year-old Tru’s sparkly, pooping, rainbow unicorn electric vehicle and here’s what happened when we drove it for the first time and pooped out some jelly beans! A massive THANK YOU to our challenge sponsor The Big Bang Fair: https://www.thebigbangfair.co.uk The Big Bang Fair is the UK’s biggest celebration of STEM for young people!

But could a sparkly, pooping, rainbow unicorn electric vehicle ever be enough? Is anything ever enough if it’s not connected to the internet? Of course not. And that’s where Estefannie came in.

At Maker Central in Birmingham earlier this year, the two YouTube teams got together to realise their shared IoT dream.

They ran out of chairs for their panel, so Allen had to improvise

With the help of a Raspberry Pi Zero W connected to the relay built into the unicorn, the team were able to write code that combs through Twitter, looking for mentions of @mythicalpoops. A positive result triggers the Raspberry Pi to activate the relay, and the unicorn lifts its tail to shoot jelly beans at passers-by.

You can definitely tell this project was invented by an eight-year-old, and we love it!

IoT unicorn

As you can see in the video above, the IoT upgrades to the unicorn allow Twitter users to control when the mythical beast poops its jelly beans. There are rumours that the unicorn may be coming to live with us at Pi Towers, but if these turn out to be true, we’ll ensure that this function is turned off. So no tweeting the unicorn!

You know what to do

Be sure to subscribe to both Kids Invent Stuff and Estefannie Explains It All on YouTube. They’re excellent makers producing wonderful content, and we know you’ll love them.

How to milk a unicorn

The post The world’s first Raspberry Pi-powered Twitter-activated jelly bean-pooping unicorn appeared first on Raspberry Pi.

IoT community sprinkler system using Raspberry Pi | The MagPi issue 83

Par : Alex Bate

Saving water, several thousand lawns at a time: The MagPi magazine takes a look at the award-winning IoT sprinkler system of Coolest Projects USA participant Adarsh Ambati.

At any Coolest Projects event, you’re bound to see incredible things built by young makers. At Coolest Projects USA, we had the chance to talk to Adarsh Ambati about his community sprinkler and we were, frankly, amazed.

“The extreme, record-breaking drought in California inspired me to think of innovative ways to save water,” Adarsh tells us. “While going to school in the rain one day, I saw one of my neighbours with their sprinklers on, creating run-offs. Through research, I found that 25% of the water used in an average American household is wasted each day due to overwatering and inefficient watering methods. Thus, I developed a sprinkler system that is compliant with water regulations, to cost-effectively save water for entire neighbourhoods using a Raspberry Pi, moisture sensors, PyOWM (weather database), and by utilising free social media networks like Twitter.”

Efficient watering

In California, it’s very hot year round, so if you want a lush, green lawn you need to keep the grass watered. The record-breaking drought Adarsh was referring to resulted in extreme limitations on how much you could water your grass. The problem is, unless you have a very expensive sprinkler system, it’s easy to water the grass when it doesn’t need to be.

“The goal of my project is to save water wasted during general-purpose landscape irrigation of an entire neighbourhood by building a moisture sensor-based smart sprinkler system that integrates real-time weather forecast data to provide only optimum levels of water required,” Adarsh explains. “It will also have Twitter capabilities that will be able to publish information about when and how long to turn on the sprinklers, through the social networks. The residents in the community will subscribe to this information by following an account on Twitter, and utilise it to prevent water wasted during general-purpose landscaping and stay compliant with water regulations imposed in each area.”

Using the Raspberry Pi, Adarsh was able to build a prototype for about $50 — a lot cheaper than smart sprinklers you can currently buy on the market.

“I piloted it with ten homes, so the cost per home is around $5,” he reveals. “But since it has the potential to serve an entire community, the cost per home can be a few cents. For example, there are about 37000 residents in Almaden Valley, San Jose (where I live). If there is an average of two to four residents per home, there should be 9250 to 18500 homes. If I strategically place ten such prototypes, the cost per house would be five cents or less.”

Massive saving

Adarsh continues, “Based on two months of data, 83% of the water used for outdoor landscape watering can be saved. The average household in northern California uses 100 gallons of water for outdoor landscaping on a daily basis. The ten homes in my pilot had the potential to save roughly 50000 gallons over a two-month period, or 2500 gallons per month per home. At $0.007 per gallon, the savings equate to $209 per year, per home. For Almaden Valley alone, we have the potential to save around $2m to $4m per year!”

The results from Adarsh’s test were presented to the San Jose City Council, and they were so impressed they’re now considering putting similar systems in their public grass areas. Oh, and he also won the Hardware project category at Coolest Projects USA.

The MagPi magazine #83

This article is from today’s brand-new issue of The MagPi, the official Raspberry Pi magazine. Buy it from all good newsagents, subscribe to pay less per issue and support our work, or download the free PDF to give it a try first.

The post IoT community sprinkler system using Raspberry Pi | The MagPi issue 83 appeared first on Raspberry Pi.

Build a security camera with Raspberry Pi and OpenCV

Par : Alex Bate

Tired of opening the refrigerator only to find that your favourite snack is missing? Get video evidence of sneaky fridge thieves sent to your phone, with Adrian Rosebeck’s Raspberry Pi security camera project.

Building a Raspberry Pi security camera with OpenCV

Learn how to build a IoT + Raspberry Pi security camera using OpenCV and computer vision. Send TXT/MMS message notifications, images, and video clips when the security camera is triggered. Full tutorial (including code) here: https://www.pyimagesearch.com/2019/03/25/building-a-raspberry-pi-security-camera-with-opencv

Protecting hummus

Adrian loves hummus. And, as you can see from my author bio, so do I. So it wasn’t hard for me to relate to Adrian’s story about his college roommates often stealing his cherished chickpea dip.

Garlic dessert

“Of course, back then I wasn’t as familiar with computer vision and OpenCV as I am now,” he explains on his blog. “Had I known what I do at present, I would have built a Raspberry Pi security camera to capture the hummus heist in action!”

Raspberry Pi security camera

So, in homage to his time as an undergrad, Adrian decided to finally build that security camera for his fridge, despite now only needing to protect his hummus from his wife. And to build it, he opted to use OpenCV, a Raspberry Pi, and a Raspberry Pi Camera Module.

Adrian’s camera is an IoT project: it not only captures footage but also uses Twillo to send that footage, via a cloud service (AWS), to a smartphone.

Because the content of your fridge lives in the dark when you’re not inspecting it, the code for capturing video footage detects light and dark, and records everything that occurs between the fridge door opening and closing. “You could also deploy this inside a mailbox that opens/closes,” suggests Adrian.

Get the code and more

Adrian provides all the code for the project on his blog, pyimagesearch, with a full explanation of why each piece of code is used — thanks, Adrian!

For more from Adrian, check out his brilliant deep learning projects: a fully functional Pokémon Pokédex and Santa Detector.

The post Build a security camera with Raspberry Pi and OpenCV appeared first on Raspberry Pi.

❌