User manual

sensor. The photo transistor can easily be mistaken for an LED. You can recog-
nise the photo transistor by looking onto the head of the part from above. The
photo transistor has a large black area inside. The following figure shows how the
experiment is set up. The collector of the photo transistor is the shorter connec-
tion. It is connected to +5 V. The resistor in series
with the photo transistor has 10 kOhm.
Connection of the photo transistor to pin A6 with 10 kOhm counter-resistor
The program
Until now, the websites of the web server were always made up of an unchange-
able page that sent data to the controller. Now, the website is to be changed be-
fore being transmitted to the browser, to display the appropriate brightness of the
photo transistor. This works because the source code of the website holds a kind
of placeholder. The program now replaces the placeholder *bright* when loading
the data from the Progmem variable by the current brightness value. Thus, the
output text and the deflection of the slider are changed. Another line in the HTML
file ensures that the page will reload automatically every few seconds. The current
brightness is already displayed well-structured in the browser.
Required parts
1 x pinboard, 1 x NanoESP, 1 x photo transistor, 1 x re-
sistor 10 kOhm (brown-black-orange), circuit wire