Post about your Basic project here

Moderator: Mmiscool

User avatar
By ardhuru
#56906 Its completely homebrew, including the pcb, etched home.

The power supply is a cheap apple charger clone that claims 1 amp at 5 volts.

"And the gpio pin usage wasn't what I expected, so what ESP are you using?"

Its an ESP8266 01, the 1 MB version. I think I know what you mean; I'd have preferred to put the switch on either the Tx or Rx lines, but as I mentioned in another thread, interrupts didn't work reliably on these (I tried lowering the value of the pull ups, btw). Again, polling seems to work fine even on the TX and Rx, suggesting there's nothing wrong with the hardware.

So, I was forced to put it on the standard gpio. And you're right; the price to be paid is the first time you switch it on, you have to ensure the door is open, or else the code will not execute.

Perhaps migrating to an ESP with more IOs would have been smarter, but I already had the PCB made.

Another aspect that doesn't show in the picture; there's a small 8 pin pic under the ESP; this is nothing more than a simple delay line. When you switch on the ESP, *before* any code takes control of the io lines, they all pulse high for abou 300 ms or so. So, every time the power is interrupted, the relay would operate without this hardware delay. The pic simply keeps the relay off fo a second after switch on, and then follows whatever state its input (the ESP's output) is at.

Have you tried installing the apk? I'm curious as to how the gui scales to different screens.
User avatar
By Electroguard
#56909 Good on you mate for doing everything yourself from start to finish - that's true commitment and achievement.

Have you tried installing the apk? I'm curious as to how the gui scales to different screens.

If the apk is your basic4Android app, I don't see a link for it, else I'd give it a shufty.

Yeah, the ESP-01 explains the gpio usage.
It's done and dusted, so unless you have problems there's no point messing with it - but here's something to bear in mind...
I modified a mains SmartSocket by removing the existing wifi board and replacing it with an ESP on a bit of veroboard. I used an ESP-01 for the first incarnation because of it's 0.1" pin pitch, but cutting the tracks between the close-spaced rows of pins was a pain.
But then I progressed to wanting to make use of the SmartSockets USB charging socket for attaching external sensors (by using the data + and - pins for i2c), so I did a second version which used an ESP-12E, offering 4Mb and more than enough gpio's.
The silly thing was, it wasn't that difficult connecting it's 2mm pitch holes to the 0.1" veroboard cos I wired it like spiders legs using the different coloured wires from a bit of scrap UTP cable... they soldered to the ESP holes without problem despite my poor eyesight, and offered sufficient spring support to let the ESP be self-supporting, although I did fix it to the board with a bit of double-sided tape.

The point is, it's not too late to add a more capable ESP with spiders legs to your existing pcb if it could be beneficial, so I thought it worth mentioning (cos it could earn you 'Hacker' status to go along with your well-earned 'Maker' status!)
User avatar
By ardhuru
#56940 Oops, I *had* attached the apk file, I did not realize the forum server would strip it.

I can mail it to anyone who's interested. Or is there a way to attach it on the forum itself?
Are zips allowed?

I agree, from now on its only the 12E for me. Far easier and more freedom to allocate the IOs. But for this project, I'll stay with the 01. Its a tight fit in the cabinet, wouldnt want to fool around with the pcb.

And thanks for bequeathing the 'Maker' status!
User avatar
By ardhuru
#56972 My earlier attachment of the Android apk was not allowed by the forum server. Trying to attach it as a rar file.

Just unrar it using zip/rar, and then install the apk on your Android device.

Hope this goes thru'..
You do not have the required permissions to view the files attached to this post.