These are chat archives for esp8266/Arduino

1st
Jan 2017
Lars Englund
@larsenglund
Jan 01 2017 10:28

Happy new year everyone :) This might be slightly off topic but I know there are some good hardware people here..
Hi, I've been trying, unsuccessfully, to dim a 60W indascent lightbulb with two back to back mosfets similar as in this post:
http://easy-electronics4u.blogspot.se/2012/02/switch-ac-loads-using-mosfets-as-relay.html
My circuit looks like this:
http://pasteboard.co/gMDwXpkFi.png
(there is also a 2A fast blow fuse and a 7D471K MOV on the mains input)
Below is the output from my scope:
http://pasteboard.co/gMtFZnbkz.png
C1: Live_230VAC
C2: DIM_GPIO
C3: Drain of Q5
C4: Source of Q5 and Q6

Q6 gets burning hot
Q5 stays cool
The lamp (obviously) flickers as we are only getting every other half wave.
Thinking about the circuit I feel that it will be impossible to get a Vgs voltage that is higher than the voltage at the source pin since the source pin will see the peak of the 230VAC?
Is there a way (preferably simple & cheap :)) of solving this kind of double mosfet dimmer?

Clemens Kirchgatterer
@everslick
Jan 01 2017 10:50
i only know the standard triac dimming circuit
Mehrdad K
@mkeyno
Jan 01 2017 13:58
are you sure about R17 & R18 calculation , mosfet very sensitive for bias voltage (not current )
Martin Ayotte
@martinayotte
Jan 01 2017 15:11
I would rather switch to traditional TRIAC circuits rather than trying to control MOSFET with proper PWM
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:07
has anyone tried using this HMC5883L library? I can't figure out which pins to connect the I2C pins to
oh are they fixed? gpio 4 and 5?
Me No Dev
@me-no-dev
Jan 01 2017 16:11
by default yes, but you can use other pins as well (not 16 or 15)
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:13
hmm, which ones are the default? different pages say different things
Me No Dev
@me-no-dev
Jan 01 2017 16:14
4 and 5
make sure you are not looking at the modules that have them swapped
early boards had them wrong on the silk screen
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:15
oh, thanks
that was pretty straightforward, wow
i'm wondering, is there a super cheap chinese router that will mill PCBs?
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:21
would be great to get one of those rather than wait a month for pcbs
Me No Dev
@me-no-dev
Jan 01 2017 16:23
oh wow those are cheap! I’ll get one for sure :) maybe get it to run on esp32 :P
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:24
haha
yeah, for $100, it's nothing
although i'm wondering how well it runs
and also, where do you get the thing to mill?
i.e. the pcb, the copper plate
but jeez, imagine just milling your own pcb in a minute
Me No Dev
@me-no-dev
Jan 01 2017 16:28
blank PCBs can be bought from anywhere pretty much
well … will not take a minute either :)
if you want accuracy, it will take a while
I use positive20 to make PCBs, but have been doing single side only and a mill would let me do dual-side
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:37
what's positive20?
Me No Dev
@me-no-dev
Jan 01 2017 16:44
uv active spray for positive exposure
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:46
oh, interesting, so how does it work? do you spray it on something and then? how do you project the UV?
Me No Dev
@me-no-dev
Jan 01 2017 16:46
I print on clear sheets for laser printer the positive of the board layout, spray a blank board, expose to UV light, clean the non-exposed part and then run through etchant
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:47
ahh, hmm, is that an easy process?
/messy
Me No Dev
@me-no-dev
Jan 01 2017 16:47
if you have everything necessary, it takes me an hour or a bit more to develop a board
I have two containers on the balcony. one with cleaner and one with etchant and is a regular routine now
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:48
that doesn't sound too hard
Me No Dev
@me-no-dev
Jan 01 2017 16:48
also I had to make a UV LED board to expose the boards
4 minutes is what I go for
not at home right now but can send you pictures tomorrow
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:50
that'd be nice, thanks
Me No Dev
@me-no-dev
Jan 01 2017 16:51
really home made process :) happens in a metal box from JackDaniels and piture frame to hold the board anf the positive print
vero board with 80 uv LEDS :)
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:52
hahah
Me No Dev
@me-no-dev
Jan 01 2017 16:53
works dreams though ;) depending on your printer you can go really small
Stavros Korokithakis
@skorokithakis
Jan 01 2017 16:58
very nice
Me No Dev
@me-no-dev
Jan 01 2017 17:01
if you get solder mask film, you can use the same stuff to add that to the board after etching
Holger Lembke
@holgerlembke
Jan 01 2017 17:35
there are some zip-lock_bag-style solutions that work quite well, too. else the etching can be a bit messy....
Michael Miller
@Makuna
Jan 01 2017 18:06
@larsenglund For AC dimming, search around, there are some new components that allow for easier control; including the ability to "pulse" within the wave at a high frequency. And not just a normal TRIAC.
Stavros Korokithakis
@skorokithakis
Jan 01 2017 18:39
@me-no-dev @holgerlembke i wonder if i can 3d print a negative mask for my circuits, and then use something with that (etching liquid?)
although i guess i'd end up with too many holes
Me No Dev
@me-no-dev
Jan 01 2017 18:47
Haha interesting idea! I have 0.2 nozzle that might do for some TH but smd... do not know
Lars Englund
@larsenglund
Jan 01 2017 19:03
@mkeyno yes, R17 & R18 are verified to drive the MOSFET with my desired soft turn off
@martinayotte I have built a triac dimmer but it produces to much EMI and audible noise without large chokes
@Makuna I think I have been looking around quite a bit, albeit only at cost and space optimized solutions. Please do point me to these new components!
Clemens Kirchgatterer
@everslick
Jan 01 2017 19:09
@me-no-dev any chance, you porting matrixssl to ESP8266 ? :smile: ;-)
Me No Dev
@me-no-dev
Jan 01 2017 19:36
@everslick is it worth trying? I recently saw a project with wolfssl for esp8266
Wander which is good
Clemens Kirchgatterer
@everslick
Jan 01 2017 19:50
hmm. matrix ssl claims to need 4KB per connection.
the wolfssl homepage says: Runtime memory usage between 1-36 kB
Holger Lembke
@holgerlembke
Jan 01 2017 20:11
@skorokithakis I always think of some sort of etching abrasive blasting. some sort of nozzle with a small diameter and around it some vaccum to remove the etching result withiut touching the rest of the pcb....
this on a plotter head could blast away the material... perhaps.
Clemens Kirchgatterer
@everslick
Jan 01 2017 20:44
aha, so all these SSL ram usage problems stem from the fact that TLS wants to have a 16KB receive buffer, because many/most server do not support 'fragment size negotiation'. switching to a different TLS implementation would not change this, obviously.
but if we make sure that the server we connect to can fragment packets into smaller pieces, then we could reduce the buffer to a more reasonable size, couldn't we?
Clemens Kirchgatterer
@everslick
Jan 01 2017 21:10
nevertheless, axtls takes an insane amount of ram for the initial connection and negotiation, so this might still improve with another implementation.
Michael Miller
@Makuna
Jan 01 2017 21:21
@everslick Isn't that memory use due to the initial crypto?
Clemens Kirchgatterer
@everslick
Jan 01 2017 21:25
@Makuna probably, but maybe it is still implementation dependent when, and how big buffers are allocated and freed.
Clemens Kirchgatterer
@everslick
Jan 01 2017 23:13
@Palatis do you have control over, how big of packet fragments the server sends over TLS in your case? do you need the full 16KB receive buffer?
Stavros Korokithakis
@skorokithakis
Jan 01 2017 23:30
does anyone know of a port of nacl/tweetnacl to the ESP? it would be fantastic for secure communications