![]() |
Forum Index : Microcontroller and PC projects : Circuit diagram
![]() ![]() ![]() ![]() |
|||||
Author | Message | ||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4036 |
Thanks.... now I really really do not understand how the !M resistors can have been OK with the Atmel! John |
||||
HankR Senior Member ![]() Joined: 02/01/2015 Location: United StatesPosts: 209 |
Actually by not watching my wording super carefully, there was an oversimplification of the mechanism of getting accurate readings with these uC A/D inputs. It's actually not so simple as a driving current limitation; but a current, source resistance, and charge time requirement. As is the case with a lot of questions and answers here, the correct answers can be long and nuanced, so don't fit well into the mold of even a real long forum post. The device or device family datasheets and app. notes go into the subject, but fortunately I found an even better and very comprehensive app. note on the subject. It's by STM, but deals with the subject in a very general way that applies to all microcontrollers on the market. Here's the link to AN1636: Understanding and Minimizing ADC Conversion Errors |
||||
panky![]() Guru ![]() Joined: 02/10/2012 Location: AustraliaPosts: 1114 |
Excellent article Hank - a great reference for anyone playing with ADC. panky ... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it! |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Lewis, The 'problem' i can see is that when the battery is used the 3v from the 2 AA batteries will be lowered to about 2.7v using this particular diode. My suggestion would be to use 4 AA batteries and use connect it to the input side of the voltage regulator with a regular diode. You would then supply 5.4 volts which is enough for the regulator to get a good 3.3v. The 3.3v is probably necessary to keep the GPS and HC12 working. I imagine 2.7v will be to low, the PIC will still operate but the other parts? Anyone suggestions for the battery backup? (It does not need to be charged!) About the 1M working on an Atmel probably has to do with the fact that the voltage is stable over a long time. With a fast changing input it would probably not work, but for monitoring a power supply and sampling each second or so after it has been running for at least a minute would be ok. At least that was my experience. Microblocks. Build with logic. |
||||
MikeO Senior Member ![]() Joined: 11/09/2011 Location: AustraliaPosts: 275 |
I have used these boost regulators from 2 x AA batteries with great success, they also have a true shutdown input. Reg Mike Codenquilts |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4036 |
|
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Microblocks, I hadn't actually thought about the minimum voltage for the gps and other units, I checked and as long as the battery is new they "should" work However Mike your idea is brilliant I never thought of a step up converter. The only problem I can see with it is how can I use it so it's not actually drawing any current from the batteries UNLESS the main voltage gets disconnected? I can't see any way of doing that where the micromite doesn't lose power. Although if the autorun was turned on, would this matter? How quickly does the micromite turn back on fully after power is reapplied? I looked at the SHDN on the boost regulator, I can't quite get my head round it, Is it saying that if you drive the SHDN pin low the regulator is turned off ie the batteries would not be used or drained? IF this was the case then it could be used in conjunction with the battery monitoring circuit and work perfectly as needed |
||||
bigmik![]() Guru ![]() Joined: 20/06/2011 Location: AustraliaPosts: 2949 |
Lew, An idea, why not use the higher (out of spec) resistors for the ADC and doing your calc and measuring the real voltage with a meter and seeing what it looks like... If necessary you can always program an error adjustment into your code. After all does it really matter if it reads 3.1v when it is 3.02v ?? How accurate is required? Regards, Mick Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<< |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
100% accuracy isn't essential It's there to simply check the battery is getting charged with the solar charger IE if the voltage drops to 4.5 or 4 V then we have a problem - sound an alarm to the indoor unit(send notification over the serial txd/rxd port) |
||||
MikeO Senior Member ![]() Joined: 11/09/2011 Location: AustraliaPosts: 275 |
Lew you can control the shutdown pin on the regulator from the uMite, turning it on when some critical main supply voltage point was reached and also signaling this situation to the main unit. To be honest baring a complete breakdown of the main supply, a warning of a drop off of the main battery voltage due to a low rate of solar charging perhaps should be signaled on the main unit as you said, so a critical point was not reached. By the way I indicated a 3.3v module but you can get 5v ones also so it could supplement the main supply, however I assume if you were in a backup situation the object would just to keep the processor going and signal the failure so you could fix it, all the sensors that needed 5v would not be used. Mike Codenquilts |
||||
WhiteWizzard Guru ![]() Joined: 05/04/2013 Location: United KingdomPosts: 2932 |
You can use a voltage detection chip (which has a high/low output if it drops below a pre-set value) to switch an enable input on the 'booster'. This way, even if 'main' power is lost, the 'startup' code of your program can check the state of this output. and run the necessary code i.e. no need to keep power 100% to the uM. Many other ways to do it but this is the one I tend to use ![]() |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
I cannot figure out how to add the battery backup and stop it actually working with both the main power and battery connected. I'd like both supplies to be connected to the micromite, the backup battery feeding power AFTER the voltage regulator so the voltage is only around 3V, stop the voltage from the main power charging the battery, which the diode would have done if I used it, BUT it wouldn't stop the battery draining Ideally what I need is IF there was a pin on the micromite which is always low and only goes high if programmed to. by always low I mean with no programming telling it this. That way I could connect a dc converter to the battery, have it connected and the ground from it connected to this pin Then if the main power is working the program would tell this pin to go high which would disconnect the backup battery circuit If the main power dies (gets disconnected) this pin resets itself low and the backup battery circuit is back in line, the micromite reboots itself and the program knows to keep this pin low from the voltage sensing circuit But I dont think any pin actually is always low even without being programmed? I did find this circuit which seems ideal, it has enough power to keep the various modules running until the backup battery gets to around 2.2V ish http://www.pololu.com/product/791 |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Many other ways to do it but this is the one I tend to use ![]() The supervisory chips at doing this. They often have an open collector output and some have an internal pullup. So all you need to do is get the right supervisor chip (many trigger voltages available) and you have a power monitor. I have to dig up a schematic as i made one that indicated 3.0, 3.3, 4.5 and 5v by using four different supervisory chips with their outputs connected to a led. Microblocks. Build with logic. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
Sorted all the circuit for the boost converter and supervisory module out now, sent it to MicroBlocks, who hopefully can put it all onto the board. Jean when you get time to look at the circuit there are several changes, including connecting pin 13 to +3.3V I had forgot to put that in before. EDITED: I was reminded by my girlfriend that it's only a weather station, it doesn't need a backup battery, it can just be mounted on the roof. I had not thought of this. it's so simple, nobody is going to climb up on the roof to take it so it does not need complex circuitry for the backup battery circuit, or indeed a backup battery at all. Jean I have sent you the corrected circuit with NO backup circuit it's called Weather 12.dch Lewis |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
MicroBlocks Just a minor change - the collector for the transistor should be connected to the 4.7V net (hot end of R6) and not the 3,3V net as the voltage drop through the transistor would stop the HC-12 module working properly. also can these be headers and not screw terminals so they can plug direct onto the board please? ICSP CONSOLE HC-12 (rf module) GPS It would make the finished unit much neater The BME280 and the LUX sensor both use the clock and data lines so they only need one input "screw" I decided to power the LUX sensor from that extra pin you had on the rain header, so in reality I don't think the LUX sensor needs to be added to the board layout, it can use the existing SCL and SDA lines in the BME280 header and the extra pin in the rain header? |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
Hi Lewis, I am not back home yet, kids have to do a test for their new school. So i will be back on Friday/Saturday depending on how things go. Moving to a new city (360kms away) is not easy. Have lots of delicate stuff that need more care transporting so it takes ages.... I have my laptop with me, but it is not loaded will all my software, so i can check some but adapting it is for other tools/screens. Also have no internet yet, so i use the ones that are available in restaurants or other places. :) Microblocks. Build with logic. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
There is no hurry whatsoever, you take your time, sorting your life out and moving is way more important. I'm just so very grateful for all the help your giving with this project. I'm away for this coming weekend and won't have internet with me. and like I said - there really is no rush at all. |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
MicroBlocks Last change,. and this is only so the battery lasts longer Powered the gps module with a 2n3904 connected to pin 23, and 5V This is not essential, only if you have enough room on the board to put it. Or if it's easier use surface mount versions of the 2N3904 like I said before - no hurry at all |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
2016-03-22_104353_DipTrace_Schematic_-_Weather_14.pdf Last version of the circuit (hopefully) it now includes a LUX sensor as well as 2 X DS18B20's one for temp in the sun and one for temp in the shade The gps is powered from a transistor connected to the Micromite as is the HC-12 Module - I did this so it greatly reduces the power consumption as they are only powered on when needed. Didn't include the battery backup circuit as it's not a critical device that needs it, it's only a weather station outdoor unit! Diptrace circuit is in the zip file 2016-03-22_091420_Weather_15.zip Lew left hand side ![]() Right hand side ![]() |
||||
lew247![]() Guru ![]() Joined: 23/12/2015 Location: United KingdomPosts: 1702 |
EDIT: I decided to change D1 to STPS1L30 it's smaller, has a low forward voltage drop 0.3V and it's a standard "SMB" package size NOT updated it on the circuits above |
||||
![]() ![]() ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |