Wednesday, May 18, 2016

More Energy monitoring - ATM90E26 Breakout

After designing and testing the ADE7763 based Energy Monitor Breakout Board, I started looking around for cheaper and more modern alternatives.I came across the Atmel ATM90E26 Smart Metering IC with dual communication options - UART/SPI and multiple metering modes (tamper proofing with current sensing on live and neutral). However the Evaluation Module (EVM) from Atmel is over-engineered and targeted at an enterprise audience. It is around $800 from Mouser Australia. I guess it needs to be so to comply with creepage/clearance requirements for handling 240V AC signals. This however puts it beyond the reach of a dabbler such as me.
Assembled ATM90E26 Reference design with low-voltage components

So I set about extracting the low-voltage only components from the Atmel Reference Design and placing them on a PCB. Atmel generously provided me with 3 sample IC's to go with my PCB's from OSHPark, thereby saving me around $750 in testing their IC.

Checking SPI mode - Mode 3 works
Then I went on the usual hunt for prior art in interfacing this code with a microcontroller and came across this post in /r/diyelectronics which interfaced the ATM90E26 to a Raspberry Pi. Ryzee sent me the code and assisted me in choosing the right SPI mode (mode 3 in this case) which lets a Teensy talk to the ATM90E26. The code is now available as an Arduino sketch.
ATM90E26 RMS Voltage mesurement test harness
I built a low-voltage test rig to see if the voltage ADC works okay and all seems to check out. Full blown Energy Measurement tests next. Meanwhile I have placed the couple of boards I have on Tindie to gauge interest for a larger batch. Let me know if you would like to test this modern Energy Monitor IC on the cheap.

Tuesday, April 5, 2016

Nikon Hotshoe IMU with Xadow Modules

Hotshoe GPS-IMU in enclosure
We take lots of oblique images from a helicopter for our high-resolution 3D modelling service - Aero3Dpro. While photogrammetry and aerotriangulation lets us establish the position and orientation of these photographs afterwards from a relatively poor initial GPS and no IMU, just after capture there is no indication how well an area is covered from different angles. This can be a pretty difficult proposition anyway, especially in the presence of narrow allies and tall buildings. However with a good initial GPS-IMU one could build a low resolution model of the city literally on the fly.

All the components that get packed into the GPS-IMU

So I set about building a system that fills this niche, a camera hotshoe mounted system with a reasonably accurate GPS and IMU. There are already a lot of existing Xadow modules which satisfy the requirements of the system. I just had to cook up a few more as described in a previous post to cater for the unique requirements for interfacing with the camera and logging the data.

  1. Xadow Barometer
  2. Xadow 9-DoF IMU (can be combined with 1 above in the new 10-DoF IMU)
  3. Xadow GPS  (the NMEA from the stock one does not agree with the Nikon so looking at a UBlox based version)
  4. Xadow OLED
  5. Xadow-M0 with MBed support
  6. SPI to Dual-UART with SC16IS752, this is necessary because the only available UART on the Xadow-M0 is consumed by the GPS. We need 2 more UART's to send data to BLE module and camera at 4800 Baud.
  7. Xadow BLE Module  
  8. Xadow SD for logging locally in case BLE connection is patchy or a non-Nikon camera is being used which does not allow geotagging over UART.
A lot can be done when all these modules come together to party, the mBed code is available here. The android app for receiving the GPS-IMU data over BLE and predicting the camera foot print is still in the works. If anyone wants to take the app development up as an excercise I can provide the source. In conclusion I must thank Kris Winer for excellent IMU test beds and sample codes which helped me get started down this path.
GPS-IMU on hotshoe mount
After all the electronics came the enclosure and hotshoe attachment system. I designed something rough in blender using a trace of the stacked PCB's and got it locally 3D printed by 3D Hubs and Andrew Karas. This mounts nicely on the hotshoe, but the openings for reset, USB and cable to camera are not neat, a more aligned box is in the works.




Tuesday, March 29, 2016

Kenya Trip 2016 - Bustling Nairobi

This year I decided to visit Nairobi and Kenya in general after a long hiatus. I was there last in 2009, just before my family moved back. Otherwise most of my formative years have been spent there and I have many fond memories. So this year I decided to bite the bullet and visit the long lost high school and family friends. Arriving in Nairobi and staying in Kilimani was an eye opener. So much has changed in half-a-dozen years. Kilimani used to be farmlands and forests, now it is crowded with high rise apartment buildings.
Had to work hard to get past the Askaris at M-Kopa
Several successful start-up are located here as well. I managed to visit M-Kopa (which manages to turn a profit while selling/loaning solar panels to the poorest people), BRCK which has built one of the worlds first completely sealed and mostly waterproof educational tablets thanks to Qi chargers.
Apartments are being built everywhere in Nairboi
The top floor of the same building houses iHub, a co-working space allowing freelancers and start-ups looking for contract workers to meet-up and work together. The view from iHub is amazing as well.
The view of Nairobi from iHub, with a little bit of the human element
Gearbox is downstairs from iHub, it is geared towards hardware start-ups with soldering microscopes, lathes, CNC mills and of course a mandatory 3D printer. It is run by former theater props maker, skilled in wood and other materials as well.

My former high school friends have got their university educations in country or overseas and are itching to move forward with business plans. There is an IBM research lab and a Bitcoin start-up called BitPesa working in the remittances arena. I took UberX everywhere and stayed at an AirBnB with fibre access (albeit intermittent power). It felt like being in a hybrid world.
Three men on a pole - standard overhead cable fixing practice
Overall it was a great eye opener in the way Nairobi has changed in the last decade. A place to keep on the radar for future movers and shakers.


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.