Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:54 06 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Circuit diagram

     Page 3 of 7    
Author Message
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4036
Posted: 11:07am 14 Mar 2016
Copy link to clipboard 
Print this post

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 States
Posts: 209
Posted: 01:21pm 14 Mar 2016
Copy link to clipboard 
Print this post

  HankR said   Haven't checked the Atmel 32 bit uP A/Ds, but I would guess those A/D inputs are similar with the same attendant limitations on driving current from the measured source.


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

Edited by HankR 2016-03-15
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 03:03pm 14 Mar 2016
Copy link to clipboard 
Print this post

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: Thailand
Posts: 2209
Posted: 04:51pm 14 Mar 2016
Copy link to clipboard 
Print this post

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.
Edited by MicroBlocks 2016-03-16
Microblocks. Build with logic.
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 07:56pm 14 Mar 2016
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4036
Posted: 09:57pm 14 Mar 2016
Copy link to clipboard 
Print this post

  HankR said  
  HankR said  Here's the link to AN1636: Understanding and Minimizing ADC Conversion Errors
Thanks!

John
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 10:10pm 14 Mar 2016
Copy link to clipboard 
Print this post

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: Australia
Posts: 2949
Posted: 10:33pm 14 Mar 2016
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 1702
Posted: 11:36pm 14 Mar 2016
Copy link to clipboard 
Print this post

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: Australia
Posts: 275
Posted: 11:41pm 14 Mar 2016
Copy link to clipboard 
Print this post

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 Edited by MikeO 2016-03-16
Codenquilts
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2932
Posted: 12:52am 15 Mar 2016
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 1702
Posted: 03:07am 15 Mar 2016
Copy link to clipboard 
Print this post

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


Edited by lew247 2016-03-16
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 04:52am 15 Mar 2016
Copy link to clipboard 
Print this post

  WhiteWizzard said   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


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.
Edited by MicroBlocks 2016-03-16
Microblocks. Build with logic.
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 08:00am 15 Mar 2016
Copy link to clipboard 
Print this post

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

LewisEdited by lew247 2016-03-16
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 11:42pm 15 Mar 2016
Copy link to clipboard 
Print this post

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?

Edited by lew247 2016-03-17
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 06:20am 16 Mar 2016
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 1702
Posted: 09:44am 16 Mar 2016
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 1702
Posted: 08:59pm 17 Mar 2016
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 1702
Posted: 11:10pm 21 Mar 2016
Copy link to clipboard 
Print this post

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



Edited by lew247 2016-03-23
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 04:22am 22 Mar 2016
Copy link to clipboard 
Print this post

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
 
     Page 3 of 7    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025