• Tidak ada hasil yang ditemukan

Designing the Internet of Things

N/A
N/A
Muhammad Akram

Academic year: 2024

Membagikan "Designing the Internet of Things"

Copied!
338
0
0

Teks penuh

You can find him on the Internet at www.mcqn.net or follow him on Twitter as @amcewen. Georgina Voss pointed me in the right direction regarding the ethics chapter, and Coen van Wyk kindly proofread the first draft.

FROM PROTOTYPE TO REALITY 225

Electronics 304 Internet Services 304 Solutions 305 The Internet of Things as Part of the Solution 305 Cautious Optimism 307 The Open Internet of Things Definition 308 Summary 309 Index 311. In this book we look at the types of computer chips that can be embedded in objects ("microcontrollers" such as Arduino ) and takes you through every step of the process from prototyping the Thing to its production and sale.

WHAT THIS BOOK IS NOT

When processing power is so cheap, you can afford to put processors in places you couldn't before—not just a business workstation or a home PC, but also a phone, a power meter, a bedside lamp, or a teddy bear. We explore the platforms you can use to develop hardware and software, discuss design concepts that will make your products eye-catching and appealing, and show you ways to scale up from a single prototype to mass production.

WHO SHOULD READ THIS BOOK?

HOW TO USE THE BOOK

The next chapters will be more interesting if you plan to build a Thing yourself. For the engineer, manufacturer, or technical person responsible for manufacturing a device, Chapter 5, “Integrated Device Prototyping,” applies general principles to specific devices (at the time of publication); Chapter 6,

PRODUCTION NOTES

While many readers will have at least some general knowledge of programming, writing code for the small computers that often power connected devices has its own challenges. Adrian Before Adrian and I even touched a keyboard, we had several long, detailed conversations about the Internet of Things in general and the content we wanted for the book.

PROTOTYPING

The Internet of Things

Design Principles for Connected Devices

Thinking About Prototyping Chapter 5: Prototyping Embedded

Prototyping the Physical Design

Prototyping Online Components

Techniques for Writing Embedded Code

THE INTERNET OF THINGS

AN OVERVIEW

THE FLAVOUR OF THE INTERNET OF THINGS

THE “INTERNET” OF “THINGS”

The idea of ​​the Internet of Things therefore suggests that instead of having a small number of very powerful computing devices in your life (laptop, tablet, phone, music player), you may have a large number of devices that may be less powerful (umbrella, bracelet, mirror, refrigerator, shoes). . The fact that it is also connected to the Internet and has general computing capabilities does not necessarily affect the shape of the object at all.

THE TECHNOLOGY OF THE INTERNET OF THINGS

Not entirely coincidentally, these are the same factors that we propose to give rise to the Internet of Things. In Chapter 7, “Prototyping Online Components,” we look at web programming for the Internet of Things.

ENCHANTED OBJECTS

Web service frameworks such as Python and Django or Ruby on Rails allow easy prototyping of the online component. So technology has always been associated with magic, and so this will be true almost by default for the Internet of Things.

WHO IS MAKING THE INTERNET OF THINGS?

A more striking omission, given Deschamps-Sonsino's pedigree as an Internet of Things innovator, is the role of "builder of the Internet of Things". However, the most important lesson is that regardless of your interest as a creative person, you are amply qualified to engage in the exciting field of the Internet of Things.

SUMMARY

If you only fit into one or a handful of these roles, you can still learn enough from the others to get things moving.

DESIGN PRINCIPLES FOR CONNECTED

It takes the perspective of the end user of the design as its focus and seeks to create the best solution for the user. Service design takes the broadest view of the service as a whole, whereas interaction design also looks at how different parts of the system fit together, and especially how the user has character in that interaction.

CALM AND AMBIENT TECHNOLOGY

Designing Calm Technology, Mark Weiser and John Seely Brown, Xerox PARC, December 21, 1995 An excellent example of this approach is Live Wire, one of the first Internet of Things devices. The mention of the distinctive sound from the motor when the Live Wire is under heavy load brings up another interesting point.

MAGIC AS METAPHOR

For example, John McKerrell's WhereDial takes its cue from the clock in Harry Potter that tracked the whereabouts of members of the Weasley family. A friend suggested that John could use it as a way to visualize some of the location data he was already collecting.

PRIVACY

KEEPING SECRETS

Instead of storing the identifying data in the database, if you don't need to return it to its original form (ie, you only need it to be unique and associated with the same group data), use a one-way hashed version. of information instead. Doing this still allows data creators to find their data (since they can provide it to be hashed again) and allows statistics collection and reports, and the like, without storing the data in a recoverable form.

WHOSE DATA IS IT ANYWAY?

When the participants of the Open Internet of Things Assembly (http://openiotassembly.com/) gathered to discuss such issues in the summer of 2012, they coined the term data subjects - the people to whom the data relates, whether or not they own the sensors , used to collect data, or the property where the sensors were installed. There is no clear understanding of what rights, if any, such "data subjects" will enjoy, but this is an area that deserves more discussion and attention.

WEB THINKING FOR CONNECTED DEVICES

SMALL PIECES, LOOSELY JOINED

For example, when Twitter's designers implemented the search feature, they chose to include a more machine-readable option in the form of a feed of results in the standard Atom syndication format (http://tools.ietf.org/html /rfc4287). Once their Bubblino was configured to use that new service, it would blow bubbles when the tests failed.

FIRST-CLASS CITIZENS ON THE INTERNET

As cell phones evolved to talk to standard Internet protocols, even though the display wasn't perfect, it was good enough for users to start using it. Given that those features could be developed with the tools they were already familiar with, over time the mobile web has just become an aspect of the web in general.

GRACEFUL DEGRADATION

Since they required site developers to learn a whole new set of skills, the new protocols gained little traction; without the sites to visit, user adoption of the mobile web was slow. Apart from using the same techniques when designing our connected devices, we might also apply that approach to the devices themselves to provide some fault tolerance.

AFFORDANCES

When your early adopter internet fridge can no longer talk to your WiFi because it's IPv4 only and the world has moved to IPv6, you can still use the touchscreen to write messages and view the photos stored on the USB stick that is in it. Unlike an app on her phone, your Internet of Things product takes up physical space in the world and isn't silenced by the user focusing on another app, so you need to keep that in mind for her.

INTERNET PRINCIPLES

INTERNET COMMUNICATIONS

But if an IP packet is ever transmitted across your local wired network via an Ethernet cable—the cable that connects your home broadband router or your office local area network (LAN) to a desktop PC—then the entire packet will be bundled into a different type of envelope , an Ethernet Frame, which adds additional information about how to complete the last few steps of its journey to your computer. And that we would always number them, so that if we wanted to send longer messages, we could.

THE IP PROTOCOL SUITE (TCP/IP)

IP ADDRESSES

All of the previous examples are immediately recognizable as website names, meaning you could type them into a web browser like http://www.google.com. This entry means that the host book.roomofthings.com (which hosts the blog for this book) is serving this IP address and will be served for the next three hours.

STATIC IP ADDRESS ASSIGNMENT

We call these types of addresses static because once assigned, they will not change without human intervention. If your brother, who used to use the address but hasn't been home in a while, comes back and finds that your new laser printer now has that address, he won't be able to connect to the Internet.

DYNAMIC IP ADDRESS ASSIGNMENT

It was initially expected that Internet-connected mobile phones (another major growth area) would push this technology past the tipping point. The devices must be low power and highly reliable while being able to connect to the Internet.

MAC ADDRESSES

Most devices, such as your laptop, come with the MAC address burned into their Ethernet chips. For development purposes, you can simply choose a MAC address that is not known to exist in your network.

TCP AND UDP PORTS

Alternatively, one can provide a simple data chip that just stores the MAC address and let the WizNet chip read it. Obviously, most consumer devices use some similar process to ensure that the machine always starts with the same unique MAC address.

AN EXAMPLE: HTTP PORTS

Ports 0–1023 are "known ports" and only a system process or an administrator can connect to them. Or if you're developing a website locally, you may be able to test it with an embedded test web server that connects to a free port.

OTHER COMMON PORTS

APPLICATION LAYER PROTOCOLS

HTTP

Other fields give the server more information about the client (for statistics and to work around known errors) and manage caching etc. All the server sees is the request; I don't know that the command that started the request was telnet book.roomofthings.com 80.

HTTPS: ENCRYPTED HTTP

Over the course of this book, we'll look at more features of HTTP, but everything is based on this simple request/response cycle. In Chapter 7, we'll look at web APIs (which are arguably higher-level protocols that happen to sit on top of HTTP) as we deepen our understanding of HTTP.

OTHER APPLICATION LAYER PROTOCOLS

IP addresses, an important concept from the Internet layer, are key to accessing devices across the Internet. The next generation of this protocol, IPv6, is widely used in infrastructure and will be critical in preventing the coming exhaustion of addresses, accelerated by the massive growth of mobile telephony, tablet computing and the Internet of Things.

THINKING ABOUT PROTOTYPING

Many Internet of Things projects start with a prototyping microcontroller, wired to components on a prototyping board, such as "breadboard" and placed in some sort of container (perhaps an old can or a laser-cut box). Use an Arduino and develop your online service in Ruby on Rails" or "Use a Raspberry Pi", but determining the best choice of prototyping platform cannot come from above or from a book.

SKETCHING

Called the Printernet Fridge, it was a nod to the age-old Internet of Things cliché, the Internet fridge - an exercise in seeing what a semi-automated shopping list would be like. The next step was to add more buttons, because just being able to order more milk isn't the most useful of shopping list apps.

FAMILIARITY

You would want a set of buttons, with a web interface that would allow you to reconfigure them for your set of unpackaged refrigerator items, and then a barcode reader would allow scanning of whatever was in the package. And if you're already adept at shaping sheets of foamcore into three-dimensional structures, we're not going to suggest that you should ignore that expertise and learn everything there is to know about laser cutting.

COSTS VERSUS EASE OF PROTOTYPING

Still, the Arduino toolkit summarizes the calls you make into a setup() function and a loop() function. However, due to the memory limitations of the Arduino, loading and processing a large portion of the XML is not the most appropriate measure.

PROTOTYPES AND PRODUCTION

Each of these tasks may, strictly speaking, be simpler than the more opaque interactions with a strange-looking circuit board, but the freedom of choice adds its own complexity. The interesting hack used by the Android Development Kit (ADK), for example, is that the Arduino has a USB host shield, that is, it pretends to be the computer side of the connection and thus in theory controls the phone.

CHANGING EMBEDDED PLATFORM

But if you don't know, you need to first evaluate and choose a language and then work out how to write it, get it up and running, and have it start automatically. Of course, if you've used a limited platform in prototyping, you may find yourself having to make choices and limitations in your code.

PHYSICAL PROTOTYPES AND MASS PERSONALISATION

BeagleBone, or whatever helped you get investment or collaborators, you may be well placed to replicate that compelling functionality on your final target. Porting to a more powerful platform may allow you to rewrite your code in a more modern, high-level way or simply take advantage of faster processor speed and more RAM.

CLIMBING INTO THE CLOUD

If you're running on a cloud computing platform, such as Amazon Web Services, you can even have the service dynamically expand and contract as demand dictates. Since it's web-based, it works equally well if you're sitting in the office at the time or if you're at home getting ready for work on a cold winter Saturday.

OPEN SOURCE VERSUS CLOSED SOURCE

The democratic and open approach of hackspaces, along with that of the open source software community, has carried over into the Maker culture, resulting in a default attitude of sharing designs and code. Over the next 11 months, both online and at the first Open Hardware Summit, this definition was refined and refined into version 1.0 of the Open Source Hardware (OSHW) Statement of Principles and Definition (http://freedomdefined.org/OSHW), which was released in February 2011.

WHY CLOSED?

You may also be able to protect distinctive elements of the visual design with trademarks and of the software and hardware with patents. If you work alone or in a small business, you can simply trademark your distinctive brand and rely on copyright law to protect everything else.

WHY OPEN?

If the project just "itches" to you, maybe the best thing to do with it is to release it as open source. If you have a serious work project, you may still find that open source is the right choice, at least for some of your work.

MIXING OPEN AND CLOSED SOURCE

This dynamic is fascinating with the Internet of Things because multiple components in different spaces interact to form the final product: the physical design, the electronic components, the microcontroller, the exchange with the Internet, and the back-end APIs and applications. The server code was partially kept closed source because some details about the configuration of the Internet of Things device may have been part of the commercial benefit.

CLOSED SOURCE FOR MASS MARKET PROJECTS

TAPPING INTO THE COMMUNITY

You now have a decent grounding in the broader issues surrounding building your first Internet of Things prototype. In the following chapters, we will discuss each of the three main components of an Internet of Things device in turn: the embedded computing and electronics.

EMBEDDED DEVICES

Even if you know the board you're using won't be ideal for the final version, if it allows you to test some features faster or cheaper, it might mean it's the right choice for now. In this chapter, we explain some of the differences and features of many popular options.

ELECTRONICS

Since computers are purely digital devices, you need a way to translate between the analog voltage in the real world and the computer's digital voltage. They will convert a voltage level between 0V and a predetermined maximum (often the same 5V or 3.3V that the processor operates at, but sometimes a fixed value like 1V) to a number depending on the accuracy of the ADC.

SENSORS

PWM requires simpler circuits, and for certain applications, such as dimming an LED, it is actually the preferred option. For more complicated sensors and modules there are interfaces such as Serial Peripheral Interface (SPI) bus and Inter-Integrated Circuit (I2C).

ACTUATORS

Piezo elements, as well as responding to vibrations, can be used to create it, so you can use a piezo buzzer to create simple sounds and music. Solenoids can be used to create a single, sharp thrusting motion, which can be useful for pushing a ball off a ledge or hitting a surface to make a musical sound.

SCALING UP THE ELECTRONICS

This means you can stop worrying about one of the wires coming loose, and if you're only going to make one copy of the circuit, that can be as far as you need to take things. If you need to make many copies of the circuit, or if you want a professional finish, you can turn your circuit into a PCB.

EMBEDDED COMPUTING BASICS

When you want to scale things even further, moving to a combined board allows you to remove unnecessary components from the microcontroller board and switch to surface mount components – where the chip's pins are soldered to the same surface as the chip. - facilitates the assembly of the board with automated production lines. PCB design and the manufacturing options are covered in much more detail in Chapter 10, "Moving to Manufacture."

MICROCONTROLLERS

However, there have been some improvements in the intervening years - modern chips are much smaller, require less power and operate about five times faster than their 1980s counterparts. In the same way that there are many different car manufacturers, each with a range of models for different purposes, there are many microcontroller manufacturers (Atmel, Microchip, NXP, Texas Instruments to name a few), each with a range of chips for different applications.

SYSTEM-ON-CHIPS

You'd be forgiven if the mention of 8-bit computers and RAM measured in kilobytes gives you flashbacks to early 1980s home computers like the Commodore 64 or the Sinclair ZX Spectrum. Again, as the price comes down for increased computing power, the popularity and familiarity of options like Linux is driving its wider adoption.

CHOOSING YOUR PLATFORM

How your device connects to the rest of the world is an important consideration for Internet of Things products. Combining that with the trick of hiding some of the connections on the bottom of the chip, it's possible to use the complex designs without resorting to table-sized PCBs.

ARDUINO

Combined with an expansion of the Wiring software environment, it made a huge impact on the physical computing world. If you need more space or a larger number of inputs or outputs, look at the Arduino Mega 2560.

DEVELOPING ON THE ARDUINO

A decision early on to open source the code and schematics meant that the Arduino board was able to survive the demise of the IDII and thrive. If the code compiles successfully, it is transferred to the Arduino and stored in its flash memory.

SOME NOTES ON THE HARDWARE

In the absence of a display, the Arduino allows you to write information over the USB cable using Serial.write(). The headers are optimized for prototyping and being able to easily repurpose the Arduino.

OPENNESS

Choosing one of the specialized boards isn't the only way to expand your Arduino's capabilities. The product consists of a "large bulb" which is accompanied by one or more "small bulbs".

RASPBERRY PI

The model names of the Raspberry Pi, “Model A” and “Model B”, refer to the different versions of the BBC Micro. Many of the other trustees of the Raspberry Pi Foundation, officially established in 2009, cut their teeth on the BBC Micro.

CASES AND EXTENSION BOARDS

Of course, in the early days of the Pi's existence after launch, there are fewer of them than for Arduino;. While with Arduino it often seems like everything is already done, in the early days of the Raspberry Pi, the situation is more encouraging.

DEVELOPING ON THE RASPBERRY PI

Since the Pi is a general purpose computer, without the strict memory limitations of the Arduino, you can just try. These team members have been able to publish certain materials, such as PDFs of the Raspberry Pi board schematics, and so on.

BEAGLEBONE BLACK

The Pi's influence can be seen in the latest revision of the BeagleBone platform, the BeagleBone Black. Like the Raspberry Pi, the BeagleBone is a computer that primarily runs Linux, but is capable of running a variety of other ported operating systems.

DEVELOPING ON THE BEAGLEBONE

The BeagleBone combines the best of these two extremes by having all the flexibility of the Pi, but with a single standard toolchain installed. Note that USR3 is actually connected to one of the status LEDs built into the board.

ELECTRIC IMP

All the smarts of the Electric Imp, and also its WiFi connection, are located in an SD card-shaped microcontroller. It is important to note that the Imp is not actually an SD card; it is shaped just like one.

DEVELOPING ON THE ELECTRIC IMP

Once you write the code, you push it to the device, which is one of the great strengths of the Electric Imp platform. However, this means that you have a central point of communication and therefore errors on the servers of the Electric Imp team.

OTHER NOTABLE PLATFORMS

We continue this progress by looking at some devices in which the hardware is completely locked down: mobile phones and tablets, and plug-in computers.

MOBILE PHONES AND TABLETS

If you want to connect the Android device to the Arduino, the latter takes the host role. In reality, the Android device provides Internet connectivity, input/output capability, and processing power.

PLUG COMPUTING: ALWAYS-ON INTERNET OF THINGS

SheevaPlug and others are attractive in terms of being already available consumer electronics rather than necessarily being the best solution for an Internet of Things product. At the time of writing, the platform does not feel quite ready yet, but it is one of the more exciting developments, and it, or something similar, may well become the face of a number of Internet of Things developments in the future.

PROTOTYPING THE PHYSICAL DESIGN

PREPARATION

They all have a wealth of expertise for you to tap into, in the form of their community of members. We'll discuss laser cutters, 3D printers, and CNC mills later in this chapter, but we won't look at lathes or vacuum formers in detail.

SKETCH, ITERATE, AND EXPLORE

For example, consider the evolution of the design for the Good Night Lamp (which we mentioned in a case study in the last chapter). The revised size proved much better and formed the basis of the design for the first production run.

NONDIGITAL METHODS

If you're lucky, you already have something gathering dust in the attic or that you can borrow from your kids. If you need something thicker than the sheet itself, you can easily glue a few layers together.

LASER CUTTING

After reviewing the kinds of techniques you learned when your design education started, back in elementary school, we can move on to looking at some of the newer tools. The combination of Moore's Law lowering the cost of computers and the expiration of the patents from early development in the 1980s has brought such technology within reach of the hobbyist or small business.

CHOOSING A LASER CUTTER

SOFTWARE

HINGES AND JOINTS

Each of the three independently controllable RGB LEDs on the orb is mapped to a different subscription to the MQTT messaging system it uses. You can see the cardboard prototype model on the right and two versions of the laser cut plywood base.

3D PRINTING

TYPES OF 3D PRINTING

Shapeways (http://www.shapeways. com/), i.materialise (http://i.materialise.com/) and Ponoko (https://www.ponoko.com/) all offer similar services for a while now. Tinkercad (http://tinkercad.com) and Autodesk's 123D Design Online (http://www.123dapp.com/design) are two options that simply run in your web browser.

CNC MILLING

3 Axis: Like a 2.5 axis machine, this machine has a bed that can move in the X and Y axes and a milling head that can move in the Z axis. 5 Axis: This machine adds a second rotary axis—typically around Y—which is known as the B axis.

REPURPOSING/RECYCLING

With the clock obtained, the next step was to work out how to mount it. The final stage in the design work was to position the solenoid to give a clear and consistent sound from the bell.

PROTOTYPING ONLINE

COMPONENTS

Although you saw in Chapter 2 that one of the design principles is that things should be "first-class citizens" of the Internet, they currently seem to be tied to specific websites or services. For now, however, in most of the cases we look at, each device is connected to a single web service.

GETTING STARTED WITH AN API

Click a few more links to browse the list of contacts until you see the one you want. Scroll down the page, find the photo you want and click on it.

MASHING UP APIS

Some of the more prominent, easy-to-use APIs want to embed your data into themselves – like the Google Maps API. This means that they are ideal for use in a web browser, but you have no control over the final product, and there may be limited scope for accessing them from the microcontroller.

SCRAPING

LEGALITIES

WRITING A NEW API

CLOCKODILLO

Some interactions with a timer data structure are too complex to be displayed on a primarily rotary device, such as anything that requires a display or a keyboard. We will return to this interesting topic when we look at scaling up to production in Chapter 10.

SECURITY

So you'll need a way to configure the device to change its password - for example, a web control panel hosted on the server or on the device itself. As you can see, the first four options can be set by the device, but more methods are related to the clients (website or native) than the device itself.

IMPLEMENTING THE API

JavaScript Object Notation (JSON), pronounced "Jason", is a way of formatting data so that it can be easily exchanged between different systems. Property values ​​can be a string, a number, a boolean (true or false), or another JSON object or array (a sequence of objects).

Referensi

Dokumen terkait

[1]–[3] Pada sisi lain, pemanfaatan Internet of Things (IoT) juga telah berkembang signifikan, sehingga kurang dari satu dekade yang lalu, jumlah perangkat ( things )

Internet of things (IoT) adalah sebuah sistem dimana benda- benda di dunia fisik dapat dihubungkan ke internet oleh sensor [8], ditunjukkan pada Gambar 2.. IoT mengacu pada

Oleh karena itu penulis memutuskan untuk membuat alat pemantau kesuburan tanah Internet of Things (IoT) berbasis Arduino yang menggunakan sensor seperti sensor

For building the system of Internet of things, it must have the upcoming sub-systems: - The prototyping platform of nodes of Internet of things that allows the development of Internet

SECURITY NEEDS FOR INTERNET OF THINGS The devices of Internet of Things use many technologies, including communications, sensors, big data, etc., therefore, they have different security

Kata kunci:“MONITORING DAYA, PANEL LISTRIK 3 FASE,Internet of Things IoT” ABSTRACT This final project focuses on designing an electrical power monitoring device to prevent energy

vi PEMANFAATAN INTERNET OF THINGS IoT UNTUK KENDALI BEBAN LISTRIK PADA RUANG KULIAH GEDUNG ELEKTRO Nama Mahasiswa Nim Pembimbing : Rahayu Oktavia : 3204171167 : Stephan,

This document provides a comprehensive guide to developing, implementing, and evaluating market research projects for