# Variable wattage module

#### lightbeast

Joined Apr 6, 2012
7
Soo basically I would need to find and know how to program a micro controller? What's the simplest way to go about this? the project does have some size constraints. Voltage range would be from 3.7-7 volts and fit in a 3 or 4 AA sized project box.

#### chrisw1990

Joined Oct 22, 2011
551
a uC would be fairly small.. the connectors also, the hardware to control the load would be too, though whether you would need the traditional SMPS inductor capacitor shottky diode arrangement?
am i right in thinking this involves PWM to a mosfet arrangement? increasing/decreasing the pwm as necessary, determined through feedback loop?

#### CDRIVE

Joined Jul 1, 2008
2,219
a uC would be fairly small.. the connectors also, the hardware to control the load would be too, though whether you would need the traditional SMPS inductor capacitor shottky diode arrangement?
am i right in thinking this involves PWM to a mosfet arrangement? increasing/decreasing the pwm as necessary, determined through feedback loop?
Honestly, I was thinking of analog in (ADC IN) to analog out (DAC OUT). I wasn't thinking a PWM approach at all but it's a better approach than analog feedback; if his loads can handle it.

#### CDRIVE

Joined Jul 1, 2008
2,219
Big smile. It was so much fun to smoke the engineers that graduated in the 1950's by writing a Basic program in 1975. I can't believe that old language is still alive!

I can do this
Warning to you and other seasoned EE's, Techs and Eng Techs!!
Consult with your physician before using or handling a Picaxe. The Picaxe Basic code (alone) has been documented to cause side affects that mimic the use of Viagra.

Picaxe:
http://www.picaxe.com/
Picaxe VSM (Spice Software from ISIS). It's not current with the new 'M2' chips.
http://www.picaxe.com/Software/PICAXE/PICAXE-VSM
Picaxe VSM Forum: Discussions related to Picaxe running in the 3rd party ISIS Spice software.
http://www.picaxeforum.co.uk/forumdisplay.php?40-PICAXE-VSM
Picaxe Forum:
http://www.picaxeforum.co.uk/forumdisplay.php?2-Active-PICAXE-Forum
U.S. Supplier
http://www.sparkfun.com/search/results?term=Picaxe&what=products

QB Sites :
http://www.petesqbsite.com/index.php
http://www.qbasicnews.com/
http://chortle.ccsu.edu/CS113/index.html

#### chrisw1990

Joined Oct 22, 2011
551
Honestly, I was thinking of analog in (ADC IN) to analog out (DAC OUT). I wasn't thinking a PWM approach at all but it's a better approach than analog feedback; if his loads can handle it.
unless im much mistaken, isnt that basically what a traditional SMPS does? pwm? instead of this analog business.. though the DAC is just effectively a potentiometer, dont like that idea to be honest, a fast pwm would give a potentially smooth signal, but obviously demands more processing, unless the pic output compare module was used.. and a speedy pwm would decrease component footprint too, with smaller inductor, if what we are talking about is basically how to design a switched mode power supply..

#### CDRIVE

Joined Jul 1, 2008
2,219
unless im much mistaken, isnt that basically what a traditional SMPS does? pwm? instead of this analog business.. though the DAC is just effectively a potentiometer, dont like that idea to be honest, a fast pwm would give a potentially smooth signal, but obviously demands more processing, unless the pic output compare module was used.. and a speedy pwm would decrease component footprint too, with smaller inductor, if what we are talking about is basically how to design a switched mode power supply..
So what's your argument? I was agreeing with you. You obviously misinterpreted my post.

#### lightbeast

Joined Apr 6, 2012
7
Ok I seem to be over my head, yet this still interest me, where would I start if I wanted to program a microprocessor to do this? I know it can't be done and learned over night. What I want to do is build something like this http://www.madvapes.com/Variable-Volt-Box-Mod-Kit_p_3348.html (instructions: https://www.madvapes.com/How-to-build-a-Variable-Volt-Box-Mod-_b_37.html) but have the voltage be controlled as before so if different loads are put on it, the wattage will adjust to keep a constant voltage. Where the h*** do I start (I have no programming experience but am willing to learn even if it takes years) Somebody walk me though this.

#### chrisw1990

Joined Oct 22, 2011
551
So what's your argument? I was agreeing with you. You obviously misinterpreted my post.
lol i know, i was trying to make sure my thinking was correct.. and then also expanding the pwm v analog argument with component footprint size.. =] sorry if it came across argumentative, i was pretty tired at that point!

#### chrisw1990

Joined Oct 22, 2011
551
Ok I seem to be over my head, yet this still interest me, where would I start if I wanted to program a microprocessor to do this? I know it can't be done and learned over night. What I want to do is build something like this http://www.madvapes.com/Variable-Volt-Box-Mod-Kit_p_3348.html (instructions: https://www.madvapes.com/How-to-build-a-Variable-Volt-Box-Mod-_b_37.html) but have the voltage be controlled as before so if different loads are put on it, the wattage will adjust to keep a constant voltage. Where the h*** do I start (I have no programming experience but am willing to learn even if it takes years) Somebody walk me though this.
you definitely dont want to use that sort of regulator for 3A, its not an inteligent design and will only be inefficient for higher current, i think youre getting hung up on the variable wattage, what you basically want is a switched mode power supply, capable of producing more than enough current at the required voltages..what you would require is either buying a switched mode power supply (SMPS) chip or if like you want, to program your own.. iv never used this pic basic but im sure there must be a way of using the on-board pwm peripherals. what processor are you thinking of using?

#### lightbeast

Joined Apr 6, 2012
7
I think I'm in the wrong forum, Honestly I don't even know step one for this or anything about micro processors, I just know simple wiring and some electronics from being a natural tinkerer I am interested in learning (I've heard Arduino is good for beginners?) For the project I would like to be able to adjust the voltage in 0.1 increments and have it regulated as mentioned earlier. I obviously am not ready to tackle a project like that but where should I start if I am interested in micro controllers so I can work my way to my project? Also what knowledge should I have prior to learning micro processors?

:edit: Going to not be a noob and look around other threads here

#### chrisw1990

Joined Oct 22, 2011
551
i dont know? personally i just jumped in at the deep end.. my first proper programming is a pic32 which is currently a nightmare, but just getting little bits working! i dont think youre in the wrong forum, i think youve set your end goal, and now you have to find something intermediate to work towards..
so lets outline a spec? you want:
-0.1V increments for what range?
-The maximum current draw?

i dont think a traditional smps would allow you to increment in 0.1V steps, but have a look on suppliers like farnell, rs, digikey etc, depending on your location..dont know if your US UK or EU..

#### lightbeast

Joined Apr 6, 2012
7
i dont know? personally i just jumped in at the deep end.. my first proper programming is a pic32 which is currently a nightmare, but just getting little bits working! i dont think youre in the wrong forum, i think youve set your end goal, and now you have to find something intermediate to work towards..
so lets outline a spec? you want:
-0.1V increments for what range? 3.0-7.0
-The maximum current draw? Not sure the answer to this? the device would use two 3.7 li-ion batteries, but wouldn't draw be different depending on set voltage?

i dont think a traditional smps would allow you to increment in 0.1V steps, but have a look on suppliers like farnell, rs, digikey etc, depending on your location..dont know if your US UK or EU..
I responded in quote just filling up characters now (go vbulletin!)

#### CDRIVE

Joined Jul 1, 2008
2,219
I think I'm in the wrong forum, Honestly I don't even know step one for this or anything about micro processors, I just know simple wiring and some electronics from being a natural tinkerer I am interested in learning (I've heard Arduino is good for beginners?)

The software is FREE. The included .pdf manuals are FREE. The manuals are thorough and will take you from "What is a microcontroller", "What hardware do you need" to "Writing your first program" within the first few pages. Every command and statement is fully documented with example code that uses said command or statement. The manual also includes a host of sample schematics and included code.

I'm familiar with Arduino and I can tell you, without reservation, that there is NO, and I do mean NO, microcontroller family easier to learn than Picaxe. I will gladly confess that I'm very biased on this subject. I tend to get very worked up about this because it frustrates me to see electronics nubes, that have more than enough to learn about electronics theory and design, saddling themselves with the syntax of an Arduino or other uCs. Picaxe was developed for use by educators to teach young students microcontroller basics. When you read the manuals this will become very obvious to you immediately.

Where to start?? Well, I would think that after all of my blather and links in previous posts it would be evident. Download the latest Picaxe Editor/Compiler and the pdf manuals and read "What is a microcontroller", "Getting Started" and "Writing your first program".

As you progress and if you get stuck on a line of code, we have a 'Programmer's Corner'.

However, since Picaxe maintains its own forum, it's hard to beat for debugging Picaxe code or circuit design errors specific to Picaxe. Everything else... Uh, is done here; of course.

Are you still here? If you are you shouldn't be. You should be downloading. A new and exciting world is waiting for you!

One last note. If your only purpose here is to get your current project going, with no further desire to advance your electronics skills, then all of the above is moot. We have quite a large number of people that blow in here that are not electronics enthusiasts. They post their question. Hopefully get it resolved and blow out as fast as they blew in. I don't think this describes you. Does it? If it does I just wasted an inordinate amount of time. On the other hand I may have inspired others to bite at the Picaxe hook.

#### pilko

Joined Dec 8, 2008
213
@CDRIVE,

I second everything you have said.
I am an old retiree and thought I was too old to be learning about microcontrollers. I took the plunge with PICAXE a couple of years ago and never looked back. I was writing code after a few hours.
I now control my Heat pump, my wood furnace and my oil furnace, all with PICAXE.

pilko

#### CDRIVE

Joined Jul 1, 2008
2,219
@CDRIVE,

I second everything you have said.
I am an old retiree and thought I was too old to be learning about microcontrollers. I took the plunge with PICAXE a couple of years ago and never looked back. I was writing code after a few hours.
I now control my Heat pump, my wood furnace and my oil furnace, all with PICAXE.

pilko
Yeah, my buddy Ron, who was a coworker before I retired, worked with pics and stamps before he found Picaxe and then hooked me on them. He's never gone back. He bugged me for years to dive into uCs but, like you, I felt I was to damn old to pick up a new skill. I had no clue how easy it was going to be with Picaxe.

#### #12

Joined Nov 30, 2010
18,222
I made a discrete design to control a heat pump and quickly understood why the OEM used a uC. Impossible as it is for a field tech to repair a uC board, I can understand why it is a much better approch for the OEM.

I hate to be forced to replace a $100 controller board after having fixed HVAC equipment with$15 relays for 40 years, but the days when half a dozen \$15 parts will do the job are over. Todays equipment just won't hit the efficiency marks with 40 year old technology.

#### chrisw1990

Joined Oct 22, 2011
551
Not sure the answer to this? the device would use two 3.7 li-ion batteries, but wouldn't draw be different depending on set voltage?)
i meant the circuits you are driving from this power supply.. if you plug them into a lab supply, and find out how much current they take, then you can start pinning goal posts down!

#### lightbeast

Joined Apr 6, 2012
7
Wow, Thanks for information every one, I feel I can figure out how to get started now! Sorry I have been absent, I got a pretty bad head cold so have been bed ridden.

#### chrisw1990

Joined Oct 22, 2011
551
Wow, Thanks for information every one, I feel I can figure out how to get started now! Sorry I have been absent, I got a pretty bad head cold so have been bed ridden.
well come back when you know where you want to go with this/make progress

#### lightbeast

Joined Apr 6, 2012
7
well come back when you know where you want to go with this/make progress
Will do, going to have to save up a little bit to get the starting components and Picaxe kit (suggestions?) in the mean time I think it would be helpful to start learning basic