As many of you know we host a hackerspace here and love it when we have a bunch of hooligans coming by on Fridays to hack and work on things. Only thing is the last thing we want is hackerish hackers to have access to our own personal network of computers. So a goal has been to set up two wireless networks on the same router. One for our own systems and one for the hackerspace.
Whisker was having quite a few issues though so through the power of the Tymkrs IRC we went about troubleshooting the issue. The following is transcribed with minimal understanding (on my part) from the IRC. Hopefully it’ll help anyone else
Question was: Why doesn’t the virtual wireless interface in dd-wrt work?
Whisker wasn’t getting any errors but the virtual SSID wasn’t showing up. The second interface had been set up, had its own dhcp server, its own bridge, etc. It’s was also not set up to broadcast, but when toggled, nothing happened.
It had been tried manually since we weren’t broadcasting. (We don’t broadcast ssids around here). Nothing on the services panel seemed to be related to virtual interfaces.
Tautic asked “Have you checked to see if the router supports multiple SSIDs? If you want to know if your router supports multiple SSIDs at all then you need to make a telnet connection to your router and query thewl0_corerev variable.
- Telnet in.
- At the prompt, type nvram get wl0_corerev and press Enter
- It must return >=5 or you’re SOL
It returned 7.
Now, follow this: http://www.pennock.nl/dd-wrt/Multiple_BSSIDs.html
According to that, because it returned a 7, the router would need to be running a VINT version of dd-wrt.
After some time, “We have 2 wireless interfaces”
*YES* Thanks Jayson!
It’s no secret we’re huge fans of @oshpark because that’s pretty much where all of our boards come from. But sometimes what they offer isn’t what you’re looking for, or perhaps you like to shop around.
Luckily quite a few others have come up with more information on specific houses that I thought were comprehensive:
1) Boldport has ordered a number of various boards from different fab houses and shows the results: http://boldport.blogspot.ca/2014/02/so-you-want-to-manufacture-your-printed.html
And they’re beautiful too, which doesn’t hurt!
2) A reader of the blog sent this link that he keeps updated in terms of the technical requirements of the different fab houses just in case you wanted to see if they were good enough: http://www.opencircuits.russ-hensel.org/PCB_Manufacturers
This public service announcement brought to you by the letters P, C, and B :D
Right, so we had the hackerspace last night - EPIC sugar rush. I found this terribly pink and sweet ice cream float recipe involving Cherry 7-Up, vanilla ice cream, whip cream, and maraschino cherries. It was amazing. But of course with the hackerspace, Peter (@wireengineer) was there to help troubleshoot the updated board.
Where we left off:
And after checking the circuit with a 2n7000 FET, there were a few things we had to double check and fix.
- Make sure Drain, Gate, and Source was properly labeled on the board and schematic since you know, the BJT I used in the last board was totally mislabeled -_-.
- Add a 10ohm current limiting resistor as per our previous calculations in series with the solenoid. For some reason, I didn’t include it in the last iteration even though we had discussed it.
- Then I had to add a pull up resistor to Gate and instead of having the 10k resistor parallel to the FET, I put it back as a biasing resistor.
And it seems that this configuration works just as well as the darlington array with 2 BJT transistors with fewer parts. So! *monkeys with KiCad*
Welp - I’ve looked through the different major problem spots and it looks like everything should be in the right place. I should probably send it off to oshpark huh :)
Version 2 released the magic smoke and well, has been shown to be problematic in all of the items it was supposed to accomplish :p. Version 3!
Step 1: Get everything into Kicad and somewhat organized.
Step 2: Reorganize!
Step 3: Reorganize again! And add traces!
Here’s the previous one we’re comparing it against:
Oh man. just noticed the rounded corners i should incorporate :p. Okay, so major changes include:
- Fixing the pad locations for the audio jack
- Actually powering the audio chip
- Change the BJT transistor to a FET, though with the same package type.
Those are the main ones I can tell. But what I’ll do is during the hackerspace is compare the schematic with the board and make sure everything looks appropriate. I’ve also asked @wireengineer to bring the FET over tonight during the hackerspace, and we’ll solder it on!
Just finished writing about how that power transistor would be a potential and how and why it would work. Went to hackerspace on Friday night (you know, cuz it’s in my basement), and @wireengineer took the time to troubleshoot my PCB.
Reminder on the Issues:
- 1) Solenoid seemed to be pulling too much current and wouldn’t work
- 2) Audio chip wasn’t amplifying correctly
- 3) LCD screen was bleepbloopbleeping.
So apparently there were a lot of issues LOL. Uh. Here’s the working (mostly working) fix - I’ll go into more detail about what was done:
So. This awesome 3D matrix represents a few things.
- I put the transistor on backwards -.-
- The audio chip was put on backwards and I guess I didn’t send power to it?…*looks back at schematic and PCB layout* *proceeds with major facepalm* It looks like even though I have it correct on the schematic, the PCB layout was incorrect. Not sure why I didn’t have a ratsnest line that showed up for that.
- The solenoid needed a resistor. I think it was for current limiting reasons. @wireengineer ended up using a 10ohm resistor.
- So the majority of the 3D fix involves adding a darlington array to allow the microcontroller to drive the solenoid. (As far as I understand it anyway). No idea what a darlington array is but it looks like it involves an additional transistor amplification stage.
- It was suggested that I move to a FET (2n7000) instead of using BJTs. FETs are apparently voltage controlled current sourcing whereas BJTs are current controlled current sourcing (again, if I’m remembering what he said). Doing so would avoid the need for a darlington array. I’m pretty tempted to just use it since it works already. Hrm.
- The LCD seems to work independently so Peter’s thinking it may be my code. So I’m going to have to doublecheck the code.
So quite a few more issues than initially thought. But once the changes had been made, it was quite obvious that the chip did indeed work (facepalm). So. now time for a redo!
…or dissipated in the transistor when the transistor’s used as an amplifier :)
And this is where my question was. Essentially, I wanted to know why sending saturation-level voltages and conducting high current in the transistor meant less power than sending lower voltages and current.
Mark@Microchip and Vicatcu helped out today:
Mark: It’s less power dissipated in the *transistor* when you make it act like a switch.
Me: So it’s like….like resistance (but not resistance in the electrical sense of the word)? *cue analogy time* Like if I have a crapton of water in a tank and I let it all out at once, it doesn’t exert a lot of pressure on the sides of the tank, it just comes out. But if it’s a small spigot, then a lot of pressure is exerted throughout until the water gets out? Maybe?
Vicatcu: Heat equals power = I^2 * R losses. If you’re in the “switch” region, you have low R or high R.
Me: So on (low R) and off (high R) relatively..
Vicatcu: Yup. In the amplifier region (aka the linear region), R is significant. So you get more power lost in the channel.
Mark: It’s more like turning on a vacuum cleaner. You’d rather have the power being used by the motor than being used by the switch. http://en.wikipedia.org/wiki/Transistor#Transistor_as_a_switch
General teaching moment:
And remember that in the amplifier region, it’s amplifying what’s across Vbe, not Vce.
Red: What you’re generally amplifying is the AC characteristic at Vbe, whereas the biasing voltage is the DC characteristic at Vbe.
- Vbe = Voltage at Base - Voltage at Emitter
- Vce = Voltage at Collector - Voltage at Emitter
So we left off wondering whether the max power that the power transistor of choice could handle, would be able to handle the solenoid powered off of 5V. The following is my thought process as molded by the brainiacs in the Tymkrs IRC :)
Apparently, I’m using the transistor like a switch. When the base is biased (or when there’s power going to it), current goes through collector and emitter for the solenoid. This means I’m not using it like an amplifier. (Probably a good idea to figure out what these guys mean by using transistors as switches vs amplifiers).
Chasxmd: I’m not super great at this myself but I know enough to get by. Assuming you’re using the common base driving circuit to drive your solenoid you’re going to be driving the base of the transistor between 0V and something more than 1V then you’re not varying the amount of current other than “all” or none.
So if you are driving your transistor with 5V B-E you will have 1.1A current following through your transistor and solenoid. If you have no voltage on your B-E junction you will have 5.5V across your C-E junction with no current flow. If you start forward biasing your transistor in the 500mV range (or in that neighborhood) you run the rise of dissipating too much power in the transistor.
MarkAtMicrochip: As chasxmd said, as Vbe goes above 0.7V, the transistor is going to start conducting. And once it hits this range, the Vce (the voltage drop across the transistor) goes way down. This is called “saturation”. Some data sheets will spec VceSAT or what the voltage drop is once the transistor is in saturation.”
Your VceSAT is 200mV MAX. So at 1.1A, you’re dissipating only 220mW in the transistor. You should be fine so long as you can get the base above 1.0V.
Me: So once voltage hits threshold, 0.7Vce (this threshold holds for the majority of bjt transistors as far as I know), it doesn’t take much for it to
“activate” Ice to activate the solenoid. How’d you come up with the 200mV and 220mW values?
MarkAtMicrochip: Page 4 of the FMMT618 data sheet. http://www.diodes.com/datasheets/FMMT618.pdf
You drive the base to VbeSAT so you get the advantage of VceSat. And if you do that, you get the transistor behaving like a switch instead of an amplifier.
Me with a lightbulb above my head: So if you bias a transistor between its minimum required biasing voltage and its saturation voltage, you’re treating the transistor as an amplifier. But if you bias a transistor to its saturation voltage, you’re treating it as a switch.
So. I’m biasing the base of the transistor with 3.3v at 30mA (whatever Prop’s pins can source) with just ON or OFF signals. Since the 3.3v is higher than the Base-Emitter Saturation Voltage, I am using this transistor as a switch. If I had been sending voltage between 0.89 - 1V, it could be argued that I was using it as an amplifier.
And since I’m sending the max VbeSAT, that’ll trigger the maximal response through CE which in this case is, “Collector-Emitter Saturation Voltage” according to the datasheet, 200mV.
So the new formula would be: P = IE = (1.1Amps)(200mV) = 220mW
So let’s look back at what Chas was saying:
"So if you are driving your transistor with 5V B-E you will have 1.1A current following through your transistor and solenoid. If you have no voltage on your B-E junction you will have 5.5V across your C-E junction with no current flow. If you start forward biasing your transistor in the 500mV range (or in that neighborhood) you run the rise of dissipating too much power in the transistor."
Essentially he was giving example voltages. If I send 0 or 5v or 3.3v (essentially anything above 1v per VbeSAT), then I’ll have 1.1A current going through the transistor/solenoid.
If I however send 500mV, or anything less than 1V (VbeSAT), then a LOT of power will dissipate in the transistor.
Next question. I wonder why voltage saturation leads to less power dissipation than amplification? Esp if there’s less current with amplification than saturation?
Remember in a previous troubleshooting post I mentioned the transistor getting really hot? And that the issue was that it was trying to conduct 1.1Amps worth of current as opposed to the 200mA it’s actually able to handle. Woops.
So I need a more beefy transistor, one that can handle 5V at 1.1Amps, and is preferably surface mount. I originally looked for a throughhole power transistor and ended up with a lot of examples of the TO-220 package.
As you can imagine, this is rather big and vertical, which would interfere with some of the components that hang off the board such as the heart rate receiver or LCD screen.
So I went to Digikey - where you can reliably get most of the parts you need for decent prices - and searched for “power transistor”. Went to BJTs since I understand these better.
There were a few filter items I knew I wanted. For one, I wanted the mounting type to be surface mount. I also knew that transistor type was NPN. Then it got a little tricky. I wasn’t completely sure what “Current - Collector (Ic) (Max)” meant.
So I looked at this image from http://www.electronics-tutorials.ws/transistor/tran_1.html and decided it must be the max current that the transistor could handle through its collector. Since the solenoid pulls 1.1A, I decided to overkill and have the transistor capable of handling 2.5A.
This then left us with a whole bunch of options where max Voltage was anywhere from 15-20V. The solenoid’s rated for 5 Volts, so I won’t be needing anything as crazy as 100V ratings.
This may be hard to see, but essentially, it’s in a cute SOT-23 package. So the max current it can handle for our purposes is 2.5A and max voltage is 20V. One of the concerns I had, however, was the Power-Max field. It says 625mW.
Now if I know how to calculate watts, it’s through P = I E, otherwise known as Ohm’s Law.
If I take P (Watts) = (1.1Amps)(5V)….that equals 5.5Watts, which is clearly more than then 625mW. So what does this mean?
Well, 1, I’m not an electrical engineer :). Luckily I had help from @chasxmd and @markatmicrochip who essentially said that not ALL of that voltage is going across the transistor and therefore the power would not be as high as 5.5W.
This will be looked into more next post!