emonTx SMT progress

Trystan and I have been making progress on designing an emonTx SMT. The idea has been outlined in this thread.

We have done a number of blog post documenting the various aspects to the design, see:

emonTx single AC supply

High Accuracy Current Measurement over a Wide Range

Arduino Leonardo ATmegA 32u4 and RFM12B

The current general idea is to use an adjustable gain op-amp front end based on the Atmel energy monitor app note hooked up to an ATmega32U4. This MCU has built in USB controller therefore no FTDI programmer will be needed. The ATmega32U4 with the Arduino Leonardo bootloder is supported by the latest version of the Arduino IDE. 

So far we have done some simulation, built a prototype and have done a preliminary PCB layout design. I'm about to go away for a few weeks so work on the PCB design will slow down. I thought I would post up here my progress so far. 

See attached for Schematic, preliminary board design, Port Map spreadsheet and Eagle CAD files. 

The PCB is 100 * 80 mm, it's been designed to slide into an extruded aluminum case with laser cut fascias for the ports. 

I would be interested to hear if anyone has any thought on the design so far. In particular the PCB layout and splinting of the digital and analog GND planes. It's getting to be quite a complex board. Initially attempts at routing have been difficult since there are so many signals to route in and out of the 32U4. I think the component placements will need to be further optimised, in particularly the digital control lines to the bilateral switches where giving me trouble. Any ideas would be appreciated. 

 

As I mentioned earlier, I'm about to go away for a couple of weeks so I won't be able to fully engage with this thread for a number of weeks. 

 

glyn.hudson's picture

Re: emonTx SMT progress

 Hello Everyone,

Here's another progress update on the emonTx SMT design.
 
This week I've sent the PCB CAD design files off to get a few prototype PCB's made. It's a very exciting moment, quite a milestone but also nerve wrecking! These prototypes will be assembled by hand and tested extensively. Eventually we plan to get the board ready assembled using factory SMT pick-and-place machines, selling the emonTX SMT as a kit is not an option! We don't plan to discontinue the current through-hole emonTx, we believe there is value in having a simpler through-hole kit version as an option.
 
As a quick re-cap the main features of the new emonTx design are:
  • Improved accuracy when monitoring low power levels with a programmable gain op-amp input stage on the CT inputs..see blog post
  • Single power supply - Half-wave rectifier AC-DC circuit to power the unit (under basic operation) and monitor mains voltage (enabling real power readings) from a single AC-AC PSU..see blog post
  • Direct USB programming - No USB to UART or FTDI cable required - built in USB host using the ATmega32u4 building on Arduino Leonardo design.
  • On-board Ethernet and multiple wireless radio options – RFM12B will remain the default option.
  • Pulse-counting, one-wire temperature and other spare I/O broken out on a pluggable-terminal block.
  • Casing - designed to fit in a nice wall-mountable extruded aluminium case with laser cut fascias
 
Read on for further thoughts, design notes and my general ramblings....
Since my last post not much has changed feature wise, what has changed is the 32u4 port assignments. The ports were initially assigned in a logical order, however the Arduino Leonardo port mapping on the 32u4 is not really in a logical order see [LINK]! When attempting to route the board even using thin tracks and vias it became apparent that optimisation of the port mapping was needed to improve the track layout. The main routing issue was caused by the digital control lines to the bilateral switches used to control the gain of the op-amps. Each CT channel has got it's own op-amp channel and two bilateral switches to control the gain, each switch is connected to a digital I/O on the 32u4. Initially this meant there were 8 digital control lines needed for these switches, as well as being hard to route I was also running out of I/O 's on the 32u4. A difficult decision had to be made, either make compromises like putting multiple functions onto the same I/O, use a shift register, or get rid of one of the CT channels reducing the number to three. After much deliberation it was decided for the first version we would try and keep things simple by getting rid of the 4th CT channel.
 
Another change which as been made since the last post has been to change the screw terminal block for a tight pitch pluggable terminal block unit. I've found a really nice unit that's not too expensive.
 
After port assignment optimisation things looked much better. I tried a couple of times using the Eagle auto-router but in the end I routed the board 100% by hand. This was not an eyesight or RSI friendly choice but did result in a much better track routing!
 
Even though a prototype PCB has been ordered the design stage does not stop here, there are a few questions regarding PCB design decisions that I made that I would like to discuss with someone with more experience than myself of designing SMT boards of this complexity, in particular the analogue layout and EMC design characteristics.
 
Analogue performance and EMC emissions
We would like to eventually get the unit fully EMC tested and CE approved. I have tried to design the board with EMC performance in mind. To the best of my best ability with limited knowledge of the subject I have attempted to implement the following, I would be very interested to hear from anyone who thinks something could be improved on:
 
  • De-coupling using 100nF capacitors on the power pins of all IC's and wireless radios
  • Directly route analogue signals as much as possible
  • Separate analogue and digital signals as much as possible – this was difficult and not really achieved with the digital control lines on the bilateral switches.
  • Separate digital and analogue GND planes on both top and bottom linked by an inductor close to the voltage regulator
Safety
 
  • Adequately speced component ratings and track widths for worst case currents at CT saturation
  • PTC fuses on USB and power supply inputs
  • Reverse voltage protection diodes on USB and power supply inputs
  • Over voltage spike zener diode protection on AC input to protect voltage regulator
 
 
 
 
JBecker's picture

Re: emonTx SMT progress

Glyn,

do you think that the MCP1702 can handle the power dissipation if the ethernet module is mounted (plus one of the RF modules)? Especially with higher voltage levels on external power (3? to 13V) there should be a problem (although I do not know the typical supply current of these modules exactly).

The SOT23 can not handle more than 200-300mW and then it also needs a bit more copper around it to get away with the heat.

On the other hand, why is the 56R resistor so big (7W)? I would think that not more than max. 1W should be ok (but this for sure depends on the output voltage of the transformer used).

Don't mind my comments, go on with your excellent work.... and hopefully we will see this in the shop in the near future :-)

Regards, Jörg.

glyn.hudson's picture

Re: emonTx SMT progress

 

 Hi Jörg,
 
Thanks a lot for your comments. It's great to be able to run through the calcs with someone else. You have raised a valid point regarding the thermal dissipation of the MCP1702 in the small package. I had not appreciated the effect of reduced thermal dissipation from the SOT23A package. I've just worked through the calcs given the worst possible conditions (highest Vin=5.25V, lowest Vout=2.31V and highest ambient=70C) - see attached pdf for my workings out. The calcs indicate the the MCP1702 SOT23A under worst conditions can only deliver 80mA. This is much less than it's 250mA rating. I have done a rough head-count of the power consumption of the various components: http://wiki.openenergymonitor.org/index.php?title=EmonTx#Power_Supply_Limits. Caution: the wiki is very much a work in progress, it's more my notes at this stage. For the prototype 80mA is plenty to test the basic energy monitoring and RFM12B system. I'll select a bigger regulator for the next version. Have you got any recommendations for a suitable unit? Thanks a lot for bringing this to my attention. This is why prototypes and open-hardware are great!
 
I've been paying particular attention to the current draw from an AC-DC half-wave rectifier. The 56R current limiting resistor and size of the reservoir capacitor were sized to provide 20mA max without distorting the AC voltage sample (the circuit was largely designed with the help of Robert Wall). This is enough to run the Atmega, op-amps, RFM12B and (just about) two temperature sensors. If any more current is drawn the simulation shows that the AC voltage sample signal will be effected, therefore effecting the real power reading. I think 20mA is about the maximum we can get from the AC plug-in adapter with a half-wave rectifier. You notice in my blog post when I talk about the AC supply I mention that it can only be used to power the emonTx in 'basic' operation. When Etherent/Xbee or lots of temperature sensors are connected then 5V USB DC will need to be used to power the board.
 
This is how I came to spec the current limiting resistor 56R:
 
The output from the 9V RMS AC adapter at max UK mains voltage = 16.8V peak. The half-wave rectifier diode is rated to 350mA. Therefore the max power dissipation could be up to 6W peak. I wasn’t sure if the resistor should be rated to the peak or average power, I choose peak to be safe. This is obviously over speced since as I said above the AC circuit should not be used to deliver more than 20mA, I was just trying to spec it to the worst case should someone try and connect a large load to the emonTx such as Xbee and Ethernet when powering from AC. I added a PTC fuse with a 150mA holding current and 300mA tripping. I should go for a fuse with a lower rating (50mA holding, 150mA trip), the size of 56R could then be reduced to 2.4W.
 
Thanks again for looking over my design. It's been a great help to run through these calcs again.
 
All the best,
Glyn.  

 Edit: forgot to attach the .pdf with the thermal calcs, here it is :-)

JBecker's picture

Re: emonTx SMT progress

Glyn,

I had thought that the power consumption would be much higher for the basic setup. I could remember a current of 23mA for the RFM12B alone but this is for tramsmit mode only. And I really thought that the rest of the system would draw a bit more (including LEDs).

So for this basic setup everything should really be ok. I would assume a maximum of 50°C ambient (at 70° the aluminium case would burn your skin when touched and this would also be a safety issue) and then the maxiumum current that can be drawn from the MCP1702 at 5.25V input and 3.3V output would be appr. 100mA. But it would get very hot and the calculation is only correct for optimum heat transfer from the MCP to the (datasheet says 4-layer) pcb.

It could help to use the SOT89 package option for the MCP as this has less than half the thermal resistance. And it would be advisable to use copper planes of min 1cm² to dissipate the heat from the ic package. These copper planes could be connected to the central GND tab either directly on the same pcb layer or via a number of vias to another pcb layer.

For the supply of the WIZ820 you could decide to use an extra MCP. It is not very expensive and this would also decouple the power supplies which could help to keep the analog reference clean from transients on the wiznets supply.

 

Regarding the 56R resistor I see that you want to cover the worst case peak power, which is perfectly reasonable. At the same time the thermal inertia (or capacity) is high enough to average the power peaks. And then I think that due to the half wave rectification you have to take only half the cited RMS value of 16.8V for calculation. Or is this nonsense?

Anyway, it is always good to stay on the safe side with component dimensioning. I have seen too many bad designs where you can burn your fingers or where the pcb changes its colour from green to brown after some time.

Best regards,

Jörg.

 

Robert Wall's picture

Re: emonTx SMT progress

Jörg. Or is this nonsense?

You need to calculate the average power (rms power is a nonsense - there is no such thing!). At a first approximation,  if the resistor is dropping 12 V at 100 mA for 5 mS per cycle, then the power is 12 x 0.1 x 5/20 = 300 mW. Of course, the currrent is not a rectangular block. To get closer, PSpice can help:

Plot the power in the resistor (= (voltage on end - voltage other end) * current) then use the "wavform arithmetic" (see Help) - Ctrl-left click on the power trace - to have it calculate the average.

And agreed - conservative rating is good for component life too.

(Warning - avoid wirewound resistors that are subject to pulsed currents, the thermal shock can cause early failure. Carbon (!) or metal film are OK).

 

glyn.hudson's picture

Re: emonTx SMT progress

 Thanks Robert I'll get on to doing that.

JBecker's picture

Re: emonTx SMT progress

Robert,

(comment deleted and rewritten, because I was unable to express what I meant to say, sorry!)

we agree that Glyns peak power calculation is absolutley correct.

If we think that we can take average power for dimensioning the resistor, one could do an upper limit calculation as follows:

- If the transformer has a peak voltage of 16.8V, this corresponds to roughly 12V RMS

- connect a 56 Ohm resistor to this voltage, this will result in an RMS current of ~220mA

- this gives 2.6W of power dissipation

- due to the  halfwave rectification of D1 the current will flow only half the time, so power diss. will be reduced to 1.3W

- combined with conduction losses in D1 this will be reduced to 1.2W

- if the MCP1702 output is not short-circuited, then the power dissipation will be reduced to ~0.6W

Hope this makes sense now.

 

glyn.hudson's picture

Re: emonTx SMT progress

First prototype PCB's have arrvied! 

So far I've soldered about 1/3 of the resistors. I'm still waiting for the IC's to arrive. I'm going away for a week or so on Thursday so the moment of truth will have to wait a while! Still, it's very satisfying to physically hold the board. Spirit Circuits have done a great job, it looks very well made. 

I've been looking into voltage regulators tonight. I'm going to go with the MCP1702 in SOT-89. This package is just over 6 times better at dissipating heat than the SOT-23! Calcs show that it should be able to deliver over 600mA with a voltage drop of 2.9V in 50 degree ambient. Obviosuly this it outside it's max current spec but it shows that it should be able to deliver all we want. It might be a good its to have a sperate regulator for Wiznet and Xbee but I'm keen to try and keep thinks simple. I'll keep this in mind in case we do have power supply rail coupling issues. 

Will try and look into current limiting resistor sizing tomorrow. 

JBecker's picture

Re: emonTx SMT progress

Glyn,

very nice board indeed!

Although I think that the MCP1702 in SOT89 is a good choice , according to my datasheet the thermal resistance is 153 °K/W instead of 336°K/W of the SOT23. Dissipating ~1.7W should be very hard also for an SOT89 with excellent coupling to a (BIG) copper plane!

stuart's picture

Re: emonTx SMT progress

 

Glyn, what are your long term aims on the future of emonTx/base etc. ?

Building things in SMT is fine, but moves far away from the home builder - do you have plans for a new eMonTx -  nonSMT version ?

 

Additionally, do we really need so much CPU power in a sensor board ?

glyn.hudson's picture

Re: emonTx SMT progress

 I've finally got round to revisiting the calculator for the 56R current limiting resistor. 

JBecker: you will be happy to hear that your approximation almoast exactly matched what the simulation indicated. 

Robert: Thanks for your excellent explanation of how to calculate the average current using LTspice. I did just that:  

Assuming a worst case senario of 150mA current draw (PTC fuse blowing - 40mA holding, 150mA blow) and maximum UK mains voltage (16.8V peak) the peak current draw through 56R is 2.66W and the average is 0.625W. This average current can be handled with a 2010 SMT resistor...much better!  

Stuart: Sorry for the slow reply, I have discussed our plans for the emonTx SMT in a blog post:  openenergymonitor.blogspot.com/2012/08/emontx-smt-progress-update.html.

Progress on testing the emonTx SMT has been slow, most of the fiddly soldering (SMT passives and MCU) is complete but I've not yet had a chance to power up the board. Hopefull I will have some progress to report on soon. 

stuart's picture

Re: emonTx SMT progress

Glyn, looking at the variable gain OpAmp circuit (which I've also built) and wondered why the original AVR designers went for Bilateral switches rather than a digital potentiometer ?

The digital pot costs around the same as the bilateral switch, but gives more steps of resolution and takes up less board space?

The only benefit I can see is "real resistors" are generally better tollerance than the digital pots - but this could be catered for in the software.

Their choice of steps is also useful given you can go bit shifting to set the multiplication factor.

glyn.hudson's picture

Re: emonTx SMT progress

 Hi Stuart, 

Could you provide details of your design? Although we have put quite a bit of work into testing and making a prototype PCB for the AVR App note design we are still intersted in looking at alterative designs.

One problem with the AVR appnote design is that each channel requires two channels of digital control lines to control the bilateral switches. It's this which made us only include three CT channels, the op-amp can support to to four, we just ran out of I/O's! 

I don't have any experiance with digital pot's, it's possible they could provide a nice solution. In terms of communication the RFM12B (interrupt driven) and possibly an Etherent module could be using the SPI bus, it's possible the bus could be gettting quite crowded. I2C could be an option but the I2C I/O's on the 32U4 are shared with INT0 and INT1 which are currently being used for the RFM12B and pulse counting interrupts on the emonTx SMT prototype design (I've attached a port map). 

It looks like digital pots are only easily available up yo 100K. The bilateral switch AVR app note design give an effective resistance switching of 6.8K-276K.

The main reason why we went for tha app note design is that it's a tried and tested (at least by Atmel) design and should perform well. 

Gyrbo's picture

Re: emonTx SMT progress

I realize this might be a bit late since you've already produced the boards, but you could have also used an opamp with a built-in PGA, for example the Microchip MCP6G0x series. This would save quite a bit in component count and board space. The cost would probably be about the same, especially if you factor in assembly.

jack_kelly's picture

Re: emonTx SMT progress

Hiya,

I'm really looking forward to the EmonTX SMT units.  I was just wondering if there are any updates on when the EmonTX SMT units might be available in the shop?  (I certainly don't mean to be impatient.  I know these things take a long time to fully test and tweak).

I need to buy 6 EmonTXs some time before the 2nd week of Jan and I'm wondering if I should hold off to get an EmonTX SMT?!

PaulOckenden's picture

Re: emonTx SMT progress

What Jack said!!!!

 

P.

markcarter10's picture

Re: emonTx SMT progress

Any News ???

glyn.hudson's picture

Re: emonTx SMT progress

Sorry for the lack of updates. The emonTx SMT has taken a bit of a back seat lately. Over Christmas we've been flat out keeping the shop stocked and running. The latest of the emonTx SMT is I finished building it up and after a little flying wire fix the board sprang to life! I uploaded the Arduino Leonardo bootloader and was able to upload code via USB from Arduino IDE. All the features I tested worked fine: wireless, temperature etc. 

Trystan and I proved that the the multi gain CT inputs are working as simulated but we are yet to write firmware to auto switch between gain levels. This is about as far as we got with testing. 

Recently we have been giving some more thought to moving to SMT. We are still keen to do it. However it has become apparent that the complexity of this design means is will be relatively expensive to get manufactured. Based on the manufacturing quotes I have received I estimate that we will probably have to sell it for about £100 including a case and one CT (no power suply). We think this is a bit too much for just an energy monitoring base station, and we don't think people really want the extra accuracy of the multi gain input stage. The accuracy of the old emonTx is probably good enough for most users. What do you think?

Taking this onboard I've been working on a SMT design based on the current emonTx design. We hope to be able to manufacture this hopefully for a similar price to the current emonTx (about £40 including one CT).  I think the extruded aluminum wall mountable case is a good idea. I'm designing this new design (I'm calling it emonTx V3) to fit in a 80 x 67mm  case. We are keen to get this unit into production as soon as possible, but I imagine it will be the middle of this year before we launch. 

Once the emonTx V3 has been released we will think about getting the emonTx SMT (as described above) into production as a more expensive but more accurate and fully featured option. 

I would love to hear you thoughts on this plan. 

MartinR's picture

Re: emonTx SMT progress

What's the reason for wanting to go to SMT for the current emonTx? Is it so that you can sell assembled units more easily?

For me, one of the main attractions of the current design is that it's easy to change or replace components, especially if it's going to be in the house for a long time. If I'm messing about in 5 years time and blow up a CPU I'm sure I'll be able to find another one. If I did the same thing with an SMT board I'd at best have to buy another board and at worst you'd have stopped supplying them and I'd have to start again.

JBecker's picture

Re: emonTx SMT progress

Glyn,

did you think about using an external 12 bit ADC? I did some tests with an MCP3208 (MCP3204 for 4 channels), results were quite good (factor 4 better accuracy, as expected) and price is ok (less than €2.50 @50 pieces). Conversion is also much faster (~8us).

BR, Jörg.

 

PaulOckenden's picture

Re: emonTx SMT progress

Have a chat (via PM if need be) with forum member Brian D - he's got lots of experience when it comes to small scale surface mount manufacturing.

 

Brian D's picture

Re: emonTx SMT progress

Did someone mention my name?

It’s true that I have built a few surface mount products maybe 100,000 or so. But this was back in the 1990’s. Anyhow, this is what applied in those days:

The products were radio controlled modelling accessories which I sold mostly into Germany – it’s a big market but even so the order size was often less than 1000 units so if tooling up for pick and place it only became cost effective when doing a run of about 5000 pieces.

My solution was to use larger SMD’s and have the boards hand assembled. This may seem crazy but it was cost effective. The increase in PCB size was compensated by using through-hole devices on one side and SMD on the other. The PCB’s were often copper on one side only. Minimum passive size was 1206. IC's were 50 mil. The operators doing the work were very skilled and the product reliability was surprisingly good.

I don’t know how people get around the problem of small batch size these days but when I was in business it was a big problem.

Maybe the energy monitoring market is bigger – but I doubt it. Also, I like the easy re-work capability of your existing products so for me the SMD version is not attractive.

 

markcarter10's picture

Re: emonTx SMT progress

Glyn

thanks for your update

IMHO £100 for the EMonTX SMT is too expensive!

stuart's picture

Re: emonTx SMT progress

I think once you go into the SMD market, the hobby angle is lost as its just too damn tricky to attempt to solder yourself or requires lots of specalist tools (and good eyesight!)

Perhaps invest your time looking at ready built emonTx devices instead - the current circuit design works well in my opinion.

I would like to look at the ability to add in a switchable gain stage - but this could easily be done with a daughter board against the existing emonTx modules.

I don't think physical size is really an issue for most people, the units are chucked into a meter cupboard or stuck in the garage next to the meter box.

 

I think it may be worth considering dropping the Nanode product range for the base station though  - the Rasp PI is just so cheap and really powerful - especially with the RFM12 interface.

 

glyn.hudson's picture

Re: emonTx SMT progress

@martinR Reason for going for SMT is to make the system more useful for more people, I feel the pain of the people having to assemble 50 + emonTx's for community energy monitoring projects etc. Don't worry the thru-hole design won't be going away, this is the beauty of open source! However in the future we will re-evaluate for how long we will sell thru-hole kits in the shop. Putting the kits together is quite labor intensive. 

@JBecker Yes, I agree. external ADC is the way to go for billing grade monitoring performance. MCP3204 looks like a good option. Have you published/blogged your testing results? 

@stuart Yes, again I agree. The RFM12Pi is slowly superseding the NandoeRF. However I think the NaondeRF does still have a place. Since it's easier to understand how it works for beginners school/students. The RasPi is great but its quite a daunting beast for people with no Linux experience. 

I've just posted up a blog post on our latest progress on an emonTx SMT design: http://openenergymonitor.blogspot.com/2013/02/emontx-smt-update-introducing-emontx-v3.html

I would love to hear your thoughts on the emonTx V3 design. 

Cheers 

 

 

Jérôme's picture

Re: emonTx SMT progress

Hi.

I'm considering getting a second emonTX.

Any news on this ?

Thanks.

casestudies's picture

Re: emonTx SMT progress

I'm in the same boat. :-) Any news? Thanks

glyn.hudson's picture

Re: emonTx SMT progress

Everything is on track to get the new emonTx V3 in the shop by the end of this month / beginning Dec. Pcb's are arriving this week and manufacturing (in the uk) is starting next week or the week after. Exciting times, will try and blog some updates as I travel to observe manufacturing and test units. 

 

Sorry for lack of updates on this thread. My latest post was on the blog

http://openenergymonitor.blogspot.co.uk/2013/10/new-office-space-and-new-units.html 

 

http://openenergymonitor.blogspot.co.uk/2013/08/emontx-v3-progress-update.html 

Jérôme's picture

Re: emonTx SMT progress

Thanks.

My fault. I don't follow the blog regularly. I searched there but didn't find.

Do you have an idea of the cost ? Last value I found was about 100 £.

I'll probably be using only the pulse counter, perhaps the temp sensor. Would it be worth adding a light version of either v2 or v3, or would it be roughly the same cost (a few resistors and jack sockets doesn't cost much).

The Low Power Temp Node is a bit cheaper. I must admit I didn't search, but from the picture, it looks like I could add the few things missing for pulse counting (assuming I could buy them as well). Yet, when adding the price for the few extra components, it must be close to the full emonTX kit.

Jérôme's picture

Re: emonTx SMT progress

Answering to myself.

emonTx v3 is now available (for pre-order) in the shop:

http://shop.openenergymonitor.com/emontx-v3-custom-bundle/

Congratulations !

glyn.hudson's picture

Re: emonTx SMT progress

Thanks, it's been a long haul but we're getting there. We have only done soft launch for now as we're still sorting documentation. yes emonTH has been to also work as a pulse sensing node. The irq interrupt pin has been broken out on the terminal block

glyn.hudson's picture

Re: emonTx SMT progress

emonTH is in the shop: http://shop.openenergymonitor.com/temperature-humidity-nodes/ :-D

Hope to start shipping next week. Please let us know if you spot any typos / dead links

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.