<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Stuart Brown on Medium]]></title>
        <description><![CDATA[Stories by Stuart Brown on Medium]]></description>
        <link>https://medium.com/@jinky32?source=rss-f0eaa4765b76------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*n_C85BVNh631OlZj.</url>
            <title>Stories by Stuart Brown on Medium</title>
            <link>https://medium.com/@jinky32?source=rss-f0eaa4765b76------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 21:04:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jinky32/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Connecting a Pulse-Width Modulation (PWM) Dimmer Switch Board to a Raspberry Pi for Use with…]]></title>
            <link>https://medium.com/@jinky32/connecting-a-pulse-width-modulation-pwm-dimmer-switch-board-to-a-raspberry-pi-for-use-with-a16866df813b?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/a16866df813b</guid>
            <category><![CDATA[herpetology]]></category>
            <category><![CDATA[dimmer]]></category>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Thu, 07 Mar 2019 20:39:23 GMT</pubDate>
            <atom:updated>2019-03-07T20:39:23.096Z</atom:updated>
            <content:encoded><![CDATA[<h3>Connecting a Pulse-Width Modulation (<strong>PWM</strong>) D<strong>immer Switch Board to a Raspberry Pi for Use with TerrariumPI</strong></h3><p>Before I start this post I want to say a big thank you to the <a href="https://github.com/theyosh/TerrariumPI">TerrariumPI</a> community, especially <a href="https://github.com/theyosh">theyosh</a> and <a href="https://github.com/AndrejWeber">AndrejWeber</a>, for their help in getting me up and running here. I’m not going to pretend I understand everything that is going on here, but hopefully the below will help people get up and running with a PWM Dimmer Switch in <a href="https://github.com/theyosh/TerrariumPI">TerrariumPI</a>.</p><p>In the below I will be using the recommended, and most frequently used, PWM Dimmer Switch for TerrariumPI — the <a href="https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/">Universal AC MAINS Dimmer — MPDMv4.1</a>.</p><h4>My Use Cases</h4><p>I currently have my Ackie vivarium set up with a Microclimate Evo Pro which provides a dimming thermostat that is connected to a halogen lamp and an Arcadia Deep Heat Projector. Essentially this moderates the power that goes to these lamps so that they receive a lower percentage when the temperature nears the set threshold, and a higher percentage when the temperature in the vivarium needs to be increased.</p><p>I also have a an LED array which has a ramp up / down feature which allows me to mimic sunrise and sunset. Although I’m not actually going to replace this control with TerrariumPI (the setup cost me a small fortune!) I am going to explore this scenario since I know many people are interested in trying to achieve this effect.</p><h4>Physical Connection</h4><p>Before getting into the configuration of the Dimmer in TerrariumPI you need to first connect the light to the Dimmer and the Dimmer to your RaspberryPI. As in the guide I wrote about <a href="https://medium.com/@jinky32/connecting-a-12v-8-channel-relay-to-an-external-power-supply-and-raspberrypi-6fec119c112c">Connecting a 12v 8 Channel Relay to an External Power Supply and RaspberryPi</a>, you are likely to be messing with mains voltage here so please make sure you take care and that you make all connections without any electricity connected to the devices. That said, let’s get stuck in!</p><p>First up you’re going to need to strip the wires that are connected to 1)the plug and 2) the device to be dimmed. You’ll likely start with something looking like the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kH8h_NSGtbZJ-7wHx0YFyg.jpeg" /></figure><p>You then connect these up to your Dimmer Switch:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QH4Kmwi2F8dy7MdhjdVACA.jpeg" /></figure><p>Now it’s time to make the connection to your RaspberryPi, there are just three connections required. In the below the connections on the left are on the Dimmer board and on the right the RaspberryPI GPIO pins (I’ve linked these to the Pinout site for clarity:</p><ul><li>VCC -&gt; <a href="https://pinout.xyz/pinout/pin1_3v3_power">VCC (3.3V)</a></li><li>GND -&gt; <a href="https://pinout.xyz/pinout/ground">GND</a></li><li>VCNT -&gt; <a href="https://pinout.xyz/pinout/pin32_gpio12">PWM PIN (physical pin 32</a>)</li></ul><p>If everything is right, you should see a small red LED lit up on the Dimmer Switch.</p><h4>Configuring the PWM Dimmer Switch in TerrariumPI</h4><p>As I said at the outset, I will be exploring two use cases here:</p><ol><li>Using the Dimmer to control lights to simulate a sunrise and sunset based on the time of day.</li><li>Using the dimmer to control a heat source (a light in this example, but could be an Arcadia Deep Heat Projector or anything else that can be dimmed) based on the readings from a sensor. If you are not sure how to get a sensor set up correctly on TerrarumPI please take a look at my previous guide on <a href="https://medium.com/@jinky32/terrariumpi-adding-a-sensor-8afef4909fbe">how to set up a sensor in TerrariumPI</a>.</li></ol><p>In both of these scenarios however you are going to first need to set up your Dimmer Switch as a Switch within TerrariumPI. To do this navigate to Switches in the left hand navigation and select the ‘Settings’ sub item. On the page that loads hit the blue + button.</p><p>My completed form looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3HCyalGF2cq3SSplrM9Ew.png" /></figure><p>I’ll explain these fields as best I can:</p><ol><li>Hardware — select PWM Dimmer from the select list, I guess TerrariumPI is doing some config magic behind the scenes based on this selection.</li><li>Address — this is the physical GPIO pin. We used pin 32 above and so 32 goes into this field.</li><li>Name —this is the name that you want to give the switch. It will be used when you set the dimmer to control aspects of the environment. More on that later.</li><li>Power usage in Watts — I entered the value in watts of the bulb that was connected to the Dimmer. There is a nice feature in TerrariumPI that allows you to track your spend based on the wattage of devices you are using and how long they are on for. This value will be used in that calculation.</li><li>Water Flow — not relevant to us here so just put 0.</li><li>Timer — For all of the use cases in this guide this should be set to disabled since this aspect will be set in the particular environment aspect (e.g. Temperature or Lighting) we configure.</li><li>Dimmer Action Duration — this is the time (in seconds) that we want a change in power percentage to take. For example if we want our percentage increases or decrease in 15% steps (see #8 below) the value in Dimmer Action Duration defines how long this increase or decrease will take e.g. increase power by 15% over a period of 20 seconds in my example.</li><li>Dimmer Environment Step — As above this is the amount of change you want to see when ramping up or down. By using this value with the value in Dimmer Action Duration you can define how long you want your sunrise and sunset to ask. Dimmer Action Duration * Dimmer Environment Step / 60. So in my example 20 * 15 = 300 seconds / 60 = 5 minutes. So it will take a bulb 5 minutes to be powered from 0% to 100% (or vice versa) using these settings.</li><li>Dimmer on Duration — I’m afraid I don’t really know what this field is for. Setting it to have different values didn’t seem to change the behaviour.</li><li>Dimmer on Percentage — this is the value you want to be the full ‘on’ value. I set this to 100%.</li><li>Dimmer off Duration — As per #9 I don’t really know what this does.</li><li>Dimmer off Percentage — this is the value for ‘off’. I set it as 0 because when the bulb is of I want there to be no light / heat emanating at all.</li></ol><p>Now hit the ‘Save’ button and we’re good to move on to configuring our first environment!</p><h4>Using the Dimmer to simulate a sunrise and sunset</h4><p>Now that we have set up the PWM Dimmer as a switch in TerrariumPI (remember that we named it <em>PWM Dimmer</em>) we can use this switch within set an environment in TerrariumPI. Here we are going to set it to work with the <em>Lights</em> environment.</p><p>Navigate to System in the left hand navigation and select Environment in the sub navigation. In the list of environments that is shown search for Lights. You can see how I have completed my form below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*nOXJ0QRmerq84kbtFpfSkA.png" /></figure><p>I selected Timer in the mode field because I needed to be able to keep modifying the timings as I experimented. Based on this setting you won’t need to fill in the next three fields.</p><p>Below this set of fields are two more labelled <em>Day</em> and <em>Night </em>and this is where I made my first mistake. I had assumed that you needed to add values in both of these field sets, in fact you only need to use one. As above I used <em>Day</em>.</p><p><em>Start</em> time is the time you want the lamp to start ramping up and <em>Stop</em> is the time that you want to start going down. The period between these times the lamp will be on at the level you set in <em>Dimmer on Percentage</em> on the switch earlier. To be honest I’m really sure what the <em>Timer on</em> and <em>Timer off </em>fields are for, in my example I have set the <em>Timer on</em> value at 25 minutes because that is the difference in minutes between the <em>start</em> and <em>stop</em> times. I assume that if I set <em>Timer on</em> for a period less than 25 minutes, for example 15 minutes, there would be a period of ten minutes between 11:00 and 11:25 when the light would not be on.</p><p>Then in the Power Switches field you should have available a list of switches that you have set up. Select whatever you named your Dimmer (I called mine PWM Dimmer). Now when your <em>start</em> time comes around your light should start ramping up. If you look in Settings &gt; Log you should see something similar to the below (I’ve removed a lot of the other stuff like temperature and humidity readings). You need to read the below logs from the bottom up and I have removed some readings from the middle section for the sake of brevity:</p><p><em>2019–02–23 11:03:32,464 — INFO — terrariumSwitch — Power switch ‘PWM Dimmer’ at address ‘32’ is done at value 100.0% in 20.0 seconds<br>2019–02–23 11:03:24,145 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer<br>2019–02–23 11:03:23,106 — INFO — terrariumEngine — Webcam update(s) done in 4.17913 seconds. Waiting for 25.82087 seconds for next update</em></p><p><em>2019–02–23 11:03:09,146 — INFO — terrariumSwitch — Changed power switch ‘PWM Dimmer’ of type ‘pwm-dimmer’ at address ‘32’ from state ‘90.0’ to state ‘100.0’ (Forced:False)<br>2019–02–23 11:03:09,144 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer<br>2019–02–23 11:03:00,702 — INFO — terrariumSwitch — Power switch ‘PWM Dimmer’ at address ‘32’ is done at value 90.0% in 20.0 seconds<br>2019–02–23 11:02:54,140 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer</em></p><p><em>2019–02–23 11:02:39,141 — INFO — terrariumSwitch — Changed power switch ‘PWM Dimmer’ of type ‘pwm-dimmer’ at address ‘32’ from state ‘75.0’ to state ‘90.0’ (Forced:False)<br>2019–02–23 11:02:39,139 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer<br>2019–02–23 11:02:31,529 — INFO — terrariumSwitch — Power switch ‘PWM Dimmer’ at address ‘32’ is done at value 75.0% in 20.0 seconds<br>2019–02–23 11:02:24,134 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer</em></p><p><em>…</em></p><p><em>2019–02–23 11:00:39,103 — INFO — terrariumSwitch — Changed power switch ‘PWM Dimmer’ of type ‘pwm-dimmer’ at address ‘32’ from state ‘15.0’ to state ‘30.0’ (Forced:False)<br>2019–02–23 11:00:39,101 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer<br>2019–02–23 11:00:32,538 — INFO — terrariumSwitch — Power switch ‘PWM Dimmer’ at address ‘32’ is done at value 15.0% in 20.0 seconds<br>2019–02–23 11:00:24,094 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer</em></p><p><em>2019–02–23 11:00:09,094 — INFO — terrariumSwitch — Changed power switch ‘PWM Dimmer’ of type ‘pwm-dimmer’ at address ‘32’ from state ‘0.0’ to state ‘15.0’ (Forced:False)<br>2019–02–23 11:00:09,093 — INFO — terrariumEnvironment — Environment light is turning on the alarm min powerswitches based on timer</em></p><h4>Using the dimmer to control a heat source</h4><p>OK, great so now we can use the Dimmer switch to control a light according to a timer, but how about using the readings from a sensor?</p><p>Well the good news is that most of the setup is already done. Now we just need to:</p><ol><li>Disable the Lights environment — I think can only be used once</li><li>Head to System &gt; Environment and look for the <em>Temperature</em> option. My settings are below. Again there are options for both <em>High alarm</em> and <em>Low alarm</em> and you need to only choose one. <em>Settle timeout</em> is the amount of time in seconds between temperature changes. <em>Power on</em> I understand to be a way of having the heating on even outside of the heating parameters set out in #3 below. I set it to 0 and was happy with the results.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*ENIQCsN77tmByRn5xqlJlw.png" /></figure><p>3. If you haven’t already set up a temperature sensor make sure you have one set up (see my guide on <a href="https://medium.com/@jinky32/terrariumpi-adding-a-sensor-8afef4909fbe">how to add a sensor to TerrariumPI</a>), my settings are below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*kTFVOnb8tyQGqC6ebM3XPQ.png" /></figure><p>The easiest way to mock a temperature rise or fall in order to trigger the lamp dimming up or down is to simply move your sensor higher or lower within your vivarium. As you do this keep and eye on the logs (System &gt; Log) as well as the bulb, you should see the TerrariumPI reading the temperature and changing the state of the bulb accordingly e.g. the below decrease in power as I moved the sensor higher in the vivarium (again, read from the bottom up):</p><p><em>2019–02–24 12:19:19,145 — INFO — terrariumSwitch — Power switch ‘PWM Dimmer’ at address ‘32’ is done at value 25.0% in 20.0 seconds</em></p><p><em>2019–02–24 12:18:58,051 — INFO — terrariumSwitch — Changed power switch ‘PWM Dimmer’ of type ‘pwm-dimmer’ at address ‘32’ from state ‘40.0’ to state ‘25.0’ (Forced:False)</em></p><p>Phew, we’ve done it. Well done if you’ve made it this far! As I said it took me a while, and a lot of help, to get this far and I don’t still understand everything 100% but this is a pretty awesome feature of TerrariumPI and hopefully the above gives you enough to get things up running correctly. Once you know things are running properly it’s then easier to start tweaking single variables and watching the result. Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a16866df813b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Converting Ethernet Cat5 Cables into Raspberry Pi Jumpers]]></title>
            <link>https://medium.com/@jinky32/converting-ethernet-cat5-cables-into-raspberry-pi-jumpers-2f69cca4d8c0?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f69cca4d8c0</guid>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[ethernet-cable]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[jumpercables]]></category>
            <category><![CDATA[crimping-tool]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Sun, 24 Feb 2019 18:27:20 GMT</pubDate>
            <atom:updated>2019-02-24T18:29:37.056Z</atom:updated>
            <content:encoded><![CDATA[<p>Over the last couple of months I’ve been enjoying learning about the RaspberryPi by working my way though how to use various functionalities made available by the awesome <a href="https://github.com/theyosh/TerrariumPI">TerrariumPI project</a>. Throughout this process one of the issues that has nagged at me for when I actually incorporate this into my vivarium is how to wire things up safely and discretely.</p><p>In my RaspberryPI newbie kit I have a load of 6&quot; jumper cables that are fine for prototyping but when I go live:</p><ol><li>I’m going to need significantly longer lengths of cable, and</li><li>I don’t really want multiple thin wires on display within the enclosure.</li></ol><p>Dimly, it began to dawn on me that I could probably repurpose some of the old ethernet cables for the job. In this post I’ll go through how I have started to modify some of my old ethernet cables into RaspberryPi jumpers.</p><p>Before beginning the job you are going to need some crimpers and male and female connectors. I did a bit of reading around on what people are using for similar tasks and decided to go for the <a href="https://www.banggood.com/Geekcreit-310pcs-2_54mm-Male-Female-Dupont-Wire-Jumper-With-Header-Connector-Housing-Kit-p-1063303.html">Geekcreit 310pcs 2.54mm Male Female Dupont Wire Jumper With Header Connector Housing Kit</a> and the <a href="https://www.banggood.com/SN-2549-Pin-Crimping-Tool-28-18awg-for-Dupont-Terminals-p-1159772.html?utm_design=41&amp;utm_source=emarsys&amp;utm_medium=Neworder171109&amp;utm_campaign=trigger-emarsys&amp;utm_content=winna&amp;sc_src=email_2675773&amp;sc_eh=02f36d14aa0c574f1&amp;sc_llid=8487213&amp;sc_lid=105229698&amp;sc_uid=1T1U6tHNIm&amp;cur_warehouse=CN">SN-2549 Pin Crimping Tool for Dupont Terminals</a>. Once these arrive your ready to get going.</p><p>Firstly you have to find all of those old ethernet cables that you have lying around! They’re always getting in the way making things look untidy when you <strong>don’t</strong> need them. When you <strong>do</strong> need them however they’re harder to find!</p><p>When you do find one then you snip off the RJ45 plug (stash it somewhere safe, you never know when you might need one!) and strip off about 3mm of on of the cables inside (I used a stanley knife for this but it’s probably easier and quicker if you cable stripper). Pick off one of connectors in your Dupont kit and place the wire into it. I’m afraid you’re going to have to get used to slightly blurry images in this post, it’s really difficult to get good focus on these wires.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hm8e2Ew0SEvROLG5M2DkQQ.jpeg" /></figure><p>Then it’s time to place this wire into your crimper. It worked best for me by pinching the silver connector around the cable to hold it in place before offering to the crimper.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HS6erxrK41redYJZLmXcJA.jpeg" /></figure><p>I’m right handed so you want to have the fixed arm of the crimper on top and pull the other arm up to crimp the wires with your fingers. If you’re connecting a female head you want to make sure that the square / cuboid end of the head that male pin will slot into is not within the jaws of the crimper, otherwise you’re obviously going crush it and you’ll not be able to connect male and female.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KdxrpnuM-OQ3zX0kes8X4g.jpeg" /><figcaption>The view from above</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wS0fG5aKfhPFqENp6ox-Gw.jpeg" /><figcaption>from below, note that the cable is twisted slightly in the jaws and will not give a great finish if you don’t square it up</figcaption></figure><p>Once you’re happy that everything is lined up correctly squeeze the jaws together until you hear the click that tells you that cable can be released. TO be honest it took me a few attempts to get a connection that I was happy with but eventually I was able to get connections such as the orange one below which I was happy with (you can see a previous attempt on the blue wire which wasn’t so good).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*emn14IHeUJBDeutH9xZi0A.jpeg" /></figure><p>This connection may look a bit crooked but it’s actually just the angle I’ve taken the image from. Now you can put on one of the black heads. Push the cable down into the housing until you hear a small click to tell you it is properly in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IXOQcv3lnP9X_7zndwsu6Q.jpeg" /></figure><p>An now the moment of truth; will it fit to a RaspberryPi GPIO pin?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_AaMtbX17I-B2UFBysHKwQ.jpeg" /></figure><p>Yup, it certainly will. The man-made attempt is the orange cable on the right alongside some inferior machine-made cables on the left :)</p><p>Hopefully I’ll get a bit quicker and better at making these RaspberryPi jumpers from ethernet cables as I do more of them. I’m happy though that this is going to cut down the number of cables I will have running outside and within my vivarium and should generally make things a bit tidier and safer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f69cca4d8c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using the RaspberryPi Camera with TerrariumPI and Web-Streaming your Reptile!]]></title>
            <link>https://medium.com/@jinky32/using-the-raspberrypi-camera-with-terrariumpi-and-web-streaming-your-reptile-4c6676bbb1aa?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c6676bbb1aa</guid>
            <category><![CDATA[raspberry-pi-camera]]></category>
            <category><![CDATA[webcam]]></category>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[reptiles]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 22:29:51 GMT</pubDate>
            <atom:updated>2019-02-18T22:29:51.112Z</atom:updated>
            <content:encoded><![CDATA[<p>In a previous post I discussed <a href="https://medium.com/@jinky32/adding-a-camera-to-raspberrypi-for-use-in-terrariumpi-9629b027c746">how to add a USB camera to the RaspberryPI and connect it with your TerrariumPI</a>. That was OK but I said at the end of that post that I was really waiting for a proper RaspberryPi camera to arrive from China. Fortunately that day has now arrived and my s<a href="https://www.ebay.co.uk/itm/Camera-Module-Board-5MP-Webcam-Video-1080p-720p-for-Raspberry-Pi-3-Green-X7P9/192643654474?ssPageName=STRK%3AMEBIDX%3AIT">uper cheap camera</a> has arrived!</p><p>I’m not going to repeat some of the basic RPi config that you have to do to make sure your RPi is set up to support a camera so if you haven’t already done that I suggest you take a look at the previous post (it’s very easy, even I did it!). Once you have done that navigate to the TerrariumPI UI at &lt;LANIP&gt;:8090 (e.g.192.168.1.2 :8090), navigate to the Webcam menu item on the left and choose the Settings sub -menu item. The page you reach should have a blue + button top right; click it and you should see the form below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/654/1*YRRifiA8d1RyvPz0IQt8Ww.png" /></figure><p>As you can see you need to set the Location to <em>rpicam_live </em>if you want to see a stream from inside your vivarium. Click the ‘Submit button’ and go to webcam &gt; show menu item and you should see everything pulling through nicely</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*s-5MZyB3igm--lavMZ-49Q.png" /><figcaption>Nothing is awake at dusk…</figcaption></figure><h4>Viewing your TerrariumPI stream through VLC</h4><p>So having this webcam set up is great and at any time you can connect to your TerrariumPI to see what is going on, but what you really want is to be able to watch your reptiles through something like VLC, fortunately TerrariumPI makes an HLS Stream available at <a href="http://[mylanip]/webcam/a94df035fc91a158c1f9d7a1c769ca66/stream.m3u8">http://[mylanip]/webcam/a94df035fc91a158c1f9d7a1c769ca66/stream.m3u8</a>.</p><p>Connecting this to VLC is as simple as (on a Mac) opening VLC, clicking file &gt; open network and entering the complete URL above into the URL field that you are presented with. The stream should open pretty instantly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Y-EcGOCn6ly38CxplbVcw.png" /><figcaption>TerrariumPI web stream viewed through VLC.</figcaption></figure><p>Obviously this is going to only work if you are viewing inside your LAN. If you want to be able to watch this on the go you are going to need to open up your RPi to the internet. It’s quite simple to do this, but not so simple to do it securely; probably the best option (and the route I have taken) is to use <a href="http://dataplicity.com/">Dataplicity</a>. There’s a great tutorial on youtube that I followed with no problems</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAXE7aAVM0sM%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAXE7aAVM0sM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAXE7aAVM0sM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/85e5c2ab9ba5f4281993ec667e9d6d5e/href">https://medium.com/media/85e5c2ab9ba5f4281993ec667e9d6d5e/href</a></iframe><h4>Archiving Your Images</h4><p>I don’t have a massive SD Card in my Raspberry Pi so I was interested in copying the still images that are captured by the camera (I have the archive field set to ‘Motion’ on the webcam settings) to a remote storage. Currently I have a QNAP NAS device that I use for storing photos, music, film rips etc so I decided to store the stills from the TerrariumPI there by creating a shell script with an <em>rsync</em> command which runs on cron. If you don’t have a QNAP or some other kind of NAS I think the below would work for you on another Linux box.</p><p>On the machine that you want to rsync the images to (destination in rsync terms) ssh in and create a directory to hold your script. On the QNAP I chose to create a directory in the Multimedia shared folder (be careful because some directories are deleted by the QNAP on boot I think) <em>/share/Multimedia/&lt;yourscriptfolder&gt;</em>. In this directory create a file called backup.sh, (<em>touch backup.sh) </em>and then add in the rsync command :</p><p><em>rsync — remove-source-files -ae ssh pi@&lt;yourrpilanip&gt;:/home/pi/TerrariumPI/webcam/archive/ /share/Multimedia/Ackies/</em></p><p>this should copy your images from the RPi to the destination and also remove the images from the source. Before you can run this you will need to make the file executable to admin</p><p><em>chmod u+x backup.sh</em> (assuming you are in the directory that contains backup.sh when you run this command). To test this you can run the script manually <em>./backup.sh</em> and you should be prompted for the password for the source device. Everything being well you should see the files appear on the destination device.</p><p>In order to get this running on cron you will need to set up passwordless SSH access and in order to set this up please see the guide on <a href="https://www.raspberrypi.org/documentation/remote-access/ssh/passwordless.md">raspberrypi.org</a>. Next you just need to tell cron to run this script:</p><p><em>echo “01 30 * * * /path/to/backup.sh” &gt;&gt; /etc/config/crontab</em></p><p>to check this has worked run <em>cat</em> <em>/etc/config/crontab </em>and you should see your script at the bottom of the file.</p><p>Phew, so thats it! You should now have a webcam set up on your TerrariumPI, be able to view it via web or VLC (either on LAN or WAN) and automatically archive any stills that are taken to a different machine.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c6676bbb1aa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding a Camera to RaspberryPi for Use in TerrariumPI]]></title>
            <link>https://medium.com/@jinky32/adding-a-camera-to-raspberrypi-for-use-in-terrariumpi-9629b027c746?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/9629b027c746</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[webcam]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Sat, 26 Jan 2019 20:43:52 GMT</pubDate>
            <atom:updated>2019-01-27T09:53:21.158Z</atom:updated>
            <content:encoded><![CDATA[<p>This isn’t going to be a long post because I’m not really implementing a solution that I would want to use in a real setup. Rather I’m using a USB camera that I had lying to around to get an idea of how static images (and ultimately a streaming web cam) might be available via TerrariumPI.</p><p>In my case I had an old PS3 USB camera in a drawer somewhere; you may well have a similar old piece of hardware available and hopefully this post gives you a way to quickly use that within the TerrariumPI before you decide on whether or not to by a proper camera for RaspberryPi.</p><p>The first step is to ssh into your RPi and run sudo <em>raspi-config. </em>This should bring you to a screen that looks like the below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*nvzeAS2w_dcMUW4ebzEBCg.png" /></figure><p>From this menu you want to select item 5 — Interfacing options (you navigate this menu via the arrow keys on your keyboard and hit enter to select).</p><p>On the subsequent menu you want to select P1 Camera which brings you to this prompt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*7aUjMyXyD_cr5iPrMqPuNQ.png" /></figure><p>hit the left key to highlight &lt;yes&gt; and press enter, select OK on the next screen and you should be taken back to the first menu you encountered. Here press the right arrow key to drop down through the menu items until you get to Finish and then hit enter. Then choose to reboot your RPi. From now on all the config you need to do will be done from within theTerrariumPI interface.</p><h4>Adding a Webcam to TerrariumPI</h4><p>Navigate to the TerrariumPI UI at &lt;LANIP&gt;:8090 (e.g.192.168.1.2 :8090), navigate to the Webcam menu item on the left and choose the Settings sub -menu item. The page you reach should have a blue + button top right; click it and you should see the form below (you can see the details I have added).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*UVl7PX-3_-BIdjJ8ld_oDA.png" /></figure><p>I’m pretty sure that you can use the <em>/dev/Video0</em> location and things should work for you, but if you need to check the location of your camera you can run <em>ls -ltrh /dev/video*</em> which should confirm the location.</p><p>Going through these steps should setup a static camera for you. It is possible to set up a streaming camera which uses <a href="https://en.wikipedia.org/wiki/HTTP_Live_Streaming">HLS</a>. In order to do this you go through exactly the same process as above but in the location field you need to use <em>rpicam_live</em> rather than <em>/dev/Video0</em> in the location field. I’m definitely going to set this up but at the moment I’m (impatiently) waiting for a couple of cameras (<a href="https://www.ebay.co.uk/itm/New-Camera-Module-Board-5MP-160-Wide-Angle-Fish-Eye-Lenses-For-Raspberry-Pi/282476072609">Camera Module Board 5MP 160° Wide Angle Fish Eye Lenses For Raspberry Pi</a> &amp; <a href="https://www.ebay.co.uk/itm/Camera-Module-Board-5MP-Webcam-Video-1080p-720p-for-Raspberry-Pi-3-Green-X7P9/192643654474">Camera Module Board 5MP Webcam Video 1080p 720p for Raspberry Pi 3</a>) to arrive from China. To be clear you can currently only use one webcam at a time on the RPi, but I wanted to try out both of these cameras. I’ll post more when they arrive!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9629b027c746" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Connecting a 12v 8 Channel Relay to an External Power Supply and RaspberryPi]]></title>
            <link>https://medium.com/@jinky32/connecting-a-12v-8-channel-relay-to-an-external-power-supply-and-raspberrypi-6fec119c112c?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/6fec119c112c</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[relay-module]]></category>
            <category><![CDATA[relay]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Sat, 19 Jan 2019 16:03:24 GMT</pubDate>
            <atom:updated>2019-01-20T15:15:40.413Z</atom:updated>
            <content:encoded><![CDATA[<h4>…So that you can control devices via TerrariumPI</h4><p>Apologies for the SEO-optimised H1 on this post but I had a lot of trouble trying to find out how to go about this so hopefully this post will help a few other newbies out!</p><p>In previous posts I’ve gone over getting the TerrariumPI set up on a RaspberryPi 3 and then adding a temperature and humidity sensor to the RPi. In this post I’m going to cover how to connect a device (in this case a lamp) to the RaspberryPI, and have TerrariumPI turn it on or off depending on the values from the sensor.</p><p>In order to be able to do this you will need a RPi with TerrariumPI set up (obviously!) and have a sensor connected. In addition you will need:</p><ol><li>A relay (this post is covering a <a href="https://www.amazon.co.uk/gp/product/B0794RF1ZW/">12v 8 Channel Relay</a>)</li><li>An external 12v power supply. Most of the guides I read used a 5v relay which means that you can draw power from your RPi. If you have a 5v relay there are lots of guides on YouTube / tutorial sites which show which GPIO pins you need to connect to your relay.</li><li>Some jumper cables. For my board I needed female to male cables, you may need different depending on the board you have.</li><li>Something to control via the relay. I chose a desk light for demo purposes.</li></ol><h4>Connecting the external power supply to the relay</h4><p>I’m sure I don’t really have to say this, but PLEASE MAKE SURE YOUR POWER SUPPLY IS NOT PLUGGED IN WHILE YOU STRIP THE WIRES ETC!!</p><p>Fortunately I tend to keep a load of random plugs, cables (anyone need any SCART cables?) etc so I was able to go into the loft and find an old 12v power supply that I think used to power a Netgear router. Snip off the end jack, remove about 20mm of the isolation on the wires inside and twist the copper wire inside.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-7rP-K3WpS-PL1BH9MzvA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eezB23fK1nWSkZFBMXcpAQ.jpeg" /></figure><p>On power supply cables like this you normally see one wire with a white dashed line and one without. Typically the wire with the dashed line is the positive and the one without is the ground.</p><p>On my relay the power and ground connection were marked DC+ and DC-(unlike most of the other relays which I think were marked JD-VCC and ground) which meant that the DC+ took the positive and the DC- took the ground.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SfCcBYlJ7nwp2E1Lmc63RQ.jpeg" /></figure><h4>Connecting a lamp to the relay</h4><p>OK, so now you have a way of getting power in to the relay so now you need to connect something to receive that power.</p><p>I chose a desk lamp and took off the outer insulation about halfway between the lamp and the plug, snipped the live wire and stripped either end (leaving the neutral untouched)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSUG_U90EFO1NNWazYxoOw.jpeg" /></figure><p>I attached one end of the live to the central COM port on the relay and the other to the NO (normally open) port on the left. Initially I had it connected to the NC (normally closed) which caused me much head-scratching later until I was corrected by one of the friendly people on the TerrariumPI Github Issue queue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZBWdnXULFi3ZSjrpCZ3svA.jpeg" /></figure><h4>Connecting the relay to the RaspberryPi</h4><p>Once again <a href="https://pinout.xyz/">Pinout</a> is the resource you need here. I connected the DC- (ground) on the relay module to GPIO physical pin 39 on my RPi and then connected IN1 on the relay to GPIO physical pin 37 on my RPi.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9P5iZyFV0_afSofakHSRQw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X8fD0skbPnwamnagsO6fkg.jpeg" /></figure><p>Once you are sure that you are correctly and safely wired up you can plug in the external power supply to the relay module.</p><h4>Testing the RaspberryPi and Relay connection</h4><p>The video below and this <a href="https://github.com/Mattrachwal/gpio-8channel-relay-test">Python script</a> are really useful to test that you have everything connected properly, if you do the LEDs on the board should light up in turn and you should hear a clicking sound from each relay.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUr0w7VeLX08%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUr0w7VeLX08&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUr0w7VeLX08%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/05fb50cf9616c79d39da112da70a2837/href">https://medium.com/media/05fb50cf9616c79d39da112da70a2837/href</a></iframe><h4>Adding the relay as a switch in TerrariumPI</h4><p>Phew, we got to the whole point of this post! OK, so head to your TerrariumPI at <a href="http://raspberrypi:8090/">http://raspberrypi:8090</a> (unless you have changed the port settings for some reason) and navigate to Switches &gt; settings and click the blue + button.</p><p>In the form I entered the below details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*Slozkv-JlPa8EricuH_9pw.png" /></figure><p>The address for GPIO connected devices is the physical pin number If you followed what I have done then yours will be 37 as well. If you now head back to the status submenu item you should something like the below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*0aAqsYnlxKi-M_R-dL6STA.png" /></figure><p>clicking on the on/off icon will, well, you can probably guess! If clicking to turn the switch off for some reason turns your light on you can set the hardware field in the switch settings above to GPIO Inverse and it should behave normally.</p><p>You can see mine working below</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FjqYIoOvZkC8%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DjqYIoOvZkC8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FjqYIoOvZkC8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8247e024c39a333abcb103dc72492eed/href">https://medium.com/media/8247e024c39a333abcb103dc72492eed/href</a></iframe><h4>Controlling your device via a sensor</h4><p>Now that we have everything connected so that we can control the light manually it’s time to turn to automating its state based on sensor readings. There are two parts to this 1) the alarm min and max values that you set on the sensor 2) the configuration that you will need to do in the environments section.</p><p><strong>Alarm min and max settings</strong></p><p>In Sensors&gt;settings menu you should see something like the below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*n2QaI_86Z1p0MQzvfefHqg.png" /></figure><p>My use case here is to turn the light on when the temperature falls below a certain temperature (the value you set in Alarm min) and turn it off when it exceeds a certain temperature (the value you set in Alarm max).</p><p><strong>Environments configuration</strong></p><p>Navigate to the page at System &gt; Environment and locate the Temperature box (it was at the top of the page for me).</p><p>In the form fields:</p><ol><li>Set Mode to Sensor</li><li>Click in sensors field and choose the one that you want the switch to respond to.</li><li>Set your Day/night difference and Day/night source settings. These weren’t very important to me for this test so I set arbitrary values.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1014/1*XCNdBunlNMV2rT9kRz_H5g.png" /></figure><p>Now, because my use case is to turn the lights on when the temperature falls below a defined point I entered values into the Low Alarm fields. If my use case was to turn on some device when the temperature exceeded a defined point (for example turn a cooler on when the temperature exceeded 100 degrees) I would have chosen the High Alarm fields. Don’t set values in both areas, it will make the switch behave very strangely (trust me ;-) ).</p><p>Because we have chosen for our device to be controlled by sensor values rather than a timer the first four fields are not editable. You can see the values I chose below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*QU8j7SANCBenEHCYxbuTzg.png" /></figure><p>The Power on field says it `Holds the amount of seconds that this environment part is powered on when the value is out of range.` I’m not entirely sure what this means, but I assume that it is a delay to the light going on or off when the temperature reaches its min or max value. I currently have no need for this so I set it to 0.</p><p><strong>Update from project maintainer </strong><a href="https://github.com/theyosh"><strong>theyosh</strong></a> — re “Holds the amount of seconds that this environment part is powered on when the value is out of range: This is now only used for spraying. If this value is higher then zero, it will define the power on duration when switched on. For spraying I have a single spray time of 20 seconds. And then turn of. This way, you can trigger short power bursts. For heating and lighting it is not usable, and should enter zero to disable this behavior.”</p><p>The Settle timeout field is for `How much time must there be between two actions and after start up. Enter the amount of seconds in which this environment part can settle.` Again I’m not 100% on what this means but I think it’s to stop lights (or other devices) toggling on and off quickly as temperature rises and falls. Again I set an arbitrary value here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*QU8j7SANCBenEHCYxbuTzg.png" /></figure><p><strong>Update from project maintainer </strong><a href="https://github.com/theyosh"><strong>theyosh</strong></a> — re “How much time must there be between two actions and after start up. Enter the amount of seconds in which this environment part can settle.: This is used for spraying, heating and cooling. This means that there must be at least X seconds between two actions. And this is only handy for dimmers. When the temperature is to low, the environment will dimm less and therefore more power to the heating system. This will heatup the temperature. But the temp changing could take 2 minutes, and the environment will change the dimmer value every 15 seconds. So in the end, the heater will get to warm.</p><p>A second example with spraying is that after spraying the humidity will rise slowly. So I said wait 2 minutes before a second spray action. And mostly the humidity is within the valid range and the sprayer is not needed anymore.”</p><p>Once you’ve done all this head back to the Home &gt; Dashboard page and you should see the Environments panel on the right hand side has been populated with the values you set</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*FrRR59ngd1po9eZHFwHhrQ.png" /></figure><p>Now, if you put the temperature sensor somewhere where the temperature is below the Alarm min value the light should turn on. Then once the temperature gets above the Alarm max value it should turn off.</p><p>That’s it! We’ve done it! Ultimately I would like to get to a point where I can dim the power going to a device (for example my Arcadia Deep Heat) to replicate a dimming thermostat so that a device never really turns fully on or off it just dims to keep within range. This is better for the Deep Heat but I need to do some more reading to see if it is possible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6fec119c112c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TerrariumPI — Adding a Sensor]]></title>
            <link>https://medium.com/@jinky32/terrariumpi-adding-a-sensor-8afef4909fbe?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/8afef4909fbe</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[herpetology]]></category>
            <category><![CDATA[ackie-monitor]]></category>
            <category><![CDATA[reptiles]]></category>
            <category><![CDATA[terrariumpi]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Sat, 12 Jan 2019 16:26:40 GMT</pubDate>
            <atom:updated>2019-01-12T16:32:15.421Z</atom:updated>
            <content:encoded><![CDATA[<h3>TerrariumPI — Adding a Sensor</h3><p>OK, this is the part that I was dreading, the electronics! In my last post I went though <a href="https://medium.com/@jinky32/setting-up-your-raspberrypi-and-installing-terrariumpi-97f2d2e8e6f">how to set up your RaspberryPi and install TerrariumPI</a>, in this post I’m going to go through adding a temperature and humidity sensor.</p><p>I’ve already mentioned that the electronics aspect of this project is where I have the steepest learning curve, partly this is because I have no knowledge and partly because the RPi/electronics newbie is confronted by so many acronyms! The first three that scared me where:</p><ol><li>GPIO</li><li>I2C</li><li>1-Wire (OK this isn’t an acronym, but it is still shrouded in mystery!)</li></ol><h4>GPIO</h4><p>Not so scary after all it seems — General Purpose Input Output. I found <a href="https://pinout.xyz/">pinout</a> to be a fantastic reference for figuring out which pins do what.</p><h4>I2C</h4><p>This seems to be a (now open) protocol for connecting devices (including sensors, other micro-controllers etc) to a primary micro-controller. Devices take power (3.3v, 5v, or both), a SCL (serial clock, I assume this is to regular the timings that measurements are taken but that’s a guess!) and SDA (serial data which presumably is responsible for controlling the flow of data between components).</p><p>It seems that you can set up multiple I2C components in parallel, connecting the SDA and SDC from one to that of another. I’m not entirely sure if you can do with the same with power or if you have to take a power feed from another RPi GPIO pin but I hope you can otherwise you will start to run out of GPIO pins pretty quickly.</p><p>I found this video quite helpful for a newbie introduction to I2C:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6IAkYpmA1DQ%3Fstart%3D489%26feature%3Doembed%26start%3D489&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6IAkYpmA1DQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6IAkYpmA1DQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2023d724a21691cb1adc1e025de0b706/href">https://medium.com/media/2023d724a21691cb1adc1e025de0b706/href</a></iframe><h4>1-Wire</h4><p>I still don’t really know what this is and haven’t had to red up on it yet. I’m assuming that it’s similar to I2C but requires 1 wire (presumably plus another for power?)!</p><h3>Adding your first sensor, what not to do!</h3><p>First up I decided to go with the super-cheap <a href="https://www.adafruit.com/product/385">DH22</a> temperature and humidity sensor which turned out to be a mistake. It featured in a lot of RPi/temperature/humidity tutorials I read through but none of these were using TerrariumPI where there are a number of reported issues in the <a href="https://github.com/theyosh/TerrariumPI/issues">issue queue</a>.</p><p>In terms of pure RPi compatibility it was fine. I was able to wire it up easily after a quick read of a <a href="https://www.rototron.info/dht22-tutorial-for-raspberry-pi/">rototron tutorial</a>. I was also able to get a temperature and humidity reading when connected to the RPi via SSH but using the example scripts in the Adafruit library which comes bundled with TerrariumPi.</p><p>For example, once you have SSH’d into your RPi (open your terminal and type <em>ssh pi@&lt;RPILANIP&gt;</em>, and enter the password — <em>raspberry</em> by default if you haven’t changed it. Then type cd <em>Adafruit_Python_DHT/examples </em>and then <em>sudo python test.py. </em>This should print the temperature and humidity to your terminal. Unfortunately however these sensors were not recognised by TerrariumPI</p><h3>Adding a sensor, take 2!</h3><p>On the advice of the project maintainer I purchased:</p><ol><li><a href="https://taaralabs.eu/1-wire-humidity-temperature-sensor/">1-Wire Humidity and Temperature sensor</a> and</li><li><a href="https://taaralabs.eu/1-wire-shield-for-wemos-d1/">1-Wire Shield for WeMos D1</a></li></ol><p>In both cases I purchased the most complete, works-out-of-the-box options I could!</p><p>I have to say that the customer support from <a href="https://taaralabs.eu/">Taaralabs</a> was awesome and Mart put up with my newbie questions about what on earth I was supposed to do with the things I had bought. What I was really after, and what Mart provided, was a map of which GPIO pins mapped to which connections on the 1-Wire shield (as an aside I assume that ‘shield’ is just a generic term used to refer to the board onto which the electronic components are fixed, rather than a description of some ‘shielding’ functionality they perform. I may be wrong though).</p><p>The mapping of 1-Wire board to RPi GPIO is below</p><p>1-Wire board | Raspberry PI</p><p>GND | 9 (GND)<br>5V | 2 (5V)<br>3.3V | 1 (3.3V)<br>D1 | 5 (SLC)<br>D2 | 3 (SDA)</p><p>This was all very easy to connect. I wasn’t sure whether both 3.3v and 5v connections would need to be made but apparently they do. Quoting Mart</p><blockquote>1-Wire network works at 5V signal levels but IO levels of modern microcontrollers, including Raspberry-PI’s is 3.3V. TaaraLabs.eu/ow1 board includes a level converter to fix that problem. Both sides (high and low) need to have a power source for it to work and this is why this board needs both 3.3V and 5V power input.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wj_0639JF0_RYwO-afKt7Q.jpeg" /><figcaption>1 Wire humidity and temperature sensor connected to 1 wire shield (via RJ45) and wired to RPi</figcaption></figure><p>As a really pleasant surprise I found that when I went to the dashboard on my TerrariumPI I found that the sensor had been automatically recognised. I had thought I would have to find the address of the sensor and then add it manually, but no — all done for me :)</p><p>One small aspect of configuration that you will need to do is set the thresholds in the sensors &gt; settings menu. This will remove the red ‘warning’ label above your sensor readings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqR8DK2BD3nOIdfireprOw.png" /><figcaption>The settings I chose for the sensor</figcaption></figure><p>On the dashboard of your TerrariumPI you should now see something similar to this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9RE4UHzgEzWg9SkqbUw_5g.png" /><figcaption>Woot! It works!</figcaption></figure><h3>Next steps</h3><p>So, all’s well that ends well! Now that I have a sensor added my next step will be to try and do something (e.g. turn a light on and off) based on the readings from that sensor. I have purchased <a href="https://www.modmypi.com/raspberry-pi/relays-and-home-automation-1032/relay-boards-1033/8-channel-12v-relay-module">https://www.modmypi.com/raspberry-pi/relays-and-home-automation-1032/relay-boards-1033/8-channel-12v-relay-module</a>) which I hope will be able to do the job. However reading the TerrariumPI docs, it looks like I should have something like <a href="https://www.tindie.com/products/nEXT_EVO1/universal-ac-mains-dimmer-mpdmv41/">Universal AC MAINS Dimmer — MPDMv4.1</a> if I want to replicate a dimming thermostat as is preferable for my Deep Heat projectors etc.</p><p>Anyway, lots more reading to be done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8afef4909fbe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting up your RaspberryPi and Installing TerrariumPi]]></title>
            <link>https://medium.com/@jinky32/setting-up-your-raspberrypi-and-installing-terrariumpi-97f2d2e8e6f?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/97f2d2e8e6f</guid>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[herpetology]]></category>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[bioactive]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Sun, 06 Jan 2019 15:35:16 GMT</pubDate>
            <atom:updated>2019-01-09T19:58:30.734Z</atom:updated>
            <content:encoded><![CDATA[<p>In my <a href="https://medium.com/@jinky32/getting-back-into-herpetology-and-learning-with-the-terrariumpi-project-1be779f85d11">first post</a> I gave a little context for why I am interested in the <a href="https://github.com/theyosh/TerrariumPI">TerrariumPi project</a> and provided some information on the vivarium setup I have for my pair of Ackie Monitors.</p><p>In this post I’m going to briefly go over setting up the RaspberryPi and installing TerrariumPi on it. There’s really not much to this so it’s going to be a pretty short post!</p><h4>Setting up Your RaspberryPi</h4><p>I am using a <a href="https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/">Raspberry Pi 3 Model B+</a> with a <a href="https://www.amazon.co.uk/gp/product/B073K14CVB/">SanDisk Ultra 16GB microSDHC</a> card. In order to get TerrariumPi set up on a new RPi you will need to:</p><ol><li>Install an Operating Systems on the RPi. TerrariumPi is tested to run on <a href="https://www.raspberrypi.org/downloads/raspbian/">Raspbian Stretch Lite</a> so the first thing to do is head there and download Raspbian Stretch Lite (you can download other versions with a desktop GUI but that’s not really required for what we’re doing here).</li><li>Format your SD card — the best bet is to go with the formatter tool available from the <a href="https://www.sdcard.org/downloads/formatter_4/">SD Association </a>.</li><li>Once that is done you can flash the OS to your RPi using <a href="https://www.balena.io/etcher/">Etcher</a></li><li>Your next steps are to enable SSH access, connect to wireless network etc. Rather than cover that here I’ll just point you to a tutorial on <a href="https://desertbot.io/blog/headless-raspberry-pi-3-bplus-ssh-wifi-setup">desertbot.io</a> that should get you up and running.</li></ol><h4>Installing TerrariumPi</h4><p>Again, rather than repeat what has already been written perfectly well I’m just going to point you to the installation instructions on the <a href="https://github.com/theyosh/TerrariumPI#installation">Terrarium Pi project</a>.</p><p>Once you’re set up it might be worth making sure that you set your RPi with a static LAN IP in your router so that you can reliable address it via the same LAN IP address.</p><p>That’s it, you now have TerrariumPi all set up on your RPi and you should be able to access the user interface at &lt;yourraspberryPILANIP&gt;:8090 or <a href="http://raspberrypi:8090/">http://raspberrypi:8090</a>. Of course the real power of the TerrariumPI project will come when you set up the sensors etc (something I’ll try and puzzle that out over the next few posts) but if you want to try get weather information about a geography where your reptile you can do this quite easily.</p><p>Within the TerrariumPI interface expand the Home menu on the left and select ‘Weather’. In the box headed weather hit the spanner icon and click settings. Then in the ‘Weather location’ field add the URL of the location you want to get the conditions for. Just visit <a href="https://www.yr.no/">https://www.yr.no/</a> search for the location and then copy the link — for example my Ackies come from the Australian Northern Territories so I searched for Katherine and got the URL <a href="https://www.yr.no/place/Australia/Northern_Territory/Katherine/">https://www.yr.no/place/Australia/Northern_Territory/Katherine/</a>. Pasting this into the ‘Weather location’ field pulls all of that data into TerrarumPI. Very cool!</p><p>One thing that might catch you here is that you will need the username and password to save the changes. It wasn’t apparent to me what these were, but as mentioned in this issue <a href="https://github.com/theyosh/TerrariumPI/issues/14">https://github.com/theyosh/TerrariumPI/issues/14</a> they are admin / password (definitely worth changing, especially if you ever think about opening your RPi to the internet).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97f2d2e8e6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting back into Herpetology and learning with the TerrariumPI project]]></title>
            <link>https://medium.com/@jinky32/getting-back-into-herpetology-and-learning-with-the-terrariumpi-project-1be779f85d11?source=rss-f0eaa4765b76------2</link>
            <guid isPermaLink="false">https://medium.com/p/1be779f85d11</guid>
            <category><![CDATA[terrariumpi]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[ackie-monitor]]></category>
            <category><![CDATA[herpetology]]></category>
            <dc:creator><![CDATA[Stuart Brown]]></dc:creator>
            <pubDate>Fri, 04 Jan 2019 17:37:24 GMT</pubDate>
            <atom:updated>2019-01-06T15:38:35.696Z</atom:updated>
            <content:encoded><![CDATA[<p>I’m starting this series of posts mainly because I want to document my progress through learning to use the awesome-looking <a href="https://github.com/theyosh/TerrariumPI">TerrariumPI project</a> installed on a RaspberryPi3 (RPi from now on) that I’ve had since last Christmas. The TerrariumPI project brings together two things that I love and one thing that I know really very little about.</p><p>The aspects that I love are:</p><ol><li>Coding — I’m no expert, but I’m reasonable in a few languages and generally enjoy researching around to try and solve the problems I come across.</li><li>Herpetology — since primary school when some guy brought in some snakes and lizards I have loved reptiles. I was lucky enough that my parents allowed me to get a garter snake when I was 13 and I went on to have two common boas, a corn snake, a royal python and two leopard geckos before I went to university and had to give them all up. Now, twenty-something years later, I have just built a vivarium for a couple of young Ackie Monitors and am loving herpetology again.</li></ol><p>The aspect of the TerrariumPI / RPi that I really have very little experience with is electronics. I really have a steep learning-curve ahead of me here; most of what I have read or watched regarding extending the RPi has gone way over my head. Still, it’s not like poor knowledge of electricity is going to kill anyone right…?</p><p>Before getting into the RPi aspect of this series of posts I wanted to show you little of the work that I have doing in building the Ackie Monitor vivarium.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcKgNqepcbrz53PN9nn9Dw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iZOFF1O2pb2Cu3q_mirhGQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eNGrK7BmcyNrTEQzUMm4Ww.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1BEYPqwo5p9ZPk42uh1Zw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qxk9L27QwCmS9pRBkBgRqg.jpeg" /><figcaption>Ackie Monitor vivarium build process.</figcaption></figure><p>I did an enormous amount of research into how to build a naturalistic (or bioactive) environment for these monitors but would like to mention a few resources that were invaluable in helping me learn what was required:</p><ol><li>There’s a lot of information online about how to create fake rock backgrounds etc and most of the guides that you read suggest using tile grout to do this, however I found the method on the YouTube video below (described at 47.30) to be best for me:</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuW907qYDej0%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuW907qYDej0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuW907qYDej0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/47f2171e4c06ccb897089b7eed9e5f9b/href">https://medium.com/media/47f2171e4c06ccb897089b7eed9e5f9b/href</a></iframe><p>2. The <a href="https://www.facebook.com/groups/AdvancingHerpHusbandry/">Advancing Herpetological Husbandry</a> Facebook Group is a great place to learn more about how other people are building their environments and to ask plenty of silly questions and get very helpful replies from people who know their stuff and care about their animals.</p><p>3. The <a href="http://www.facebook.com/groups/ReptileLighting/">Reptile Lighting</a> Facebook Group is THE place to get expert advice on how to heat and light the vivarium to provide the best environment for your reptile.</p><p>So, this is how the vivarium looks now:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIFCVJh_hwKUVMmq1EJXnA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTLXAA_EE3RNjYcrGTZTOQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpkgFelO6pbslWw4uKUWLg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LUsQcVIt0s62kWNQFPSFuQ.jpeg" /></figure><p>and here are a few images of the two Ackies in there:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XAurjDl11FzDhYTGaheRbg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RHp3W8lMfrAJukN7d78B_g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQHhOSCfZ-WB40zIlwIAtw.jpeg" /></figure><p>In terms of the heat and lighting equipment that I have in place at the moment I have:</p><p><strong>Heating</strong>:</p><ol><li>Two Arcadia Deep Heat projectors</li><li>One Arcadia Solar Flood (100w)</li><li>One Par 38 Halogen Flood</li></ol><p>These are paired, so each Deep Heat has with it either a Solar Flood or a Halogen.</p><p><strong>Lighting</strong>:</p><p>As well as the Solar Flood and Halogen for heat there is also:</p><ol><li>Two Arcadia Dragon Lamps for UVB.</li><li>A <a href="https://zoomonster.com/epages/Shop_Econlux.sf/de_DE/?ObjectPath=/Shops/Shop_Econlux/Products/00011500">SolarRaptor SunStrip</a> LED which provides great visible light and also keeps the live plants in the viv alive. It has the CON1 controller which allows me to create a sunrise, daytime and sunset schedule.</li></ol><p>Most of the heat / lights above are controller by a Microclimate Pro Evo which allows me to control heat and humidity (humidity is provided a Lucky reptile SuperFogger2). Essentially it is this Microclimate that I will be seeking to replace with the TerrariumPI project.</p><p>The <a href="https://medium.com/@jinky32/setting-up-your-raspberrypi-and-installing-terrariumpi-97f2d2e8e6f">next post</a> will be a brief one on how to set up your RPi and install TerrariumPi.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1be779f85d11" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>