Build your own Circuit Board

A "new fashioned" televisor, using an Arduino to drive the motor and display.

Moderators: Steve Anderson, Dave Moll, Andrew Davie

Re: Build your own Circuit Board

Postby Andrew Davie » Thu Jun 29, 2017 6:00 pm

Klaas Robers wrote:Have you inserted a suitable low pass filter in the audio output circuit? When you use PWM for audio there is maximum high frequency activity at no sound output (silence). You can't hear it, but it is there. You see it on your scope and you feel it on the transistor. Full power ultrasonic output.



I have the simple RC-filter in there, as suggested by Steve some time back.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Klaas Robers » Thu Jun 29, 2017 6:12 pm

Then I think that the RC-filter is between the Arduino output and the input of your audio aplifier. Connect your oscilloscope to the output of the filter = the input of your audio amplifier. There should be little visible of the PWM pulses.

What are the values of the R and the C ?
User avatar
Klaas Robers
Frankenstein was my uncle.
 
Posts: 1432
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Re: Build your own Circuit Board

Postby Steve Anderson » Thu Jun 29, 2017 6:38 pm

The RC filter I suggested should be good enough for the job averaging the 187kHz PWM back into audio, at that frequency the resisual PWM should be around -60db on 5V p-p, i.e 5mV p-p.

Now you used the word 'noise', noise by nature is random whereas the PWM is regular and a fixed frequency. So is it truly noise or is it residual PWM? If it's residual PWM then that perhaps points to a better filter being required...or dare I say it, a better board layout. If you're still using breadboard - anywhere - get rid of it. Make sure all earths/0V cables are short and FAT.

In addition did you add the signal attenuator I mentioned some time back?

Steve A,
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3802
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Build your own Circuit Board

Postby Andrew Davie » Fri Jun 30, 2017 12:16 am

Steve Anderson wrote:The RC filter I suggested should be good enough for the job averaging the 187kHz PWM back into audio, at that frequency the resisual PWM should be around -60db on 5V p-p, i.e 5mV p-p.

Now you used the word 'noise', noise by nature is random whereas the PWM is regular and a fixed frequency. So is it truly noise or is it residual PWM? If it's residual PWM then that perhaps points to a better filter being required...or dare I say it, a better board layout. If you're still using breadboard - anywhere - get rid of it. Make sure all earths/0V cables are short and FAT.

In addition did you add the signal attenuator I mentioned some time back?

Steve A,



I spent a good hour this evening with the oscilloscope and camera, as I was going to post some images of the signal at various points. But I've come away completely befuddled. The board doesn't seem to even work anymore, and when I connect to my USB port for power it soon gets rejected with "this device using too much power". That's not a good thing. I started by measuring with the scope the output to the speaker pins, and I was getting a definite signal there - with no power input whatsoever (!) which made pretty much no sense to me whatsoever. It was almost a (very corrupted) sine wave with a high peak, flat area, low peak, flat area... 200mV peak to peak, and repeating at 20ms. That's mains frequency. Like I built some sort of power-collecting device. As I said, absolutely no power connection whatsoever - the board plugged into nothing (no motor, no LED, no speaker, no power) and I'm getting that signal on the speaker output. Or I was, anyway - I think as I said the board is now dead.

So this evening's a complete bust. What I've learned that it's much more difficult to debug a printed board than it is a breadboard. I can hardly find places to put my probe, and everything is so much more inaccessible.

But I have a plan. Since I had three of these boards made, I'm going to start populating another one, and measure as I go. First I'll put in the Arduino and make sure it's alive. Then I'll put in the RC filter and have a look at what's coming out (PWM) and filtered. If that's all OK, then I'll hookup the PAM8302 AMP to the filtered PWM and check the output there. If that looks OK I'll plug in a speaker. That will sort the sound

If sound is OK, then I'll move onto the IR sensors, and make sure that they're triggering OK. Then I'll go back to the sound and see if there's been any change there.

If IR and sound OK, then I'll try powering with the 12V external power and see if everyting is still OK. If so, I can then try the LED breadboard string. Again, check everything else.

The most suspicious issue on the (now dead?) board was the IRL540 which was getting waaay too hot. It should be pretty much ambient temperature, and in my original circuit it was - as confirmed by the thermal imaging I did. Something's possibly wrong in that area of the circuit design, perhaps? I'll go back and reconfirm with my original circuit and what documentation I have, that I'm using the same resistor values. One thing I did rely on was that my packets of resistors actually HAD the correct resistor in the packet. I went through some time ago and measured all - but I guess I really should have confirmed values before soldering into circuitboard. Lesson learned, even if I didn't put an incorrect one in, I realise I should have been more careful in this regard.

I'll probably post various oscilloscope images as I go. One example issue I had tonight that I simply couldn't understand - I had what looked like a sine wave at (say) 20mS scale and 0.5V with amplitude something like 2V peak-peak. But when I switched to the scope to 0.2V the reading became flat - instead of 2.5 times as big. It was very confusing and I just don't know what the hell was happening. At the same time the board seemed to be deteriorating before my very eyes until I no longer trusted it.

Steve Anderson wrote:In addition did you add the signal attenuator I mentioned some time back?
Steve A,


I guess not - I'm going to have to go back and find what you said, because I'm not remembering, sorry. I have the RC filter but... attenuator.... no.

For the record, I have nothing on breadboard during the tests tonight, except briefly the LED string, which I soon disconnected.

I do not have a ground plane on my board, something which I will definitely add to my version 2 design.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Steve Anderson » Fri Jun 30, 2017 2:41 pm

The thing I don't understand is that at first everything seemed to be coming along swimmingly - with the exception of the hot FET - now this...

When you build up the next PCB populate it only with the parts required to get the Micro working then check the outputs are what you expect. i.e. the PWM waveform is 187kHz and around 50% duty-cycle on silence. Burn the thing in overnight and check it's OK the next morning. Overkill, maybe, but there's no harm in doing it and it builds confidence.

Check the PC USB still outputs 5V when the thing is running, I hope you haven't fried that! They should be well protected but you never know.

Check the speaker still works, a 1.5V battery across the terminals should make noises as you connect/disconnect it (disconnect the amp output first). A few seconds is all it takes and any speaker should not 'burn out' on just 1.5V.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 3802
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: Build your own Circuit Board

Postby Andrew Davie » Sat Jul 01, 2017 3:30 am

I've been working on the next iteration of the circuit board. Here it is...

circuitv2.jpg
circuitv2.jpg (331.74 KiB) Viewed 3141 times


I made all the traces super-thick. I know I don't need to make it "pretty" but there's something in me that tries very hard to have symmetry and alignment, and optimal routing. I've added two LM317 for voltage conversion. The idea is that 15V is fed to the board. The first LM317 converts to 12.4V which is used for the motor and LED matrix/display. The second LM317 converts to 8V which feeds the Arduino. I thought it would be better this way, as the Arduino power convert would drop a volt or two and by feeding it 8 instead of a higher value, it will be less likely to
over-tax the on-board converter.

I fixed up the pin error in the SD card connector, and moved the card position. It will overhang the upper section of the Arduino. I've removed the limiting resistor for the display - it's now the display's job to incorporate that, if required. Generally the display will just be appropriate balancing resistors, I think. I have also moved parts around so that they are close to their functional grouping - in other words, I have shortened the paths to "things" where possible. I still haven't added/reviewed the "signal attenuator" so that might be something that has to be added.

When I get this manufactured I will put in a ground plane. Easy to do, it just isn't as easy to look-at and understand where things are going.

circuitv2coloured.jpg
circuitv2coloured.jpg (313.92 KiB) Viewed 3141 times


The various "parts" of the design are colour-coded above. Top left is the sound (PAM8302 + RC filter). The purple next to that is the Nextion connector. At the top middle (teal) is the MicroSD card connector. Top right (blue) is the power handling. Beneath that (grey) is motor control, and under that (aqua) is the display driver. Bottom left is the IR transmitter/receiver. In the middle, of course, is the Arduino.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Sat Jul 01, 2017 3:35 pm

Steve Anderson wrote:The thing I don't understand is that at first everything seemed to be coming along swimmingly - with the exception of the hot FET - now this...


I went back and reconnected everything except for the speaker. It's working. The IRL540 is still getting way-hot. I re-examined the original circuit connections and compared to the eagle design and all looks OK. I plan to de-solder the IRL540 and replace with a new one - I just can't see how/why it's getting hot. On the plus side, I placed the breadboarded string of 3 LEDs behind the spinning disk and I could (just) see valid pictures. So i know the display is OK, the motor is dodgy (the IRL540 getting hot) but working, and I'll leave the sound for later examination.

When I get a chance (maybe today, maybe tomorrow) I'll redo that IRL540 and start to populate the second board but only with the essentials and start testing as suggested.

Steve Anderson wrote:Check the PC USB still outputs 5V when the thing is running, I hope you haven't fried that! They should be well protected but you never know.


Seems OK.

Steve Anderson wrote:Check the speaker still works, a 1.5V battery across the terminals should make noises as you connect/disconnect it (disconnect the amp output first). A few seconds is all it takes and any speaker should not 'burn out' on just 1.5V.


I'm putting the sound issues on low-priority till I find out why that IRL540 is hot. Last night just seemed to be a downward spiral of confusion and things going wronger and wronger and not making any sense at all. Today seems a little less gloomy.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Sat Jul 01, 2017 7:51 pm

Had a bit of a play with things today. The first thing I did is replace the IRL540 with an IRL540N - what I was trying to do here was find a different manufacturer and not use the same batch of IRL540 I had. So, still exactly the same result - the IRL540N gets way too hot to touch.

But I also built up a complete second board, and a partial third board (my last). The partial board in preparation for the step-by-step testing/analysis of what's going wrong. But I liked the idea of doing an "all up" test with a newly built board. So I plugged in the new board, and it worked as expected. But the really interesting bit is that the IRL540N isn't even the slightest bit warm. There's something dramatically different between this board and the original. Very interesting - perhaps a short somewhere, or a damaged component? In any case, I did a video and even tested the sound (after the video). All OK. So I think it's working fine. It will be interesting to put the scope on some of the signals and see if it makes sense this time around :)


youtu.be/unvs8UBLjeQ

I guess that's the first working demonstration of my stand-alone version 2 arduino televisor! The picture is laughable, of course - 3 LEDs behind a piece of paper in darkness producing a barely recognisable image. But it's just a test - with a nice bright matrix close behind the disk, should be pretty good. And all running of the single 12V source now. Yay!
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Tue Jul 04, 2017 12:12 am

Here's the very pretty silkscreen mask for the rear side of revision 2 of my circuit board...

eye.jpg
eye.jpg (91.35 KiB) Viewed 3106 times


Here's the whole thing. The table of values gives resistor combinations for the LM317 voltage regulators.
Other text will list various optional components that may be omitted.

eye5.jpg
eye5.jpg (229.43 KiB) Viewed 3102 times
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Thu Jul 06, 2017 2:58 am

Version 2 of the circuit board has been ordered (3 prototypes).

I've already started on V3 - this one includes another LM317, so it's VIN --> 12V (motor, LED matrix) and then 12V --> 8V (Arduino) and then 8V --> 5V (sound board).

circuitv3.jpg
circuitv3.jpg (286.53 KiB) Viewed 3079 times


Hours and hours and hours spent on these designs, but the good thing is I'm now pretty good at driving Eagle :)
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Fri Jul 07, 2017 3:06 am

The latest V3 board design...

circuitv4.jpg
circuitv4.jpg (286.83 KiB) Viewed 3071 times


The power for subparts now comes from LM2596 boards. This simplified the design a lot. Each board is independent - NOT daisy-chained as per the earlier LM217 implementation. As I've just received some new MicroSD card readers with a different pinout and form-factor, I've also modified that section of the design.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Sat Jul 08, 2017 2:48 am

Another day, another design. I added some outlines for the components. Mostly I've tried to make the design compact, as the manufacturing cost seems to shoot up exponentially with increasing board size. There's a real incentive to make it as small as possible. This isn't far off, because those things surrounded in white outlines are immutable in size.

circuitv5.jpg
circuitv5.jpg (321.6 KiB) Viewed 3058 times


I'm becoming a bit burnt-out and rather sick of it all at the moment. Maybe I need a break.
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Sun Jul 09, 2017 2:36 am

Another day another iteration. I tidied up all the labels and borders and made things as aligned as possible. All of the power is going through LM2596 boards. Untested as yet - so it's a bit of a stab in the dark. I'm still waiting on V2 boards - I guess it's a bit early to be sending off V3 for manufacture! ALL of my V1 boards (3) appear to be "dead". After my show-and-tell at work, I tried installing the 3D printed Nipkow. When I spun it up - no LED display. I tracked that down (or thought I did) to the IR hole not being detected, and thus the interrupt wasn't triggered and consequently the brightness was not set. However, when I returned to the original Nipkow disk, it still didn't work. I went back to my (overheating) version of the board, and no display either. I tried feeding the LED matrix 12V and it shone brightly, so I know that's not at fault. Since everything was messy from the trip to work and back, I thought I'd hot-glue a few things to the bench top - particularly the voltage rectifier board. I guess that was a mistake because while testing possibly reasons why the LED wasn't showing (even though the interrupt WAS working and the brightness value was being written), well the whole thing just stopped working. Tracked that down to the rectifier board having died, so I guess those huge dabs of glue over the electronics on the back-side were a mistake. On reflection, I don't know why I assumed they were non-conductive. Oh well.. dumb mistake. I may not build a new rectifier board, as it's probably time to move to the power brick and start to use the LM2596 board in anger. I'll set myself up and do a bit of testing with one of them to confirm the voltage adjustment works and also have a look at the output on my 'scope.

circuitv6topsilk.jpg
circuitv6topsilk.jpg (203.46 KiB) Viewed 3046 times


circuitv6bottomsilk.jpg
circuitv6bottomsilk.jpg (148.66 KiB) Viewed 3046 times


circuitv6layer2.jpg
circuitv6layer2.jpg (131.76 KiB) Viewed 3046 times


circuitv6layer1.jpg
circuitv6layer1.jpg (120.7 KiB) Viewed 3046 times
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Sun Jul 09, 2017 9:54 pm

I discovered the "library part" I had designed for the LM2596 board didn't quite have the pads in the right position, so I redid that, which made the part a little bigger. That caused spacing issues because I already had things crammed tightly. So I decided to ease off just a little bit and space things out nicely. I 'snapped' everything to the grid positions (0.1") where I could, and this in turn made the traces much easier to get right. So, that's the big lesson - try to stick to grid positions for stuff. I also learned a nifty keypress when you select something - hold down the COMMAND key as you do it, and the part will auto-snap to grid position. I'm close to sending this off for a prototype run, but first I'm going to have a look at the LM2596 with a scope and under various loads, just to see how it performs. And I'm also going to have a go at using a different manufacturer, just because.

circuitv7.jpg
circuitv7.jpg (159.29 KiB) Viewed 3036 times


Interesting to compare this with the efforts at the start of the thread - I've learned a lot about driving Eagle!
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

Re: Build your own Circuit Board

Postby Andrew Davie » Mon Jul 10, 2017 1:27 am

Impatient me. I decided to do an order, this time through SeeedStudio. My prior orders were through OSH Park who have proven very reliable. I liked OSH Park because I could just upload the plain vanilla ".brd" file and it gave me an online rendering of all layers. Pretty. But the economics soon become daunting, for example with this board OSH Park would cost me US$41.25 for three (including "free" shipping). The same board in quantity of ten from SeeedStudio costs US$29.74 ($4.90 for the boards, $24.84 for DHL shipping). So, no contest really - provided everything goes OK! To get your board into gerber format, required by SeeedStudio, you need to do a bit of extra processing, but that's pretty clearly explained via a link on their site and was fairly painless.

For this version I put some 2mm screw holes at the corners, and a ground plane on the back. Hopefully that will be an improvement!

So, I'll have 10 to play with. Can't wait.

function.jpg
function.jpg (291.46 KiB) Viewed 3032 times
User avatar
Andrew Davie
"Gomez!", "Oh Morticia."
 
Posts: 1508
Joined: Wed Jan 24, 2007 4:42 pm
Location: Hobart, Tasmania, Australia

PreviousNext

Return to Andrew Davie's Arduino Televisor

Who is online

Users browsing this forum: No registered users and 1 guest

cron