Saturday, January 30, 2016

Getting started with CC3200 + Energia

Another month another Seeedstudio recipe contest. This time the star ingredient is the Texas Instruments CC3200. The rewards initially were quite lucrative as well, a chance to showcase my project at the TI booth in CES2016. However reality got in the way and I did not receive the boards from China and get my project together till CES madness was long over.
I had proposed a GPS-AHRS like solution I have developed using the Xadow M0 module. However this did not survive meeting the real hardware. Even though the Cortex-M4 on the CC3200 is more than capable of handling the sensor fusion I could not get my Arduino code ported to Energia. I ended up building a war driving tool with wifi scanner, gps and microsd logging. You can read about it in all the gory detail here on the Seeedstudio recipe page.

Overall coming to the CC3200 from the ESP8266 platform was quite pleasant. There will be a price shock for those actually buying the dev board, but I got mine for free as part of my entry so that removed one hurdle. The Cortex-M4 processor and multi-threading are quite powerful. However Energia could use a merge back into the main Arduino project using the platforms mechanism. It makes it easier on tinkerers like me who constantly switch between NodeMCU, Arduino, Teensy, Navspark, Udoo Neo and now the CC3200.

Wednesday, January 20, 2016

Extending Energy monitoring - ADS1115 Grove module and ADS1115 Featherwing

After selling a few kits and populated boards of the NodeMCU Energy Monitor on Tindie, I started receiving feedback from people in the real world using my design. One of the main requests was the ability to support more channels, the other was miniaturisation suitable for fitting in 1 or 2 unit DIN Rail enclosures.

I addressed the request for channels by developing my own energy monitoring specific ADS1115 breakout. In addition to the core IC it includes 3.5mm stereo sockets for connecting the popular YHDC CT sensor and a couple of Grove connectors for chaining multiple boards together. Using this mechanism and the core NodeMCU energy monitor, one can monitor upto 7 current channels.

The issue of miniaturization is adressed by choosing a smaller form factor and feature rich ESP8266 breakout, namely the Adafruit feather. As a side effect we gain access to all the other boards using the feather form factor and all the other stackable featherwings.

During the design of the Energy Monitor Featherwing I integrated the ADS1115 onto the same board instead of using a breakout  (switched to 0603 parts to make it more compact) and used an SMD version of the Recom 5V Buck converter.

The featherwing can be mounted with stackable connectors under the Adafruit feather. Leaving the top free for display OLED for realtime power display or just weather or bitcoin prices vs energy usage.

Sunday, January 10, 2016

Leatherworking and mongol armor from coke cans

We regularly go to the Medieval fair in the Adelaide hills. Last year I tried my hand at metal working and came up with a great helm and a sort of crusader costume. This year I started playing Magic, like many nerds I played it while young, only recently have I found time (and money) to get back into it. I took inspiration Mardu Skullhunter on cover of B/W warriors event deck. This armor is sort of in the Mongol style if the very well funded Netflix show Marco Polo and wikipaedia are to be believed. The upshot was that I had to learn leatherworking and make a lamellar armor which would stand up for a whole day of walking through crowds and kids.
With the aim set I decied to do it on the cheap. I have made things out of coke cans before. The aluminium there is really easy to work with and readily available. I gathered raw materials for 6 months from Coke and assorted soft drink cans from colleagues. Finally I cutting them up into little pieces using stress fracturing and sealed all the edges by folding them in.

Affordable leather was surprisingly easy to get. I picked up a 16 squarefoot sheet of treated cow hide, just the right colour from the local leather shop - D.S. Horne for $50. They also have a good selection of hand leatherworking tools. This cheap leather is not armor thickness, so I backed it up with some craft foam glued and then stitched on.  The stitching proved pretty hard so I got assistance from the local upholstery shop. When you are rushing to make complex armor piece by piece in a week, you should use any help available.

The next stage was stiching on all the coke can lamella onto the leather and foam backing and making some eyelets for attaching all the pieces together. I used any left over leather to make straps for attaching sections.

Next came the accesories, what is a skull hunter without any skulls ? So I ordered a miniature skull mould from eBay and my friendly sculptor and fellow armor maker at Pointy Ears Creative Studio made a few expandable foam and plaster skulls for me.

It was all done just on time. The glue was still drying on my skull belt when we rolled into the fair. A whole day of amazing fun followed with lots of pictures being taken through out the day.

We even went to local pub in character and took some more photos, they let my coke can morning star through as well. By the end of the adventure some of the thin lamella got bent and the whole armor will need some repair before the next outing. I am thinking of laser cutting some shiny decorative lamella if possible. More notes on that this year.

Wednesday, January 6, 2016

The shed solar project - with UDOO Neo

A while ago I was planning to power my external work area from solar power. So I went ahead and orderer a couple of 100W solar panels from China. They cost $100 including the charge controller with another $100 for FedEx shipping. They have served me well so far, should have ordered some more. They have been keeping a 130Ah SLA battery fully topped up for a couple of years now. I never got around to acquiring an inverter, so my soldering stations are not yet solar powered.

After accumulating electronics parts, devboards and recycling TV parts for a year I had enough bit floating around that I had to construct a shed to put them in. At the very far end of the backyard, away from the house. It is a major hassle deploying electricity to the shed. So I decided to take the panels, which were languishing against a pole in the back verandah, and deploy them on the shed roof.

I installed the PID charge controller and massive battery on the inside together with some LED bar lights, suitably coated in clear silcone for weather proofing. Ultimately there are plans to build an MPPT controller and add some monitoring for solar energy generation as well as add some bitcoin miners for network support. The Carinya brackets I used to install the panels cost as much as single panel, next time better order brackets as well.

The LED's are controlled by a small $2 RF remote with a dimming and flashing function. A bit of an overkill but it makes for great raves in the shed. Being basically the large galvanized steel box the shed has very good RF shielding and an external weather proof antenna will be required for any sensor install and wifi connectivity. So I have hooked up a TPlink external antenna and placed a Udoo Neo with mods for an external antenna there, more Udoo + shed related posts to follow.

Wednesday, November 25, 2015

Dedicated Energy monitoring with the ADE7763

After building the NodeMCU based energy monitor with an external 16 bit delta-sigma ADC i.e. the ADS1115 I started looking into solutions which were more accurate and cheaper.

I came across some work by Skye Sweeney with the ADE7763. He had built a prototype on breadboard and wanted to monitor lots of channels so the cost of sensors became prohibitive and he set the project on hold. I am attempting to measure only a single phase and disaggregate the data later by post processing, so a single ADE7763 should serve my purpose.

I set about building a breakout board for the sensor using the reference design in the datasheets and ordered it from Oshpark. This is where I made an error in my rush. I did not check the footprint the element14 library provided against the real chip. So I ended up with a board with TSSOP footprint for a SSOP chip. Should have printed the PCB 1:1 and checked with a real chip. At least the error was found while prototyping and not in production. I bent the package pins a tiny bit to squeeze it in and proceeded to assemble the breakout.

I could not quite get the SPI bus to work on the ESP8266 NodeMCU, it kept resetting the Watch dog timer. With the ESP it is often a power issue. So for a quick test I hooked up the breakout to a Teensy 3.1 and loaded Skye's code without the multi-sensor bus stuff. It worked on the first go and started dumping RMS voltage and current registers. The only thing to be careful about is the rather limited 1v peak-to-peak input range. Otherwise this chip is great with dual 16bit d/s ADC's and all the code for RMS and registers for offset removal. At about 1/2 to 1/3 the price of the ADS1115. I have uploaded some standalone  breakout testing code to github - Arduino ADE7763.

For accurate measurements this sensor can be connected to AC line using Shunt resistors for current measurement instead of a CT sensor and a direct volatge divider ladder to measure the voltage waveform instead of an isolation transformer. This makes the chip MCU unfriendly and subject to mains voltages. The SPI bus should be isolated with optocouplers when using this mode.

Meanwhile I have tested the sensor using my basic load bulb and CT clamp and voltage and current waveforms are picked up just great. At some point I will build up the courage to create a high voltage / phase accurate measurement rig.

Tuesday, November 3, 2015

The SeeedStudio ESP8266 Contest and resulting product on Tindie

A few weeks back I participated in the SeeedStudio ESP8266 project design contest with my NodeMCU based Energy Monitor. As in all popularity contests I had to ask my friends to help me out and vote for me as often as possible. I had the most views, but not the most votes. Still I ended up in the second place which I am quite happy with.
Fully assembled NodeMCU Energy Monitor - Sensors plug in at the bottom
With such encouragement I decided to get a PCB fabricated for my Energy Monitor project and put it up for sale on Tindie. This is my first electronics project for sale and apart from some local interest, I have made an export sale to the UK. Deciding how to put the project together for sale is quite new to me. I have a certain skill-set but other electronics enthusiasts may not share them. Should I just offer blank PCB's, which other's might as well get from OSHPark or DirtyPCB ? Should I offer a through-hole kit along with the PCB and take the interested party through the soldering order ? Should I put everything together as SMD in my oven and offer the kaboodle including NodeMCU and the rather expensive ADS1115 ? What about the current and voltage sensors ?
NodeMCU Energy Monitor "mostly" Through-hole Kit

There are also component and PCB sourcing issues as outlined in a previous post. Tindie offers some flexibility in this regard letting me set-up various tiers and options. My single product listing becomes effectively a stratified listing catering for buyers with multiple electronics proficiency levels. I might start offering the 100A clamp of current sensor and 12V transformers from YHDC as part of my kit, to make gathering of all the components easier. With bulk manufacture in SMD, cheap mass produced NodeMCU modules and knock-off ADS1115's I might be able to get the total cost down to USD20 unshipped. Which will put the design at par with these non-web connected versions of the same. The design will also be far cheaper than the custom web-connected offerings from Efergy and Wattcost, mainly because these consumer grade products also provide a data hosting service complete with apps and websites. The NodeMCU Energy Monitor leaves the user in charge of their own data and requires certain knowledge of IoT platforms to take full advantage of it. The number of players (AWS, Thingspeak, Bluemix etc.) in the IoT data hosting arena is increasing daily and I am sure people automating and sensorising their homes will appreciate the choice, rather than be locked in with the server hosted by the hardware vendor.

The remaining hurdle is of course shipping, it cost me about USD14 to ship 2 units to UK from Australia as small parcels. Where as China post shipping costs are minimal. Logistics - another hurdle holding back small scale production in Australia. The only long term sensible thing to do will be to manufacture in China and exploit the logistics there. All said and done I am pretty happy with my $50 sale, at least it has paid for the electrician who installed the energy monitor.
Fully installed NodeMCU Energy Monitor - Black YHDC transformer, current sensor inside the enclosure

Monday, November 2, 2015

Making MBed and Arduino compatible Xadow Modules (in Reflow Oven)

I have designed a long chain of Xadow modules by now, including right angled side chains. These include:
  1. Xadow SD (CD4050) - Which allows using upto 32GB Micro SD Card and good read/write speeds due to the driver IC.
  2. Xadow Serial (SC16IS750) - Which adds 1 UART and 8 GPIO ports, with jumpers to allow upto 4 modules in chain.
  3. Xadow MultiSerial (SC16IS752) - Which adds 2 UART's (theres is not enough space for the GPIO's)
  4. Xadow IO (PCA0539) - Which adds upto 16 GPIO ports using I2C
I have tried various suppliers to gather all the components, various PCB manufacturers as well as solder stencils from OSHStencils. Here is the breakdown of my experience so far in prototyping some very small single boards using SMD only components.
Chain of Xadow modules - GPS, Oled, 9-DOF IMU, Barometer, Dual-I2C Uart (Bluetooth), Xadow-M0, Xadow-SD (Left to Right)

PCB Manufacture:

DirtyPCB - They use SeeedStudio for manufacture and fulfilment, but get bulk discounts and I love the Gerber preview option, no extra charge black PCB's and option to get extra PCB's in a batch. I have got gold finished PCB's from them as well these look rather good.

SeeedStudio - My first test PCB's were made here.They also provide an assembly service and a library of commonly used parts. In most cases I have managed to get 80% of the PCB assembled in China with 20% hand soldered at home, mainly crystals and main IC's.

OSHPark - This is the made in the USA solution to Hobbyist PCB's. They produce PCB's in a signature purple colour, which I guess is a soldermask colour no serious industrial PCB maker wants. The ENIG finish PCB's look rather good. The preview function is also handy. However the DRU for checking PCB's is a bit strict in terms of clearance at the board edges, vias are not automatically tented and signals require greater separation leading to a low density PCB overall.

I am yet to try PCBPool and local Australian and New Zealand options, but they are beyond the budget of hobbyists. Once I start manufacturing my designs I shall surely give them a go. Local hackerspace recommended #hackvana and I had a great chat with them as well.

Component Sourcing:

AliExpress - Components are a bit hit and miss, had the wrong ones sent at one point. All the ones tested work.

EBay - Probably same sellers as AliExpress. Similar performance, no bad shipments so far.

Element14 - Next day delivery is amazing for quick prototyping. The part search system has improved a lot and they even have an Eagle library for most of the common parts.

Samples from TI, Maxim and ON Semi - Nothing is as good as free stuff delivered express. All parts are detailed with CAD models (albeit in .bxl).


OSHStencil - The holes are a bit too big, probably because I did not shrink the solder mask enough. Great otherwise.
Homecut - Cut on a Trotec laser Speedy 100 from Mylar and Kapton. The laser has a bi
t too much power, so pads need to be shrunk even more.

Overall it has been a great learning experience and I have probably spent more on research than I would have spent buying a hotshoe IMU like the solmeta off the shelf. However in the end the product does exactly what I would like it to do. Next step - find a suitable 3D printer on 3D Hubs and get an enclosure built, also complete the MBed code to make it all work.