forked from dragonman225/notablog-starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathraspberry-pi-potentiometer-blinking-leds.html
More file actions
129 lines (87 loc) · 14 KB
/
raspberry-pi-potentiometer-blinking-leds.html
File metadata and controls
129 lines (87 loc) · 14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Chrome, Firefox OS and Opera Status Bar Color -->
<meta name="theme-color" content="#FFFFFF">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css">
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.19.0/themes/prism.min.css">
<link rel="stylesheet" type="text/css" href="css/SourceSansPro.css">
<link rel="stylesheet" type="text/css" href="css/theme.css">
<link rel="stylesheet" type="text/css" href="css/notablog.css">
<!-- Favicon -->
<link rel="shortcut icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>📼</text></svg>">
<style>
:root {
font-size: 20px;
}
</style>
<title>Controlling LEDs By Changing Analog Input Values | Projects</title>
<meta property="og:type" content="blog">
<meta property="og:title" content="Controlling LEDs By Changing Analog Input Values">
<meta name="description" content="Wouldn’t it be amazing if you could move something, change something, create something just by giving inputs using python programming? This concept can be seen in our daily lives. For example, a keyboard can change values on a screen, a mouse can move something on a screen. From changing a value of an LED to controlling a space shuttle, the possibilities of this simple concept can expand. Examples of this concept include controlling the TV by inputting values via a remote, controlling a rover on Mars by changing several input values from Earth. These may be extreme examples but essentially, the fundamentals of the concept remain the same. Based on this, I created a prototype and I documented it below.">
<meta property="og:description" content="Wouldn’t it be amazing if you could move something, change something, create something just by giving inputs using python programming? This concept can be seen in our daily lives. For example, a keyboard can change values on a screen, a mouse can move something on a screen. From changing a value of an LED to controlling a space shuttle, the possibilities of this simple concept can expand. Examples of this concept include controlling the TV by inputting values via a remote, controlling a rover on Mars by changing several input values from Earth. These may be extreme examples but essentially, the fundamentals of the concept remain the same. Based on this, I created a prototype and I documented it below.">
<meta property="og:image" content="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>⏺️</text></svg>">
<style>
.DateTagBar {
margin-top: 1.0rem;
}
</style>
</head>
<body>
<nav class="Navbar">
<a href="index.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>📼</text></svg>"></span>
<span>Home</span>
</div>
</a>
<span class="Navbar__Delim">·</span>
<a href="about.html">
<div class="Navbar__Btn">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>🕵️</text></svg>"></span>
<span>About</span>
</div>
</a>
</nav>
<header class="Header">
<div class="Header__Cover">
<img src="https://images.unsplash.com/photo-1649959265040-2b87be9074e4?ixlib=rb-1.2.1&q=80&cs=tinysrgb&fm=jpg&crop=entropy">
</div>
<div class="Header__Spacer ">
</div>
<div class="Header__Icon">
<span><img class="inline-img-icon" src="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text text-anchor=%22middle%22 dominant-baseline=%22middle%22 x=%2250%22 y=%2255%22 font-size=%2280%22>⏺️</text></svg>"></span>
</div>
<h1 class="Header__Title">Controlling LEDs By Changing Analog Input Values</h1>
<div class="DateTagBar">
<span class="DateTagBar__Item DateTagBar__Date">Posted on Mon, Jul 18, 2022</span>
<span class="DateTagBar__Item DateTagBar__Tag DateTagBar__Tag--default">
<a href="tag/Raspberry Pi.html">Raspberry Pi</a>
</span>
<span class="DateTagBar__Item DateTagBar__Tag DateTagBar__Tag--orange">
<a href="tag/Hardware.html">Hardware</a>
</span>
<span class="DateTagBar__Item DateTagBar__Tag DateTagBar__Tag--red">
<a href="tag/Python.html">Python</a>
</span>
<span class="DateTagBar__Item DateTagBar__Tag DateTagBar__Tag--red">
<a href="tag/Software.html">Software</a>
</span>
</div>
</header>
<article id="https://www.notion.so/a78a3a41e826425bb5f343c974ef7f75" class="PageRoot"><div id="https://www.notion.so/f7946e80e0cf42c98f44e25af654ba19" class="ColorfulBlock ColorfulBlock--BgGray Callout"><div class="Callout__Icon"><div class="Icon">🔗</div></div><p class="Callout__Content"><span class="SemanticStringArray"><span class="SemanticString">The python code for the program to make the LEDs blink is available on </span><span class="SemanticString"><a class="SemanticString__Fragment SemanticString__Fragment--Link" href="https://github.com/rishisim/Potentiometer-Blinking-LEDs">my GitHub profile</a></span><span class="SemanticString">.</span></span></p></div><h1 id="https://www.notion.so/ba0ff161994a45ccaa10c103742b223b" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--1"><a class="Anchor" href="#https://www.notion.so/ba0ff161994a45ccaa10c103742b223b"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">Introduction</span></span></h1><div id="https://www.notion.so/7610726d911a4d588adbcce3c0716ec9" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">Wouldn’t it be amazing if you could move something, change something, create something just by giving inputs using python programming? This concept can be seen in our daily lives. For example, a keyboard can change values on a screen, a mouse can move something on a screen. From changing a value of an LED to controlling a space shuttle, the possibilities of this simple concept can expand. Examples of this concept include controlling the TV by inputting values via a remote, controlling a rover on Mars by changing several input values from Earth. These may be extreme examples but essentially, the fundamentals of the concept remain the same. Based on this, I created a prototype and I documented it below.</span></span></p></div><h1 id="https://www.notion.so/11d887fe8a324f479baddb9f45b25dee" class="ColorfulBlock ColorfulBlock--ColorDefault Heading Heading--1"><a class="Anchor" href="#https://www.notion.so/11d887fe8a324f479baddb9f45b25dee"><svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><span class="SemanticStringArray"><span class="SemanticString">Overview - Raspberry Pi Potentiometer Blinking LEDs</span></span></h1><div id="https://www.notion.so/e74812ad93f24e5685d63623918236bb" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">Using a Raspberry Pi Zero, a Breadboard, one potentiometer, a few LEDs and several cables, I was able to create a program that can read a potentiometer value and light up an LED accordingly. This project is a prototype/first test of my tweeting plant project. </span></span></p></div><div id="https://www.notion.so/d0cd1b36dab341308a52bc8d0e154518" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><div id="https://www.notion.so/6c99ba32490748609df7320d977ab152" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">Below is the diagram of the hardware and wiring.</span></span></p></div><div id="https://www.notion.so/0c01f4d700824b6e917d6ab158fe981e" class="Image Image--Normal"><figure><a href="https://www.notion.so/signed/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2d0856b8-a260-4e3a-9412-4cfc5e63b552%2FUntitled.png?width=651&table=block&id=0c01f4d7-0082-4b6e-917d-6ab158fe981e"><img src="https://www.notion.so/signed/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2d0856b8-a260-4e3a-9412-4cfc5e63b552%2FUntitled.png?width=651&table=block&id=0c01f4d7-0082-4b6e-917d-6ab158fe981e" style="width:651px"/></a><figcaption><span class="SemanticStringArray"></span></figcaption></figure></div><div id="https://www.notion.so/7894aa3394ca4221afb5b6398222e17c" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><div id="https://www.notion.so/d9c62a8de4894fb8852b6b2daa4a22e5" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">The main concept is that the potentiometer should change values, and to represent a change in the values, LEDs will light up based on the range of the value. For example, if the potentiometer value is less than 0.30, then the first LED should light up. If the value is between 0.30 and 0.60, the second LED should light up. If the value is between 0.60 and 1.00 (max), then the final LED should light up. Below is the drawing of the concept.</span></span></p></div><div id="https://www.notion.so/1a36ea721287402eb1d6348152debd22" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><div id="https://www.notion.so/099087e9b3b04f779e45817ba820a72d" class="Image Image--PageWidth"><figure><a href="https://www.notion.so/signed/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3e1eeb18-b86c-40e3-939f-cb74ae659dad%2Fimageedit_1_8328059275.gif?width=1012&table=block&id=099087e9-b3b0-4f77-9e45-817ba820a72d"><img src="https://www.notion.so/signed/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3e1eeb18-b86c-40e3-939f-cb74ae659dad%2Fimageedit_1_8328059275.gif?width=1012&table=block&id=099087e9-b3b0-4f77-9e45-817ba820a72d" style="width:100%"/></a><figcaption><span class="SemanticStringArray"></span></figcaption></figure></div><div id="https://www.notion.so/e5d3686d7ade4087bcae6cdb0b05cb90" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">Below is a demo and explanation of the project:</span></span></p></div><div id="https://www.notion.so/f03301e9955745fea0486241a22c67fb" class="Embed"><div class="Embed__Content"><div class="Embed__ResponsiveContainer" style="width:854px;padding-bottom:56.20608899297424%"><iframe src="https://www.youtube.com/embed/PPpWykuO_Dw?feature=oembed" sandbox="allow-scripts allow-popups allow-forms allow-same-origin" allowfullscreen=""></iframe></div></div><p class="Embed__Caption"><span class="SemanticStringArray"></span></p></div><div id="https://www.notion.so/4092dfbc296a4f38999ed55ee11d8a7a" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"></span></p></div><div id="https://www.notion.so/88ebd06e76e74ee4848d25d7e6886abc" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString">This project is intended to replicate the change in values of a soil moisture sensor, a device that detects whether or not the soil is wet for plants to grow. Since my initial hardware and wiring did not work using the capacitive soil moisture sensor, I created this project as a starting point and will scale it up to using a sensor.</span></span></p></div><div id="https://www.notion.so/5efeedf262a141c68cdec23f43ad251f" class="ColorfulBlock ColorfulBlock--ColorDefault Text"><p class="Text__Content"><span class="SemanticStringArray"><span class="SemanticString"> </span></span></p></div></article>
<footer class="Footer">
<div>© Projects 2022</div>
<div>·</div>
<div>Powered by <a href="https://github.com/dragonman225/notablog" target="_blank"
rel="noopener noreferrer">Notablog</a>.
</div>
</footer>
</body>
</html>