Yes polarity matters with the barrel socket.
There is no 'auto correction' for reversed polarity.
There is a diode, which prevents reverse polarity power from damaging anything. But the Maple will be unpowered.
Yes polarity matters with the barrel socket.
There is no 'auto correction' for reversed polarity.
There is a diode, which prevents reverse polarity power from damaging anything. But the Maple will be unpowered.
So when it doesn't turn on I know the first place I'll look.
Sorry for the confusion its just when I was shopping around for microcontrollers I read that most use 5v to power your sensors or servos etc. So after I decided to go with the maple becuase it was faster and had more room for advancement than any of the other microcontrollers I realized it only accepted 3.3v so figured that wouldn't be enough if most sensor/servo run on 5v so I was just trying to figure out how to get 5v to the maples pins that the sensors/servo connect to. So why is the maples power requirements diffrent from other arduino boards? Like I said sorry for the confusion im a noob and trying to learn. Thanks for all the help guys.
DarkStar -
So why is the maples power requirements diffrent from other arduino boards?
The ATmega processor on the 'standard' Arduino can be powered by a voltage from 1.8V to 5.5V (IIRC was more restricted when they started making Arduino's, but let's skip that).
I assume they chose 5V because it is a very convenient voltage to use, including the reasons you mention; the designers of the Arduino are very smart people, so they would choose convenient.
The STM32F processor on the Maple is powered by a voltage of 2.4V to 3.6V (lower limit set by ADC). The 'standard' voltage for chips in that region is 3.3V.
(Edit: SOME of the STM32F pins can be connected to 5V under specific circumstances.)
If you are using analog sensors, then there are no pins that connect to an ADC that are 5V tolerant. You will have to use a voltage divider, but that is pretty easy to set up. I also wish that ADC pins were 5V tolerant, but you can't get it all. I still think that 3.3V isn't much of a limitation to work around.
'Source Impedance' is a factor that effects using a voltage divider to map a higher voltage, e.g. 5V, into the safe 0 to 3.3V range for the ADC.
This was discussed in this thread
http://forums.leaflabs.com/topic.php?id=260#post-1936
Wasn't that discussion concluded with the speed at which I need stable readings is slow enough that the ADC is able to stabilize on a voltage? How do voltage dividers affect this; I'm not sure we discussed this yet.
Wasn't that discussion concluded with the speed at which I need stable readings is slow enough that the ADC is able to stabilize on a voltage?
Yes, the discussion concluded that you were okay, but it touched on several topics which would have implied it wasn't okay.
You were able to arrange the electronics so that the impedence that the ADC saw was about 10K, and the long ADC sample time, that is the default for the Maple library analogRead, was okay for what you wanted to do.
In some situations, that isn't the case.
For example, a sensor may look like quite a high impedence to start with, so adding a voltage divider, to map the voltage swing to a safe 3.3V may make it worse, i.e. the ADC sample time might still be too quick.
Or, it may be important for the ADC to sample at a rate much closer to its maximum speed. Several people have enquiredabout how to do that. This needs the sample time to be much lower, and the sample circuit requires a much lower source impdedence, e,g, under 0.4K. Direct use of a voltage divider would most likely be impractical in that situation. It could be buffered with an opamp.
My point was, it isn't always easy to arrange to use a voltage divider to map a higher voltage down to the ADC's 3.3V.
For sensors and ADC inputs, it may be easier and safer to start with the sensors in a 3.3V circuit, rather than drop down from 5V, and even then, the impedence may be too high.
Ok. Does it matter what the ratings on the resistors in a voltage divider are as long as they are in the correct ratio? For example, would a 100 R1 and 200 R2 be equivalent to a 1K R1 and 2K R2? Assuming of course that those are standard values. If so, the resistance the Maple would see is just R1 (so less than 10K because I am no longer using trimpots).
Does it matter what the ratings on the resistors in a voltage divider are as long as they are in the correct ratio?
I guess you mean value (resitance) and not rating (usually means power dissipation).
Purely from a voltage perseptive, the ratio is all that matters, but something has to supply the current.
For example, would a 100 R1 and 200 R2 be equivalent to a 1K R1 and 2K R2? Assuming of course that those are standard values.
Those values are fine purely from a voltage division perspective.
A problem may appear when the current flow is taken into account too.
For simple resistors, it is often okay (though heating effects might also start to distort results).
300R across 5V will conduct 5/300 = 0.0017 A, or 1.7mA.
If that voltage divider is tied to the output of a sensor (which otherwise would swing upto 5V), it may need more current than the sensor can provide.
Say the sensor can only provide 0.5mA.
If that is the case, it looks like the senor output voltage is pulled down, so that the swing is no longer up to 5V, scaled 2:3.
No mater what voltage appears across the whole voltage divider
V = IR, where V will be the voltage across the 200R part of the voltage divider
V = 0.5mA * 200R
= 0.0005A * 200R
= 0.1V - Glerk!
Overall.
As long as the reistances are high enough, they won't load a circuit (e.g. sensor), and so will act as voltage dividers, but their resistance will be 'seen' as source impedenace by the ADC, and may force the programmer to sample the signal for a longer time than desirable (or even valid).
If the resistances are too low, they will load the circuit (e.g. sensor) driving them, and they may pull the voltage across the actual sensor being measured down.
So the values will have to be selected based on the impedance of the source, and the speed that the signal must be sampled at.
It may only be possible to make it work with an amplifier (e.g. op amp), set up for the appropriate gain, and with enough bandwidth, and able to drive the signal current fast enough into the ADC.
Does that help?
Well, that actually helps more than expected. So I'm forced between two equally bad alternatives. Either I choose low enough values (I corrected myself this time) that the circuit is "overloaded" (as in they are pulling down the voltage, doing more than what is wanted), or I choose high enough values that the impedance seen by the ADC is too high. Is the impedance seen the sum of the two resistors? That's what I gathered from the 300R calculations near the top. For calculating if they act like dividers, I just need to make sure that the current drop is tolerable.
Should I go back to using trimpots? I know that they have 10K at full resistance. I think that is lowers as you bring the wiper closer to the Vin side.
I'm not sure how to use an opamp and I am slightly off-put by the though of adding further complexity to my circuits.
Good thing I asked, I need help here.
Well, that actually helps more than expected. So I'm forced between two equally bad alternatives. Either I choose low enough values (I corrected myself this time) that the circuit is "overloaded" (as in they are pulling down the voltage, doing more than what is wanted), or I choose high enough values that the impedance seen by the ADC is too high.
You've got it!-)
Seriously, it's not that awful.
I was only trying to soften the original statement
You will have to use a voltage divider, but that is pretty easy to set up.
but not cause a panic.
In a lot of cases, it is okay because everything 'comes out in the wash'.
But IMHO, it is worth a minutes effort to check before building it as it can be puzzling to debug.
For calculating if they act like dividers, I just need to make sure that the current drop is tolerable.
Yes, as long as the sensor can provide enough current for the resistors then it is likely okay.
Rule of thumb (which are an over simplification:-)
1. Sampling the analogue input at <100K samples/second,
and
2. Total voltage divider resistor values < 20K
then probably okay
Should I go back to using trimpots?
I'm sorry, my answer is, it depends. If the sum of the two resistors is 10K, the trimpot and fixed resistors are electrically almost identical. Two resistors are more stable (no wiper to vary its position or contact resistance) but lose the ability to adjust.
I'm not sure how to use an opamp and I am slightly off-put by the though of adding further complexity to my circuits.
There are some 'stylised' ways of doing things, which are okay even if they offend an electronic engineer :-)
A unity gain buffer is one of the simplest op amp circuits
http://en.wikipedia.org/wiki/File:Op-Amp_Unity-Gain_Buffer.svg
It goes between a signal which is at the right voltage, but can't supply enough current.
So connect the input side (left hand +) to the voltage divider, and the output side to the ADC input. It doesn't amplify voltage, hence it is called a unity gain buffer, but it can supply plenty of current without loading the upstream electronics. Using a unity gain buffer, the upstream electronics might have an impedance of mega ohms, but the op amp would make it look like a few hundred ohms to the ADC.
A typical op amp can drive about 20mA or more, so it looks like a source impedance of under 200R. So, in theory, the ADC sample time could be reduced to its minimum value, and an ADC would handle well over 800K samples/second.
The op amp spec:
- runs off a single 3.3V rail,
- can drive the output voltage "Rail to Rail",
- "unit gain stable" (it usually tells you that on the first page of the datasheet) ...
Here http://forums.leaflabs.com/topic.php?id=260#post-1974 poslathian identified an op amp he's being using which works okay, a tlv274, which appears to be about $1.50 at e.g. digikey
Ok, I'll do some math and try to find resistor values that approach (asymptotically, of course) 20K total. My sampling speed is definitely low enough.
Aiming for 10K is okay; I thunk that's what you used for the trimpot, so using a resisitor sum about the same allows you to flip back and forth with few worries.
I need some help with the numbers. The Hall Sensor is telling me it sources 50mA of current. The LM355A tells me nothing, but I am running it on 1mA. The pressure sensor (MPX6115A) tells me .5mA, which seems strange.
Also, as I followed your math, I think I saw an error.
300R across 5V will conduct 5/300 = 0.0017 A, or 1.7mA.
I tried 3K with 5V and 5/3000 = 1.66mA, so 5/300 = 16.6mA, not 1.66mA (or 1.7mA).
Anyway, I think that I could go with 18K total resistance (R1+R2). I'd then use an R1 of 6K and an R2 of 12K. The total impedance is 18K (as stated). It would conduct
5/18000 = .28mA, and the voltage across the second resistor is V = .0005*12000 = 6V. I'm not sure how good that really is but I think it's as close as I can get to optimal. It appears that the voltage across R2 is a little large also (6V). Maybe I can reduce the impedance. All I need is a 2:3 ratio (or very close to). I know that I will never reach the extremes of my range, so the closest possible combination to a 2:3 ratio with the values near what I assumed in this quick analysis will work, whether it is a little high or low.
Note: Not sure why I included it, but my Hall Sensor isn't an analog input.
You must log in to post.