Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Hacking my new SafePet Rotating Litter Box for Cats

Hacking my new SafePet Rotating Litter Box for Cats 5 months 4 weeks ago #18122

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
I am going through a refit of my lab and workshop and reorganizing all my embedded gear and test equipment. Hopefully this will not take too long and I will be back at this project in a week or so.

SOME DEVELOPMENTS
I am looking at other options for communicating with the project through my wireless LAN. Telnet was proving to be troublesome and I am finding that using websockets is proving to be a more viable option. Communication between the subsystems is still working fantastic. So at this stage of the game, I am not going to continue to re-invent the wheel by changing my UART strategy to SPI or I2C. Either one is my ultimate goal, but that continues to be a goal for a revision down the road.

THANKS!

Hacking my new SafePet Rotating Litter Box for Cats 5 months 2 weeks ago #18124

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
Small Change...

I decided that instead of using a non-evasive mod for my self cleaning litter box, I will go invasive and tap into one of the two disconnect switches with either a relay or transistor. There are two switches that when either is left open, the device's power supply is shut off. One is a hall effect switch activated by a magnet in the bottom of the catch tray, and the other is a SPST lever switch in a hole the cover pushes a peg into. Disconnecting either circuit using logic seems to be a safer way to turn the device on and off with the embedded controller.

It's not that the AC SSR would not have worked for me, it does actually. The problem I had however is a small amount of current leakage, and a small amount of heat from the SSR, not to mention difficultly finding a suitable case. If one of the motors jams, the current goes up and the SSR gets hotter. I just felt safer using this latest approach with the disconnect switches.

Another mod I would LOVE to do is to replace the AC motors with reversible DC geared motors. This would help to un-jam the device if a jam is detected by the increase in current draw. Also, it would be cool to see this thing work while sped up a bit, maybe 2x or 3x speed. :) The problem is finding motors that will fit the assemblies. I'm not very good at finding motors so this will prove to be a somewhat of a robotics challenge. The motors are somewhat flat, so I have no idea if I will even find the right sized DC geared motors for this idea. I really do not want to have to reinvent the drive design.


Last Edit: 5 months 2 weeks ago by hop. Reason: Images

Hacking my new SafePet Rotating Litter Box for Cats 5 months 2 weeks ago #18125

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
LOL, sorry but just going after writing about this sparked laughter inside me! :cheer:

The so-called controller board in my cat box is nothing more than routing 25 vac power to the motors through cut-off switches. The magnetic sensor is what looks like a reed relay. So I decide to go BACK to using my AC SSR to control the system. Except now I am controlling the flow from the switches instead of to the PSU adapter to start with.

And I cut the wrong wires. Yeah, in a hurry and cut the connector to the conveyor motor instead of the upper switch fail safe. No worries, I patched it up and now installing the SSR. I hope to have this controlled from a webserver running on an ESP8266 in about an hour.

Hacking my new SafePet Rotating Litter Box for Cats 5 months 1 week ago #18126

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
ALWAYS SOMETHING!

I built the controller without motion sensing (for now) and programmed it to use my phone to turn on and off the cat box but it did not work. Go figure? Anyway, the indicator light on the SSR comes on as it should, but it did not switch on the 25vac. It is a common problem that I had not known about until now. A 2n2222 npn transistor should fix this though. Building that on the prototype board and will then test. More in a few.

Hacking my new SafePet Rotating Litter Box for Cats 5 months 1 week ago #18127

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
More in a few.
OK, it's more like "More in 'quite a' few" I should have said.

The last few days of research and testing provided a WEALTH of information and success!! I now have the controller set up using a websockets server and OTA, and discovered something neat about the PIR module I will be adding soon. Shortly? Hmmm... maybe more than "in a few" but not quite "quite a few", moments that is.

First of all, I couldn't find any 2n2222 NPN transistors laying around. Go figure! I know I have a bag of 1000 or more of those around somewhere. What I DID find were 2N3904 NPN transistors and they are almost identical to the 2n2222 except for the current they can sink. The 2n3904 at 200ma though was way more than enough to trigger the SSR. Once used to sink 5vdc to the SSR, it turns on just fine with a signal from a GPIO pin on the wemos D1 mini!

The triggering of the GPIO line, in my case it was "D7" or GPIO number 13 active low, is handled by a round-about process using websockets on the module. The web page has a simple button that once clicked, it runs a javascript function that in turn sends a payload to the wemos. The page also has a link to an edit page that allows me to upload the served web page files to spiffs. I hadn't mentioned it so far as I know, but I was never able to upload to the spiffs using the OTA system. Only the firmware will work right now. This is no issue however because I can do the firmware from the IDE and the web page data and other files using the existing web files being served. OBVIOUSLY there will be tons of revisions and improved functionality, but the beginning shell of a process I have in place is a grand way to start!

Again, and I know I keep saying this, which makes this a long read :unsure:, I will document EVERYTHING with a guide here as soon as the core project is completed.

And I am getting so close!! FINALLY!

This whole system is going to prove AWESOME for all my other IoT projects!! I can't WAIT to add this resource to those projects!

NOTE: I am just bit-banging the code using notepad++, to write the HTML, JS, and CSS files. After this project is done, I will explore using PlatformIO on VSCODE to write for these three languages. Firmware: C++, Web: HTML CSS JS. I haven't quite worked out the upload issues of all three file languages from inside that incredible IDE. And another thing I cannot WAIT to explore is serial debugging using the websocket transport for a completely wireless solution for my deployed systems. B)
Last Edit: 5 months 1 week ago by hop. Reason: clarifying

Hacking my new SafePet Rotating Litter Box for Cats 4 months 4 weeks ago #18130

  • hop
  • hop's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 526
  • Thanks received: 46
It's working!!! YAY!
There is so much to share to this point but it's late today so I'll post it tomorrow.

Summary...
Using websockets server on the Wemos D1 Mini ESP8266, I have OTA, ability to upload the web pages, and can control the cat box using a button. I added a timer so it auto shuts off after 70 minutes and it's pretty accurate, down to the second. I also included feedback from the board back through javascripting to the served web page to show a count down of time. It's simple, but it works!

So much more to do, but it works! YAY!

More tomorrow. :)
Time to create page: 0.242 seconds