This is one way to layout the breadboard, if you spin the Espino 180 degrees you can layout the board with no crossed wires. The size of the case, the fact I used the Arducam Uno and the length and stiffness of the micro usb cable I had kind of dictated this layout.
I used micro USB cables to connect the 5V from the convertor to the boards, so only the black (GND) and red (+5V) are used and I just cut the green and white wires back.
The pump runs at 12v and when under load (pumping water) and it draws 3A.
Looking at the TIP120 data sheet the max collector current (Ic) is 5 amps and the max collector-emitter voltage is 60v. So far so good.
Looking at figure 2 on the datasheet the base current (Ib) is given by Ic=250* Ib or Ib=Ic/250 so a collector current of 3.0 amps requires Ib=3.0/250 which equals 0.012A. From the ESPino-Datasheet-EN-2 the max current per I/O pin is about 12mA.
You could add a small resistor to make sure the Espino doens't try to output more than the 12mA, so looking at figure 2 we can see that when the collector current is 3A then Vbe(sat) is 1.8V. So when the Espino is high at ~3.3V the resistor should have a voltage drop of 3.3-1.8 = 1.5V accross it;
So you could add a 100 or 150 ohm resistor if you like.
If you would like to access the Super Squirter from the internet or WAN side of your router, either using the iPhone App or otherwise take control of it (you could write a Python script or otherwise construct the URL's to mimic the App) you will need to do configure your router.
Typically Internet Service Providers (ISP's) have a pool of public IP addresses that are cycled through so you could find that your public IP changes every couple of days. If you are willing to lookup your public IP and update it in the App then you don't have to worry about a DDNS or Static IP. But if you just want to set and forget you can setup of DDNS service or a static public IP.
Then internally it needs to be set up so that any traffic from the internet is routed to the correct device, that is, assign static internal/private IP's to both the Arducam Uno and Espino (the LAN part) and direct traffic on the assigned ports to the assigned IP's (the NAT part).
For example in your router you set the IP address of the Arducam Uno to 192.168.1.21 and then in the .ino file you set the webserver on port 82 (ESP8266WebServer server(82)), you then setup NAT to forward any traffic on port 82 to 192.168.1.21.
1. I have used https://www.dynu.com and they are great for a free DDNS service. Or contact your ISP and request a static public IP, they normally charge for that. If you just want to set it up to work with the PIR Motion Detector and have it save images to the SD Card when activated then skip this step.
2. Get the MAC address from both the Espino and Arducam Uno. You can set the SSID and Password in the .ino's, let them connect and then through your routers advanced settings pages you can find the MACs
3. Configure your router to assign static IP's to the Espino and Arducam Uno, use the MAC addresses to create Static IP entries in the LAN setup page.
4. Configure your router to NAT port forward to your Arducam Uno and Espino so they can be accessed from the internet using your router's ISP assigned public IP address. The Arducam Uno and Espino connected to your private network will have internal IP addresses that are not visible from the internet. As above, the Arducam Uno is listening on port 82 and the Espino on port 81 (see this line in the respective ino files - ESP8266WebServer server(##). On the NAT setup page create entries so that traffic on the assigned ports is routed to the correct static IP's
If you only want to run it using the motion detector or just use the App when your phone is connected to your home network then just skip the DDNS / Static Public IP steps above.
1. I used an ESPino because it is available locally and is ready to plug into a breadboard and comes with a micro USB (comms and power). You could just buy the ESP8266 module but you would have to mount it on a breakout board and use an FTDI for comms and power or use another equivalent.
2. I used the ESP8266 ESP-12F UNO Board for ArduCAM Mini Camera and the Arducam Mini module Camera Shield w/ 2 MP OV2640 because I had them but if you need to buy one I would go for the Arducam 2MP V2 Mini Camera Shield with ESP8266 Nano instead, it's way smaller and you don't have to mount the Uno board or worry about the extra wires. It also fits in the pan tilt arm, just a lot neater.
The major components came from UCTronics and Thai Easy Elec
Other bits and pieces
- M3 PCB Standoffs
- Clear Acrylic Case
- Two 6v 7Ah SLA Batteries
- TIP120 NPN
- Water Bottle
- Assortment of jumpers and wires etc
- Diode 1N4001
- 12v to 5v DC-DC Convertor
- 12v Windscreen Washer Pump
- Vacuum relief valve if your nozzle sits lower than the water level
- Two Micro USB Cables (power form convertor to boards)
5Notes and References
The .htm file for the Arducam Uno SD Card is from here
I made a vacuum relief valve to prevent siphoning through the pump when it's not running or alternatively place the nozzle above the water bottle. Here is a link to a video which demonstrates how to make a vacuum relief valve, no English but easy enough to follow.