ESP8266 Wifi Module for $5

Topics regarding the Uzebox hardware/AVCore/BaseBoard (i.e: PCB, resistors, connectors, part list, schematics, hardware issues, etc.) should go here.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: ESP8266 Wifi Module for $5

Post by uze6666 »

I'm in the process of replying with a long post. In the mean time, I did some modeling to try another approach for the uzenet module pcb. What about...a daughter board? Was hell to place all those through hole components, but it neatly fits in the new enclosure. So all those with the Uzebox PCB could just plug it in and ready to go! :)

Image
Image

I used a low profile female header to have it fit under the Reset button. We'll need another regulator for 3.3V since the module consumes to 350ma according to certain sources. The current 3.3v on the main PCB is only 250ma and most power is reserved for the SD card. That's the reason why I didn't put it on the EXT pins. There's also 3 voltage dividers for level shifting and a 6pin ISP header.

I'm starting to think about SMT...
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: ESP8266 Wifi Module for $5

Post by D3thAdd3r »

uze6666 wrote:What about...a daughter board?
That's a clever and space efficient design there and it should work 100%. The nice thing about that is anyone who built an Uzebox could easily build that too. I would just hope that somehow everyone who bought an Uzebox would also elect to buy that or there was a bundle or something so that it was widely adopted. If it was easy to get it should be popular.
uze6666 wrote:I'm starting to think about SMT...
I don't know how cost prohibitive it would be to have them pre-built but I think that same board using SMT would be even better in some ways. Not having an extra DIP28 would look a lot less prominent versus the rest of the Uzebox. I consider the wifi idea as a totally separate dimension from the rest of the Uzebox and I like the idea of it being small. The hobby moving forward is going to require SMT soldering in the near future anyways so might as well get comfortable with it. It's a nice board as is, so whatever works is perfect. Throwing an XMega on there doesn't seem any less "pure" to me. I'll wait for your long post to hear what you think about specs/pins/etc

PS. this code looks promising I'm going to check it out. Even if the 8266 can be a usable SPI slave I still think we need the extra processor to handle details.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: ESP8266 Wifi Module for $5

Post by uze6666 »

Ok, that was supposed to be a long post, it's been sitting here for a couple days. I'll post it before it becomes irrelevant!

I can't seem to find the maximum speed for the 8266 UART, but the default 115200 baud would yield a maximum throughput of about 13KB or 213 bytes per frame. So that means that a helper MCU clocked at 20Mhz has about 20Mhz/13K=1.5K cycles to process a UART transfer. So perhaps the nominal speed is enough. We could overclock it, but I can't see a benefit of keeping it a NTSC multiple since its going to communicate though its hardware SPI interface and the Uzebox is the master. Instead, we should pick a crystal that minimize the UART deviation to target rate (i.e: a multiple of 1.8432 MHz, see section 17.11 of Atmega644 datasheet). Digikey has 22.1184Mhz, that should work fine with all 20Mhz AVRs.

As for the device itself, as you pointed out, ATtiny have a pitiful 512 bytes of ram. They would seem more elegant to me since they are small and limited, but there's already enough challenge on the Uzebox! That leaves us with some megas. I've been through them last week and the best one seems to be the ATMEGA328-AU-ND. It's a 28pin device. I had tough of using the TQFP package but the pin spacing is even smaller than the AD725. So I guess we'll stick with the DIP if we want it hobbyist friendly.

So next is a Uzenet PCB to hold the '328 and the 8266 module. The daughter board presented before seems a good solution to start. I'll add a footprint for the EUzebox expansion header. I think it's also possible to use the board with a ribbon cable using a low profile "permanent" header like those: http://www.digikey.ca/product-search/en ... =search_go

Another thing to think of: how will be upgrade the firmware on the esp8266? From what I have read you must upgrade the current version via the uart interrface to a version that supports cloud update. Hopefully, after that it can be done via wireless. But what triggers the update, have you some info on that?
Great, now we have an official pinout that will work for most people without any PCB hacking.
I suspect Euzebox owners with their metal enclosure could have a hard time connecting! I see they make several breakout and one have a uFl antenna connector. They'll need to use this one for sure.

Btw, I have ordered 3 modules versions of the esp8266: the one you have, one with a ceramic antenna and one with a external antenna. However I think the latter two can't have the firmware upgraded.
I don't know how cost prohibitive it would be to have them pre-built but I think that same board using SMT would be even better in some ways. Not having an extra DIP28 would look a lot less prominent versus the rest of the Uzebox. I consider the wifi idea as a totally separate dimension from the rest of the Uzebox and I like the idea of it being small. The hobby moving forward is going to require SMT soldering in the near future anyways so might as well get comfortable with it. It's a nice board as is, so whatever works is perfect. Throwing an XMega on there doesn't seem any less "pure" to me. I'll wait for your long post to hear what you think about specs/pins/etc
I tend to side with you on this one. I'll like it small. Ultimately, I would have preferred no external MCU since it's a hassle to develop (switch the ISP cable all the time) and increases cost, maintenance and complexity, pcb needs an ISP header, etc. That mega328 is still pretty big and looks a bit ridiculous. Surface mount cost will be lower. It's the assembly that sucks. I'm not equipped to solder smt pcbs since I don't have a reflow oven. I would wish someone would sell a small reflow oven for hobbyist with temp curve and all. Just something for a 6"x4" board or something like that. Anyway, I'll see how it looks with a TQFP package for the helper mcu and SMT for the regulator.
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: ESP8266 Wifi Module for $5

Post by D3thAdd3r »

I've been overly busy lately and my memory is getting fuzzy as usual. I will have to track some of this info back down and also fiddle around with the gcc chain which I haven't had time for. This is all very doable but definitely a serious learning curve.
uze6666 wrote:I can't seem to find the maximum speed for the 8266 UART, but the default 115200 baud would yield a maximum throughput of about 13KB or 213 bytes per frame.
Everyone and their uncle is making different versions of the firmware with different features, adjustable UART at run time, etc. From what I see, firmware can do it pretty much arbitrarily:

Code: Select all

uart_div_modify(uart_no, UART_CLK_FREQ / (Your_baut_rate));
If I recall there was at least one that let you use >4mbs but I have not verified it. I1520 should work fine, but it would be very nice to have 230400(I know this is supported in newer firmwares) where we still have 700 cycles to work with between bytes. One interesting idea would be to use a very fast rate until the Uzebox tries to talk to it then slow down to a rate it can maintain during that transaction. There is definitely a bunch of research, experimentation, and work to be done but we will get it. SPI slave mode example is here. The code looks legit.

uze6666 wrote:Another thing to think of: how will be upgrade the firmware on the esp8266? From what I have read you must upgrade the current version via the uart interrface to a version that supports cloud update. Hopefully, after that it can be done via wireless. But what triggers the update, have you some info on that?
Yes, you wire it up as normal but do a reset and hold GPIO0 LOW so it enters firmware upgrade mode. Then there are a couple ways to upgrade it ie: like this. Unfortunately I have not noticed a firmware that can yet upgrade itself via wifi. Things are changing and developing so fast right now it's hard to keep up what's current so I would think that is possible and will come. Failing that, like I was saying just having the RST and GPIO0 pins connected to a pin on the ATmega would always allow us some way to upgrade the firmware(which is much bigger than 64k), even if it was something nasty like SD->644->328 ram->8266
uze6666 wrote:However I think the latter two can't have the firmware upgraded.
GPIO0 isn't broken out on some versions it seems. It wouldn't be impossible to solder a small jumper to it with clamps and a magnifying glass, but that is a lot finer work than I have ever attempted. I have read the versions without GPIO0 broken out are also the earliest and buggiest versions but if firmware update via wifi is possible at least you would only have to mess with that once. There are newer versions around too like this one. I have not given up on using the onboard MCU for a one time kludge firmware bent to our will, but I say full speed ahead as your current plans seem to be working out. Having the 328 should be compatible with more devices and more future proof, since even if a custom firmware was written for Uzebox it's even less likely it would ever get updated. I will be more helpful on this once the holidays go away :lol:
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: ESP8266 Wifi Module for $5

Post by uze6666 »

Well, look what i found:
http://www.olimex.com/Products/Modules/ ... e-hardware
Image

An esp8266 module that exposes all gpio pins including the spi! Plus it has holes for breadboard testing and is castelated for direct pcb soldering. And still very inexpensive. I'm ordering a couple of those. With those, programming the onboard mcu as you proposed would make much more sense as we could get away with the helper mcu altogheter and reduce complexity. We should implement any custom protocol in there too. In the future, if the 8266 dissapears, we can always add a helper mcu later. :)
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: ESP8266 Wifi Module for $5

Post by D3thAdd3r »

Wow great find, that one is the way to go. I just ordered a few of those now too, but I am curious to see if the firmware they come with supports SPI slave. I saw a lot of talk about the SPI as master to its serial flash, and being able to control an SD card, but most SPI talk is referring to master only from what I see. Only matters because it would be very convenient if someone could just order and wireup without needing to figure out the firmware process. Without the helper MCU, the PCB will probably be <$5, and hopefully a whole kit <$20 total parts
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: ESP8266 Wifi Module for $5

Post by uze6666 »

Yet another one, which accepts 5v and seems to break out the spi i/o pins.
https://www.tindie.com/products/BBTech/ ... fi-module/

Image
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: ESP8266 Wifi Module for $5

Post by D3thAdd3r »

Any of them will do it if we put the work into it, that previous one you mentioned I like a lot better though even at 3.3. It has all those GPIO pins broken out. I wouldnt underestimate the power of 16 network controlled i/o pins for future fun factor.

Edit- Do you think the PCB should pass through unused pins, but still having a trace to them that could be enabled with solder pads or are you thinking of something totally different now?
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: ESP8266 Wifi Module for $5

Post by D3thAdd3r »

Got the new chips and they are a little bigger than I had thought. Quite a bit wider and taller than the other version but also much shorter/flatter so it could stack anywhere. With such a big footprint to connect to a daughterboard I have a feeling this thing would have to go under the PCB in a case.
ESPNEW0.jpg
ESPNEW0.jpg (102.25 KiB) Viewed 8016 times
ESPNEW1.jpg
ESPNEW1.jpg (69.8 KiB) Viewed 8021 times
ESPNEW2.jpg
ESPNEW2.jpg (345.23 KiB) Viewed 8019 times
ESPNEW3.jpg
ESPNEW3.jpg (60.17 KiB) Viewed 8018 times
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: ESP8266 Wifi Module for $5

Post by D3thAdd3r »

So the new version can be ran in SDIO mode just by changing solder pad jumpers. Since emulating SPI seemed the way to go, I wonder if it's not too far a stretch to just emulate SDIO instead since there is a chip you can just order and it's ready to go with it. I have no idea if emulated SDIO could be 4 times faster than emulated SPI when it's all done, but I think it should be faster at least. Any thoughts?
Post Reply