# Trying to get the most of all tutorials - Need your help :)

#### nfuids

Joined Sep 11, 2015
9
Hi everyone,

I've been reading a hell of a lot (almost all tutorial on sparkfun, and now that I found AllAboutCircuits, I'm reading the DC Volume). They all teach you the same basic elements (electricity, ohm's law, voltage divider, serial/parralel communication and so on), and they tell you you can play with IC/Microcontroller to do amazing stuff.

Although I'm starting to see the big picture, I kinda find it hard to fill the gap between these tutorial and how to actually build something real.

I'm assuming that a voltage divider might be used to give the correct voltage to different items on your circuit (like a IC might require a lower voltage that what powers your entire circuit), but how do we actually glue everything together? I mean how do I know if I should use a capacitor in front of an IC to prevent voltage/current variation that would damage it? Is this the kind of info that's available on data sheet of a product?

I'm I missing some tutorial I didn't see?

I have a project in mind, seems relatively simple to me (I'm sure it will be harder that I imagine, but hey, who said it was going to be easy!), I'm homebrewing and I plan on going all electric, as oppose to propane. So I would like to build a controller from which I could monitor, control the temperature and turn on/off the heating elements and pumps depding on certain conditions/data acquired from different sensor (temperature prob, level of liquid in different container, etc). More about all that on another post when I'm a bit more advanced. I started to draw the overall project (high level) so I can actually show something.

Any help / guidance would be greatly appreciated!

#### dl324

Joined Mar 30, 2015
15,511
Welcome to AAC!
I'm assuming that a voltage divider might be used to give the correct voltage to different items on your circuit (like a IC might require a lower voltage that what powers your entire circuit)
A voltage divider could be used in this manner, but you have to consider how loading will affect it. For example, when a voltage divider is used to set the DC bias of something like a transistor amplifier, the current in the divider is typically set to be at least 10X of the base current required by the transistor (which is determined by it's current gain).

If you were to use a divider for a single IC, you would need the current in the divider to be 10X the worst case supply current spec for that IC. As you can see, this is not optimal because with more current draw more power needs to be consumed by the divider.
how do I know if I should use a capacitor in front of an IC to prevent voltage/current variation that would damage it?
I assume you mean power supply decoupling. If, for example, you were trying to protect CMOS inputs, you'd use an appropriate series resistance. Large enough to prevent the input protection diode (assuming it had one) from being forward biased sufficiently to cause damage; but low enough to not have a significant affect on timing.
Is this the kind of info that's available on data sheet of a product?
Sometimes decoupling cap requirements are stated explicitly in the datasheet and sometimes they aren't. Sometimes the rules of thumb are overly conservative and experience will tell you when you can fudge on them. But fudging on them can create some very difficult to debug problems...

Last edited:

#### nfuids

Joined Sep 11, 2015
9
Ok, but assuming I want a microcontroller that I will program to read sensor's input and turn some stuff ON/OFF depending on the acquired data, where should I start?

#### dl324

Joined Mar 30, 2015
15,511
Ok, but assuming I want a microcontroller that I will program to read sensor's input and turn some stuff ON/OFF depending on the acquired data, where should I start?
I'd start by posting a block diagram or schematic of your circuit and asking a specific question.

#### nfuids

Joined Sep 11, 2015
9
Ok, let's make this really simple.
I want to get a chip like the PIC18F8722 (an electronics wizard recommended it to me for my project).

So to start off really simple, I'd like to connect a temperature prob to it and display the temperature on a LED display.

Since the temperature prob send analog signal, I need to connect it to a ADC pin of the chip. What I don't understand just yet, is how do I determine what's going in between the two? I'm assuming I just can't put a wire between the probe/chip. How do I come up with the proper stuff (resistors, capacitors, diodes, etc) that should go in between?

The same apply to the LED display, I guess the controller will communicate with the LED display using serial communication (I should chose one of the main serial communication protocol like SPI or I2C).. but once my program has the data and send it to the serial port, what should be between the actual serial PIN and the LED display? I mean I don't want anyone to tell me exactly what's required, I want to understand how to determine it.

That's what I don't quite get, once you understand the basics of electronics (resistors, capacitors, etc, voltage divider, current divider and much more), how do you determine what to use and when?

#### nfuids

Joined Sep 11, 2015
9
I'd start by posting a block diagram or schematic of your circuit and asking a specific question.
What software do you recommend for that? AutoCAD or is there anything simpler that would do the job to start with?

#### dl324

Joined Mar 30, 2015
15,511
I want to get a chip like the PIC18F8722 [snip] I'd like to connect a temperature prob to it and display the temperature on a LED display.

Since the temperature prob send analog signal, I need to connect it to a ADC pin of the chip. What I don't understand just yet, is how do I determine what's going in between the two?
You start by checking the allowed voltage range for the ADC pin and it's input impedance (so you don't load your probe signal). If the output voltage of the probe is within the range allowed by the ADC input, you don't need to worry about dividing voltage or limiting current. If the input impedance of the ADC pin is sufficiently high (which it probably will be), you don't need to worry about loading the voltage from the temperature sensor. If the probe needed to drive a low impedance load, you could use an opamp voltage follower which has a high input impedance and a low output impedance.
The same apply to the LED display, I guess the controller will communicate with the LED display using serial communication (I should chose one of the main serial communication protocol like SPI or I2C)..
Most LED displays will require parallel data. If you use a serial protocol, you'll need to include a serial to parallel conversion.
but once my program has the data and send it to the serial port, what should be between the actual serial PIN and the LED display?
An LED can be driven from a voltage source with a series current limiting resistor, or from a current source which doesn't require a limiting resistor. For single LED applications with a regulated supply, a series limiting resistor is preferred because it reduces cost and complexity with few concessions.

#### crutschow

Joined Mar 14, 2008
31,581
If you are going to use a microprocessor for control I recommend starting with one that can be programmed in the Basic language which uses English words for commands. I consider it much easier to learn then the more common (but with an arcane syntax) C.

I have used a Basic Stamp module board from Parallax and they are quite easy to use and program. They have many accessories that can be used with the module such as keypads, sensors, and displays.

#### dl324

Joined Mar 30, 2015
15,511
What software do you recommend for that? AutoCAD or is there anything simpler that would do the job to start with?
I use the freeware version of Eagle.

#### WBahn

Joined Mar 31, 2012
28,192
I would recommend taking a few steps back and starting from the very simple and working your way up to the level you need for your home automation goal.

The "Hello World!" of the microcontroller world is to write a program that makes a single LED blink. Just doing that accomplishes a whole host of things. It gets you to learn about LEDs and current limiting resistors, it gets you to the point where you can write, compile, download, and execute a program in the microcontroller. I would start with a development board for the microcontroller you want to use so that you don't have to deal with everything (the circuitry) that it takes to bring the microcontroller to life and talk to it and interface to it.

Now learn how to connect some simple switches to the micro and have them turn the LED on and off. This will introduce you to the wonderful world of switch debouncing.

Once you've got that, then tackle the display side of things. Pick a display (the simpler the better) and learn how to have your code display what you want it to. Start with just having it display a countdown timer that simply rolls over and starts again when it reaches zero.

Once you are comfortable getting the display to do what you want, then you can start tackling the ADC side of the house. First set up a simple circuit with a pot and write a program that displays the voltage and updates it as you turn the pot knob.

Next tackle the output side. Do this in two steps. First use LEDs as your output device and get it so that they turn on and off in the same way that you want your heating elements and such to turn on and off. Then worry about the interface circuitry you need to go from a logic level signal to whatever it will take to actually turn your heating elements on and off (or whatever else you want).

Do NOT try to tackle it all at once!

#### nfuids

Joined Sep 11, 2015
9
Sounds like a plan. At the very end, will I still use a dev board or create my "own" circuit?

I ordered a bread board and accessories like resistors, capacitors, wires, leds and stuff like that.

I need to buy a microcontroller/dev board.. Any recommendation?

#### ISB123

Joined May 21, 2014
1,236
ATMega328P and Arduino, they have plenty of resources since Arduino became popular. Arduino can be used as ISP programmer so you don't have to write code in Arduino only, you can programmer other MCU's with it.

#### nfuids

Joined Sep 11, 2015
9
Any specific adruino model? I see thare are plenty!

#### djsfantasi

Joined Apr 11, 2010
8,792

#### nfuids

Joined Sep 11, 2015
9
I have no prior soldering experience except the ones i did back then at school 15+ years back!

Any recommendation on that as well, from amazon maybe?

#### ISB123

Joined May 21, 2014
1,236
Well if you are just going to be hobbyist get a soldering iron rated at 30W-45W later get a decent quality station.

This one should be fine for a beginner.
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_116572_-1

The goal is to solder the connection in shortest time possible to prevent damage to the components,weak soldering irons cant do that so they are more prone to cause damage.

Watch this video series: