Dangerous Prototypes

In development => Project logs => Topic started by: matseng on September 14, 2012, 02:50:36 pm

Title: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: matseng on September 14, 2012, 02:50:36 pm
Well...  Since the Visulizer project is "done" I fearlessly threw myself into the next project - a 16 channel 110/230 volt light dimmer that can be controlled via USB or Bluetooth.

I messed up the layout a bit so there is only 0.2mm distance between the high voltage live and neutral. My plan was to have 0.8-1.0 mm in distance there but apparently I changed the settings of the fills in Eagle.  Connecting 230 volt to the PCB without any parts soldered expect for the fuse resulted in *nothing*, no fires, no sparks, no explosions.  So it seems that the 0.2 mm can cope with 230 volts for a while at least.

To see if the schematics and the design on rest of the board is ok I soldered up one board - but only installed 1 set of the power parts (triac, screw terminal, optocoupler) of the 16 that should be on the board. No need to waste parts if there are some other bugs.

The design is using a Atmega32U4 as the controller and is meant to be connected to a pre-made serial bluetooth module like this http://www.dealextreme.com/p/bluetooth- ... 326?item=3 (http://www.dealextreme.com/p/bluetooth-board-module-4-pin-121326?item=3)

The board looks a bit strange with all big and clunky thru-hole parts and one TQFP44. But since all the power parts are thru-hole I was thinking that "why not just continue using thru-hole stuff board". Why mix?

While soldering I realized that I've forgot the "HWB" button that activates the Atmel USB Bootloader during boot in the schematics, so I patched a button and a resistor ontop of the USB connector - far away from the mains power :-)

Time for some dinner and a few hours of writing the first revision of the firmware for it....

[attachment=0]
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: bearmos on September 17, 2012, 01:52:08 pm
cool project matseng, any more info on the bluetooth module?  It's always nice to have some "wireless-ready" modules to drop onto a board.
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: matseng on September 17, 2012, 01:55:06 pm
The board is kinda working ok. 

I spent a few hours trying to get the Atmel DFU USB-bootloader working. Since the DFU is pre-loaded on all Atmel USB devices the bootloader should just work out of the box as long as you have a 8 or 16 MHz crystal hooked up and a ~1uF cap on the UCAP-pin.  After a while I was thinking that the DFU was somehow faulty on my chip so I hooked up a regular ISP programmer and installed the Arduino Leonardo bootloader on it, but no joy then either.

It turned out that my footprint for the USB-B connector was not the same as for the actual connectors I used, so I just soldered a cut-off USB cable directly to the PCB and "viola" my laptop enumerated it right away.  So now I'm stuck writing the firmware for it using the Arduino IDE - well not really, I could just overwrite the bootloader again and install a regular LUFA or the hacked Adafruit bootloader...  But I think I'll stick with the Arduino stuff here, it really doesn't matter - I still need to handle my interrupts myself since the Arduino guys haven't bothered to implement support for hardware interrupts 2,3 & 6 in their libraries.

To get reliable zerocross detection I also had to add a 1 nF cap to the zerocross logic to filter out some noise, I could do that in the firmware as well, but sometimes hardware is easier. I still need to run another prototype series of the PCBs with the proper high voltage isolation distances and the fixed pinout of the USB connector. 

I'm not sure if I should stick with the USB-B or if I should move down to a thru-hole version of a mini-USB instead.

Also thinking of changing the screw connectors to one size larger since they are a bit on the tiny side for connecting regular mains wiring.

Maybe I can fit a RS-485 converter on the board and a connector for DMX512 control as well....
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: matseng on September 17, 2012, 02:09:26 pm
[quote author="bearmos"]cool project matseng, any more info on the bluetooth module?  It's always nice to have some "wireless-ready" modules to drop onto a board.[/quote]

Sorry, no info on the modules.  I had planned to get a bunch from GoodLuckBuy but they have disappeared from their site. So I'll probably just get some from any random Hong-Kong seller on Ebay like http://www.ebay.com/itm/261086322336 (http://www.ebay.com/itm/261086322336) and see if I can get them working.
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: bearmos on September 17, 2012, 02:26:41 pm
yeah, that's the only problem with these random cheap modules.  you'll probably be able to snag a pn off of the IC's after you receive some.  good luck!
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: rohitdesa on September 17, 2012, 03:44:28 pm
Nice! I especially like the wireless touch. I'm building something similar but DMX512 controllable. Schematics/layout? Would appreciate if you could point me to some info that shows how to 'properly' wire up triacs to a microcontroller.
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: matseng on September 17, 2012, 03:59:54 pm
All files are at gitgub https://github.com/SmallRoomLabs/DimBlue (https://github.com/SmallRoomLabs/DimBlue)

This AppNote from Fairchild is one of the best I've seen so far http://www.fairchildsemi.com/an/AN/AN-3003.pdf (http://www.fairchildsemi.com/an/AN/AN-3003.pdf)
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: TonyD on September 18, 2012, 11:20:10 am
Any chance you could add a pdf of the schematic to github?
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: matseng on September 18, 2012, 12:57:50 pm
[quote author="TonyD"]Any chance you could add a pdf of the schematic to github?[/quote]

Just pushed a PDF-schematics to github....
Title: Re: DimBlue - 16 channel light dimmer USB/Bluetooth
Post by: kj6dzb on September 18, 2012, 09:36:04 pm
Art net control! please.

chamsys makes a great Free loghting control program.

Mathison

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01172087640session_write_close ( )...(null):0
20.01202219232ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01202220008Database_MySQL->query( ).../DatabaseHandler.php:119
40.05722358744Database_MySQL->error( ).../Db-mysql.class.php:273