EzSBChttps://news.ezsbc.com
EzSBC Electronic Products and DiscussionThu, 23 Mar 2017 23:09:46 +0000en-US
hourly
1 https://wordpress.org/?v=5.2.3ESP32 Analog Input – analogReadhttps://news.ezsbc.com/esp32-analog-input-analogread/
https://news.ezsbc.com/esp32-analog-input-analogread/#commentsThu, 23 Mar 2017 20:39:47 +0000http://news.ezsbc.com/?p=248AnalogRead does indeed work on the ESP32. Many sites and posts that claim that the Analog to Digital converter of the ESP32 doesn’t work. I have tested analogRead using the code below and it works as expected. The code below compiles and downloads to my ESP32 Development board and produces correct results. The input pin is […]

]]>AnalogRead does indeed work on the ESP32. Many sites and posts that claim that the Analog to Digital converter of the ESP32 doesn’t work. I have tested analogRead using the code below and it works as expected. The code below compiles and downloads to my ESP32 Development board and produces correct results. The input pin is the seventh pin from the top on the left hand side of the ESP32 Development Board.

]]>https://news.ezsbc.com/esp32-analog-input-analogread/feed/2ESP32 Board Selection in Arduinohttps://news.ezsbc.com/esp32-board-selection-arduino/
Wed, 22 Mar 2017 01:08:40 +0000http://news.ezsbc.com/?p=239I receive many questions in a week on the correct setup of the Arduino Environment to program the ESP32 development board. At this point it doesn’t seem to matter which board you select and I always use “Esp32 Dev Module” as my selection. The rest of the setting can be seen in the screen […]

]]>I receive many questions in a week on the correct setup of the Arduino Environment to program the ESP32 development board. At this point it doesn’t seem to matter which board you select and I always use “Esp32 Dev Module” as my selection. The rest of the setting can be seen in the screen capture below.

ESP32 Arduino Setup

The upload speed is fast and it works just like an Arduino board. Press the upload button and the code magically appears in the module memory. No buttons to press, just works.

]]>ESP32 Development Board-Again Part 2https://news.ezsbc.com/esp32-development-board-part-2/
Wed, 22 Mar 2017 01:08:00 +0000http://news.ezsbc.com/?p=242If you compare the first revision of the ESP32 Development board to the current version you will see that the ESP32 module doesn’t extend past the edge of the printed circuit board as it did before. I extended the PCB and had the area under the antenna routed out. This serves two purposes. The ESP32 […]

]]>If you compare the first revision of the ESP32 Development board to the current version you will see that the ESP32 module doesn’t extend past the edge of the printed circuit board as it did before. I extended the PCB and had the area under the antenna routed out. This serves two purposes. The ESP32 module is designed to have the antenna sit out in free space. The antenna is not supposed to sit on top of the PCB, the design guide by Espressif makes that very clear. The measurements that they did and documented show clearly that there is a significant loss in performance when the antenna sits on top of the PCB. The module’s PCB is much thinner than the standard 1.6mm PCB and they obviously designed the antenna for the thin pcb. User reviews of some of the other ESP32 boards on the market confirm that the ones where the module sits completely on top of the PCB have poor RF performance.

The second purpose of having the PCB extend all the way to the top of the module’s PCB is to allow me to manufacture the boards in a panel. If the module extends past the PCB then you can only place them next to each other in the panel. This leads to a long and narrow panel which bends in the reflow oven preventing the modules from sitting flush with the PCB. I ended up breaking the panels in half to get a less flexible panel. An additional benefit is that the thicker PCB protect the module’s PCB during shipping.

]]>ESP32 Development Board-Againhttps://news.ezsbc.com/esp32-development-board-2/
Sat, 18 Mar 2017 22:03:10 +0000http://news.ezsbc.com/?p=232Here is the current version of the$16.95 ESP32 development board using an ESP-WROOM-32 module directly from Espressif. My optimism about the availability of the ESP32S modules from AI-Thinker was misplaced. I believe they are finally shipping now but since I haven’t seen any with my own eyes I remain unconvinced. In the meantime, I […]

]]>Here is the current version of the$16.95 ESP32 development board using an ESP-WROOM-32 module directly from Espressif. My optimism about the availability of the ESP32S modules from AI-Thinker was misplaced. I believe they are finally shipping now but since I haven’t seen any with my own eyes I remain unconvinced. In the meantime, I switched to a module that is actually available in production quantities.

Top View of New PCB

The ESP32 board has a Espressif WROOM-32 module installed with the pinout marked on the PCB albeit in very small letters. The PCB is routed out under the antenna for the best RF performance. The WROOM-32 module is certified worldwide by the relevant authorities and has an FCC Id number.

]]>ESP32 Development Boardhttps://news.ezsbc.com/esp32-development-board/
Sat, 07 Jan 2017 23:29:33 +0000http://news.ezsbc.com/?p=208It seems that most ESP32 breakout boards are vaporware or futureware. I have been buying ESP8266 modules for some time and recently ordered ESP32S modules directly from AI-Thinker. They started signing their email with “Notes:ESP-32 begin to sale!” and I assumed that it means that I can buy as many as I need. I asked for […]

]]>It seems that most ESP32 breakout boards are vaporware or futureware. I have been buying ESP8266 modules for some time and recently ordered ESP32S modules directly from AI-Thinker. They started signing their email with “Notes:ESP-32 begin to sale!” and I assumed that it means that I can buy as many as I need.

I asked for a price for a few hundred modules, was quoted a price and when I placed an order I was told that they will ship me one module for development. After some back and forward one became two and it was duely shipped with some ESP8266-07 modules that I use for some custom products and my breakout board. http://www.ezsbc.com/index.php/featured-products-list-home-page/wifi01.html A few weeks later I received an email saying that the ESP32S was now in stock and I ordered a few hundred with some ESP8266 modules. That was about two months ago and I’m still waiting.

On Friday, 6 Jan 2017 I finally got a tracking number for my modules.

Here is my brand new ESP32 development board. Other than the ESP32 module it has an FTDI FT231XS USB to Serial converter, A 3.3V LDO, Reset and Flash Switches and a multi color LED.

There are two tri-color LEDs on the board. One has the red and green LEDs hooked up to the FT231 to signal transmit and receive activity and the other is connected to three IO pins on the ESP32S module.

The board supports auto-download from the Arduino environment and will automatically be set in download mode by the downloader. Once the download is complete the board will be reset, just like a normal Arduino board.

All the required capacitors and pull-up resistors are fitted on the board. The board can be powered from an external power supply of up to 12V or the USB connector or both.

Unlike most other boards this one fits on a breadboard and has one row of pins accessible on each side of the board.

The schematic will be available once the board is listed for sale. If you are interested in the board drop me a line at sales @ ezsbc.com

The board is expected to be available in volume by Jan 15, 2017 for $19.95 per board.

Edit: You can buy the boards here for $16.95. The board uses the ESP-WROOM-32 module instead of the AI-Thinker ESP32S module due to continuing supply problems with the AI-Thinker module.

]]>OpenWrt Atheros AR9331 Development Board Connectorshttps://news.ezsbc.com/openwrt-atheros-ar9331-development-board-connectors/
Mon, 22 Jun 2015 23:53:21 +0000http://news.ezsbc.com/?p=191I recently described a board for hacking on OpenWrt and that also has connectors for adding USB peripherals and custom made PCBs. The AR9331 board is described in the post immediately preceding this one. Here I will describe the connectors in more detail. The board has the following connectors: Power Input Two RJ45 Ethernet Ports […]

]]>I recently described a board for hacking on OpenWrt and that also has connectors for adding USB peripherals and custom made PCBs. The AR9331 board is described in the post immediately preceding this one. Here I will describe the connectors in more detail.

The board has the following connectors:

Power Input

Two RJ45 Ethernet Ports

2 Type A USB ports

Mini-USB Port

WiFi Antenna Port

The Expansion Connector

The Power Input is used for powering the board and the peripherals attached to the board including the USB Type A ports. The board has a switch mode regulator to convert the input voltage to 5V at high efficiency. A standard barrel socket is used with the center pin connected to positive and the outer sleave being ground. The ideal input voltage is 12V since the efficiency is very high at 12V input but any voltage from 7V to 17V will work. The 7V lower limit is dictated by the maximum duty cycle of the switching regulator. The switching regulator is rated for 20V continuous but I prefer to not use input voltages higher than 17V to prevent spikes from killing the regulator. The input voltage will spike if the power is unplugged while the board is drawing significant current. There is a 1A PolyFuse is series with the input voltage to protect the PCB from damage if there is a short circuit somewhere on the board or USB plugs.

The RJ45 ports have integrated magnetics and the tabs for the cable connector point downwards. Ordinary Cat5 and Cat5E cables can be used.

The two USB ports can both act as USB Host ports since there is a USB Hub on the board. These USB ports can power external hard drives and other devices that draw significant current from the 5V supply. The 5V in the USB is current limited at about 3A for both ports combined. The power is available even if the device has not been enumerated. Since these boards are aimed at being embedded inside other products the 5V from the USB can power external 5V devices including battery chargers. We have tested several USB hard drives, flash drives and some other peripherals on the USB ports. One of the devices known to work is a USB to Serial adapter based on an FTDI chip. Similar boards normally can’t drive USB to Serial or USB to Parallel converters due to the compatibility issues of the AR9331 chipset with USB 1.1 devices.

The Mini-USB port has a FT231SX USB to serial adapter between it and the AR9331’s integrated UART. This serial port is used by the Linux kernel as an error reporting channel. You can log in using the root password and change setup of the WiFi and firewall tables. Also, if all else fails, you can upload new firmware through this port. Normally the firmware would be uploaded via the Ethernet or WiFi ports. A change in the build settings for OpenWrt can make this serial port available for general use.

The WiFi port is a 50 Ohm 2.4GHz port for transmitting and receiving the WiFi signals. The connector is a standard IPAX u.FL connector and you can connect any 50 Ohm antenna to the module. These connectors are not designed for many mating cycles and a typical spec is 10 cycles. The boards will be supplied with an antenna that is printed on a PCB but any standard 2.4GHz antenna will work.

The Expansion Connector is a 20-pin 0.1″ header connector and is not fitted on the modules. The connector has a a number of signals that connect directly to the AR9331 SOC and they should be treated with care. The AR9331 is a 2.5V device and its pins are NOT 3.3V or 5V tolerant.

1

GPIO15

GPIO18

2

3

GPIO16

GPIO19

4

5

Vin

GPIO20

6

7

Gnd

GPIO21

8

9

RXftdi

GPIO22

10

11

TXftdi

GPIO23

12

13

2.5V

GPIO24

14

15

3.3V

GPIO26

16

17

5V

GPIO27

18

19

Gnd

GPIO28

20

Some of the pins have special functions assigned to them with hardware support for those functions and I will cover them later. The 2.5V pin is provided more as a reference than a power supply pin. You should not draw current from it. The 3.3V pin can suply some current and I will qualify it in more detail in the future. It is limited by the fact that there is no heatsink on the 3.3V LDO except for some copper areas attached to the device. It this point I think 50mA should be available with a possibility of 100mA or even 150mA. The 5V pin is the primary regulated supply and any board that needs more than a few mA should have a regulator from the 5V to generate its own supply voltage. In the event that a module needs a voltage higher than 5V I routed the input voltage directly to the Vin pin but it is unregulated and untouched except for the PolyFuse protection.

GPIO15 is shared with a signal called LED4 on the AR9331 and the description reads “Ethernet switch LED3” and it defaults to a general purpose IO pin.

GPIO16 is shared with LED5 for which there is even less information available but it defaults to an IO pin.

GPIO18 can be configured as I2S_CK for an I2S audio inteface.

GPIO19 can be configured as I2S_WS for an I2S audio inteface.

GPIO20 can be configured as I2S_SD for an I2S audio inteface.

GPIO21 can be configured as I2S_MCK for an I2S audio inteface.

GPIO22 can be configured as I2S_MICIN for an I2S audio inteface.

GPIO23 can be configured as SPDIF_OUT for a digital audio output.

GPIO24 is always a general purpose IO-pin.

GPIO26 is a general purpose IO-pin that can be configured as a generic LED driver.

GPIO27 is a general purpose IO-pin that can be configured as a generic LED driver.

GPIO28 is a general purpose IO-pin that can be used to control and external Low Noise Amplifier for increased WiFi sensitivity. It is always available as an IO pin on this board.

The I2S Interface

I2S/SPDIF out is an audio interface that support up to 48 KHz sampling clock and a serial clock of more than 512 * sampling frequency. It also supports seamless switching of the audio out stream from I2S to SPDIF. I2S MIC is also supported. Can generate serial clock for various sampling frequencies.

It is a low cost development board that lets you embed Linux into your projects. It runs OpenWrt with a Linux kernel, has 2 USB host ports and has full Ethernet and 802.11 b/g/n WiFi capabilities.

Applications:

Internet of Things

Voice over IP

Mesh WiFi

Industrial Control

Internet Radio

3G/4G router

OpenWrt is a reliable Linux distribution for embedded systems with an emphasis on networking. It is open source, actively developed and well maintained. OpenWrt uses the OPKG package system, has lots of powerful utilities and the software is maintained in package form. Users can easily install, add and remove packages to make a very customized system.

Why?

The board was developed as an alternative to hacking a commercial router such as the TP-Link TL-WR703N Mini Portable Wireless Router to use as a development platform. There are many routers available based on the Atheros AR9331 Chipset and running customized versions of OpenWrt or DD-Wrt software. The TL-WR703N is popular because of its low price and small size.

Hacking a router to install OpenWrt is a well tried path to getting a functional board with open source software to allow development of low volume or one-off projects. It has its problems. In most cases the schematics are not available unless someone took the trouble to reverse engineer the schematics from the printed circuit board. The TL-WR703N has been reverse engineered and the schematics are available here . I looked at the schematics and they appear reasonable and are most likely correct or nearly so. So again, why bother making a board based on the same chipset? Part of the answer lies in our own requirements. We wanted a board with more than one Ethernet port and a USB port to allow us to write data on a real hard drive. The Raspberry Pi and the Beaglebone fail the two Ethernet port requirement although they have lots of USB ports available. In some cases we want to turn off the radio and use only the wired ports for security reasons. Also, routing Ethernet packets without hardware assistance is a CPU killer in terms of work load. That still leaves the option of using a commercial router and hacking it.

There are many routers out there and may are well supported by OpenWrt, our preferred operating system. Many have four or five Ethernet ports and some have USB ports as well. Some testing has shown that we need 64M of RAM for our target application and that ruled out some routers. The lower cost routers all seemed to be based on the AR9331 system on a chip and some testing on hacked boards lead to a remarkably annoying discovery. You can have two identical routers with identical software and one will have a reliable USB port, one not. Even worse, some have very low failure rates so they appear OK but will hang when left unattended.

Searching on the Internet for a fix showed that OpenWrt has a patch for the problem. After making sure the patch was applied we tested a couple of boards and they worked well. In fact, they worked so well that we considered the problem solved and started developing the application. After some time a board that worked correctly acted up and would not be reliable with a hard disk attached to the AR9331 USB port. We had previously tested this exact board with a hard drive and copied very large amounts of data from one place on the drive to another. We also read the content of the entire drive, a few hundred gig without any problem whatsoever. I tried another board with a physical hard drive and it worked fine but it absolutely refused to read an old USB Flash drive. Searching on the Internet for a solution I saw a post somewhere that installing a passive USB hub between the chipset USB port and the drive (or keyboard, USB to UART adapter or some other devices) fixes the problem for some people. We tried it and it worked! A flaky USB system became reliable. Two questions remained; Is it really fixed? and What is the cause? There is a large topic on the OpenWrt forum that started in 2012 and is still going about this USB issue. https://forum.openwrt.org/viewtopic.php?id=39956 There were many theories and suggestions including reading undocumented registers and writing the contents back periodically. More searching and emails eventually crystallized into the following facts:

All AR9331 devices have a USB stability issue

It is not power supply related

Disabling the WiFi makes the problem go away

The problem can be solved by adding a USB 2.0 Hub between the AR9331 and the offending devices

USB 1.1 devices never work reliably.

The problem seems to be due to a hardware bug in the AR9331 and terminology problems. The AR9331 has a USB2.0 controller and it works reliably with USB 2.0 devices (only) but is unreliable with USB 1.1 or Full Speed USB devices. The problem can be resolved in hardware by installing a hub that connects to the AR9331 as a high speed USB 2.0 device and translates USB 1.1 transactions to USB 2.0 transactions.

I added a USB 2.0 Hub to the board and for good measure I added a second USB host port as well. We now have reliable USB ports for anything recognized by the software. Since one of our aims is to use physical hard drives attached to the USB ports I added a 5V 3A switch mode regulator to the board and wired the 5V directly to the two USB host ports. The ports don’t respect the 100mA/500mA current limits of standard USB port and will happily supply 2A or more on a port as long as the total current drain is less than 3A.

The board has been undergoing testing now for a couple of weeks and it appears that all the bugs are now in the software. All the parts are in house but the solder paste stencil is still in process. The board will be available for purchase by the end of June 2015 and a single unit will be below $50.

]]>https://news.ezsbc.com/openwrt-ar9331-development-board/feed/112V TO3-style regulator availablehttps://news.ezsbc.com/12v-to3-style-regulator-available/
https://news.ezsbc.com/12v-to3-style-regulator-available/#commentsSat, 27 Dec 2014 19:38:59 +0000http://news.ezsbc.com/?p=153The PSU6 is similar to the LM323 replacement in shape but produces 12V at 1A. Since the TO3 package is no longer manufactured all the regulators in this package will disappear from the market in due course. The PSU6 has a 40V absolute maximum input voltage and will produce 1A without a heatsink. It […]

]]>The PSU6 is similar to the LM323 replacement in shape but produces 12V at 1A. Since the TO3 package is no longer manufactured all the regulators in this package will disappear from the market in due course.

PSU6 next to its older brother

The PSU6 has a 40V absolute maximum input voltage and will produce 1A without a heatsink. It is mechanically identical to a LM7812K and is more accurate being within 2% of 12V under all load and input conditions. It includes over current, thermal and short circuit protection.

One of the improvements made to to the PSU6 based on user feedback is that the rings around the ground contacts have been increased in size.

]]>https://news.ezsbc.com/12v-to3-style-regulator-available/feed/2New Level Shifting Buffer, Level Shifterhttps://news.ezsbc.com/new-level-shifter-buffer/
https://news.ezsbc.com/new-level-shifter-buffer/#commentsMon, 28 Jul 2014 01:49:03 +0000http://news.ezsbc.com/?p=136I just finished the design and development of a new Level Shifter, LS2. Although similar in function to the LS1 the new level shifter complements the functions of the LS1. The new Level Shifter is a true buffer, squaring up the input signal and driving the output signal high and low with active drivers. The […]

]]>I just finished the design and development of a new Level Shifter, LS2. Although similar in function to the LS1 the new level shifter complements the functions of the LS1.

The new Level Shifter is a true buffer, squaring up the input signal and driving the output signal high and low with active drivers. The LS1 is a bi-directional circuit and drives low but has resistors for pull-up. It is aimed at I2C circuits and low speed signals.

The LS2 outputs are low when the inputs are not driven. Each one of the 12 inputs has a 500k pull down resistor to ground to ensure that the input will stay low while the micro driving it is in reset. It works well with an Arduino to convert 5V or 3.3V signals to 12V.

LS12 showing inputs and outputs on the two sides.

The LS2 has two power supply pins, pin 1 and pin 28 and the buffers can translate from low to high levels or high to low levels. The input and output power supplies determine whether the level shifting is from high to low or vice versa. The input and output power supplies can be anywhere from 3.3 to 18V and the order in which the supplies are turned on is not important.

The LS2 has 12 channels with the inputs on the left and outputs on the right.

LS2 in a panel before being separated

The scope shot below show the measured waveform when converting a 5V signal to 12V’.

]]>https://news.ezsbc.com/new-level-shifter-buffer/feed/1LM323K Replacement Now Availablehttps://news.ezsbc.com/lm323k-replacement-now-available/
https://news.ezsbc.com/lm323k-replacement-now-available/#commentsWed, 11 Jun 2014 13:41:37 +0000http://news.ezsbc.com/?p=130In the previous post I said that with a little bit of luck the PSU5 would be in production by the end of May. Well, the luck didn’t materialize and it took till the first week in June for it to be ready. Even now my production capacity is a little limited due to a […]

]]>In the previous post I said that with a little bit of luck the PSU5 would be in production by the end of May. Well, the luck didn’t materialize and it took till the first week in June for it to be ready. Even now my production capacity is a little limited due to a fault in the solder paste stencil.

From the picture above you can see that the inductor mounting pads did not get any paste. The stencil file provided by the PCB supplier to the stencil manufacturer did not contain the openings for the inductor pads. Normally paste openings are rectangular and because these were not strictly rectangles the CAM program dropped them from the paste mask. The supplier is re-manufacturing the stencil and for the time being the paste for the inductors are being added with a manual paste dispenser. Fortunately the pads are large so it is easy to do. A long story short; The LM232K replacement is called PSU5 and is available for sale from the shop. See http://www.ezsbc.com/index.php/products/psu5.html