<p>My project is a cat feeder with automatic opening/closing lid (triggered by a distance sensor) and LED light emitting diodes changing color regarding the quantity of food left in the bowl (thanks to a force sensitive resistor).</p>
<p>Therefor, several electronic components will be necessary and will require a clean wiring.</p>
<h3>RGB LEDs</h3>
<p>Two 5mm foggy round 4 pin RGB LED Light Emitting Diode (Common cathode) will be used on top of the feeder.</p>
<spanclass="image object">
<imgsrc="../images/aukenienLEDrgb.jpg"alt="...">
</span>
<p>Each of them has 4 pins that will be connected to the ESP32 Wroom.</p>
<spanclass="image object">
<imgsrc="../images/anode-cathode.jpg"alt="...">
</span>
<p>So 8 pins will be used on the ESP32, minus one as I will weld the 2 GND pins together (the ESP32 only has 3 GND pins).</p>
<spanclass="image object">
<imgsrc="../images/LEDsWired.jpg"alt="...">
</span>
<blockquote>
I thought about soldering both LEDs' similar pins together but someone (my lovely husband) reminded me that if one LED gets damaged, both will turn off. Not such a good idea then !
</blockquote>
<h3>Distance Sensor</h3>
<p>To get the bowl lid to automatically open and close, the first step is to detect an object (in this case a cat or it's human slave) at a determined distance of the feeder.</p>
<p>For that I will use an HC-SR04 Ultrasonic Sonar Distance Sensor which has 4 pins to attach to the ESP32.</p>
<p>As I only used 1 GND pin for both LEDs, I will use another one for this component (I could weld it to the LEDs' GNDs' but I prefer moving baby steps as this is all new to me).</p>
<p>The main part in the electronic components is the microcontroller, in my case I will use a ESP32 Wroom.</p>
<spanclass="image object">
<imgsrc="../images/esp32wroom.jpg"alt="...">
</span>
<p>Why ?</p>
<p>Because I'm already thinking ahead and willing to trigger the lid opening/closing with a RFID chip and also allow the huma slave to get information on a smartphone app (in addition to the LED lights).</p>
<p>The ESP32 has X pins, including :</p>
<ul>
<li>3x GND</li>
<li>1x 5V</li>
<li>1x 3.3V</li>
<li></li>
</ul>
<spanclass="image object">
<imgsrc="../images/esp32wroomPARAM.jpg"alt="...">
</span>
<p>To hold the ESP32 in place and get enough space under it for the wires that will be attached to it I added a PLA 3D printed bracket (file was found on Thingiverse, thanks to...).</p>
<p>The servo motor has 3 pins to attach to the microcontroller. Therefor I've cut a small hole in both the cat head tower front plate and the back plate of the bowl compartment.</p>
<spanclass="image object">
<imgsrc="../images/holes-for-wires.jpg"alt="...">
</span>
<h3>Force resistor</h3>
<p>Final component to add to the feeder is the Thin Flexible Force Sensitive Resistor that can measure weights going from 20g to 2kg.</p>
<p>My project is an automatic cat food dispenser. The cat's food bowl is placed in a compartment protected by a lid. This compartment is attached via a power cable to a tower in the shape of a cat's head, which contains most of the electronics needed to operate the dispenser.</p>
<spanclass="image object">
<imgsrc="../images/current-model.jpg"alt="...">
</span>
<h3>How it works</h3>
<ol>
<li>Quantity of food available :
<ul>
<li>When the bowl of food is filled, the weight recorded by a force sensor underneath the bowl is sent to the microcontroller, which translates this weight into a green light signal that appears, via LEDs, in the tower's ears.</li>
<li>If the weight of food in the bowl reaches half the maximum possible weight, the light will turn yellow.</li>
<li>If the weight of food in the bowl reaches a third of the maximum possible weight, the light turns red.</li>
<li>If the weight of food in the bowl reaches 10% of the maximum possible weight, the light remains red and will start to flash.</li>
</ul>
</li>
<li>Opening of food bowl compartment :
<ul>
<li>The lid of the compartment housing the food bowl opens when the animal or human slave comes within 20cm of the dispenser, thanks to a distance sensor installed in the upper part of the tower (and therefor representing the tower cat's eyes) and a servo motor concealed beneath the lid.</li>
<li>When the animal or human slave moves away from the dispenser, the lid closes again after a 1-minute delay.</li>
<p>The basic shapes for the tower and food compartment prototypes were created from existing templates on a <strong>laser-cut</strong> box generator website, <strong><ahref="https://boxes.hackerspace-bamberg.de/"target="_blank">Festi</a></strong>. I modified these boxes according to the sizes and specifications I needed for my project by using <strong><ahref="https://inkscape.org/"target="_blank">Inkscape</a></strong> and the laser cutter program, <strong>Gravostyle</strong>.</p>
<p>I also used <strong><ahref="https://www.tinkercad.com"target="_blank">Tinkercad</a></strong> to design the <strong>3D prints</strong> of the ears at the top of the tower, in which the LEDs will be housed.</p>
<spanclass="image object">
<imgsrc="../images/ears-3d-design.jpg"alt="...">
</span>
<p>Many of the parts holding the <strong>electronic components</strong> were 3D printed from opensource files found on websites like <strong><ahref="https://www.thingiverse.com/"target="_blank">Thingiverse</a></strong>.</p>
<spanclass="image object">
<imgsrc="../images/brackets-design.jpg"alt="...">
</span>
<h3>Challenges in the building</h3>
<ul>
<li>Fitting the pieces together</li>
<li>Measuring food weight in bowl (without the bowl's own weight)</li>
<li>Force required to lift the bowl lid</li>
<li>Movement of the lid regarding the distance (with or without waiting time)</li>
<li>Ergonomic arrangement of parts</li>
<li>Hide electronic components</li>
</ul>
<h3>Points of positive evaluation of the project</h3>