Shop OBEX P1 Docs P2 Docs Learn Events
Library of basic circuits with the propeller? — Parallax Forums

Library of basic circuits with the propeller?

GeeksGoneBadGeeksGoneBad Posts: 100
edited 2012-10-26 10:42 in Propeller 1
Is there anywhere a basic library of circuits? What I would like to see is a listing of a bunch of basic circuits you'd make with the propeller and the code needed to make them work

like

1. Propeller driving an LED (simple yes I know but you have to start somewhere)
2. Propeller driving a transistor (then maybe expand on the super basic to then drive something with the transistor?)
3. Propeller driving a Mosfet
4. Propeller driving a Relay
5. PIR Sesor circuit
6. Ping circuit

etc... Seems that anytime I go searching in the forums #1 I get a bunch of schematics but they are incorrect or are argued over - so there's a log of garbage to weed through - same with the object exchange - every time I've searched the results are either not basic enough or just can't find what I need or just wrong - like when I post up my "hey does this circuit look right for so and so" well that circuit comes up when I search and it's just plain wrong - so I have to read entire pages of threads to try and get to an answer - that I think should be as a library somewhere :)

If this doesn't already exist outside of these forums then I think i will create it - even if it's just for me :)

Thanks
Jamie
«1

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-10-23 06:21
    I find http://learn.parallax.com/ really helpful for sample circuits and code to drive them. It has examples for Arduino, BS2, and the Propeller chip.The stuff for the Propeller BOE, Robitics with Propeller BOE, and the kick starts sections should help.
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-23 06:31
    I've seen that site - was great when i was playing with a servo - but there seems to only be stuff on there that are products in the store, like the tilt sensor and PIR - which is great, but where's the optoisolator circuit and transistor circuit, etc... seems incomplete and more of a support for products bought in the store? (again I think it's great but it's missing some things for me)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 06:37
    Frankly, I think someone should just write a 'cookbook' of this for all +5 and +3.3 output micro-controllers.

    Everybody is doing something, but rather piecemeal via websites. For instance, there are various transistor solutions from 2n3906, to 2n2222, to TIP120. All work, but each has a best fit for a project. It would not hurt to explain a little about how much power you really need and at what voltage. (So many users think that a transistor fed by +5V will actually deliver +5 volts..... not enough education in all those quickie HOWTOs.)

    Why a book? While I am sure many of us will just go to http://learn.parallax.com/ for an answer, "THE Shopper" that is new to micro-controllers is more likely to buy a Propeller board if there is a good informative reference text available at the same time. Books knock down the rationale that something is going to be too complicated. Websites can't really reach the retail shopper at the moment they are really trying to decide yes or no.

    And of course there are those of us that like to read books - just because there are no batteries to recharge or replace. (or can't get the laptop away from other family members.)

    I have one good book like this, but it is all in Chinese and for a competing product that shall not be named. I am pretty sure that the fact that it is comprehensive and sold in regular bookstores without the product is creating demand for their product anyway. Still, it is useful to me as I can read the schematics, and it is kind of interesting to see how they program C in Chinese.

    Someone out there can be the next Forest Mims.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-10-23 06:51
    which is great, but where's the optoisolator circuit and transistor circuit, etc

    Driving things like an NPN transistor is no different with a 3.3 volt propeller versus the BS2 or Arduino. The 3.3 volts is high enough to activate most transistors. For other circuits (e.g. driving an LED) the thing to consider is adjusting the current limit resistor using Ohm's law V = IR. Suppose I'm driving an LED on the BS2 using a 330 ohm resistor.

    5 = I * 330
    I = 0.015 or 15 mA.

    So 3.3 = 0.015 * R, yields a new resistance of 217 ohms. So where I see 330 ohms I replace them with 220 ohms and move on.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-10-23 06:54
    Someone out there can be the next Forest Mims.
    Ah, Don Lancaster wrote the "CookBook"s.

    Duane J
  • Martin_HMartin_H Posts: 4,051
    edited 2012-10-23 07:08
    As an aside, if my entire circuit is 3.3 volts I'm gold. Where I inevitably stumble is when I need to introduce a 5 volt device into the mix. If the Propeller's pin is in output mode I usually pretend the device is a 3.3 volt device and it works fine. If the Propeller's pin is in input mode I introduce a current limit resistor or voltage divider. But where I really stumble is a device that is bidirectional on a single pin. I usually yelp for help on this forum and either Duane, Mike G, or Phil bails me out.
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-23 07:17
    I appreciate the help Martin :) and that's kinda what I'm looking to do is find a way to collect all that knowledge from those guys into one place that's easily searchable (which is why I don't "vote" for a physical book) and doesn't have all the off topic posts and garbage to weed through :) Even this thread that's now only 8 posts long has off topic posts LOL
  • max72max72 Posts: 1,155
    edited 2012-10-23 08:29
    There is also the propeller page on wikispaces.
    http://propeller.wikispaces.com/
    You can also integrate an existing page or create a new one.
    I usually refer to it and there is a lot of stuff.
    Massimo
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 08:53
    Ah, Don Lancaster wrote the "CookBook"s.

    Duane J

    Once again, OMG. I never get anything right.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-10-23 08:54
    Duane,

    "Ah, Don Lancaster wrote the "CookBook"s." ... for the record, I personally sent Don Lancaster a Propeller Demo board a few years ago.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 09:03
    Martin_H wrote: »
    As an aside, if my entire circuit is 3.3 volts I'm gold. Where I inevitably stumble is when I need to introduce a 5 volt device into the mix. If the Propeller's pin is in output mode I usually pretend the device is a 3.3 volt device and it works fine. If the Propeller's pin is in input mode I introduce a current limit resistor or voltage divider. But where I really stumble is a device that is bidirectional on a single pin. I usually yelp for help on this forum and either Duane, Mike G, or Phil bails me out.

    The bidirectional solution is a simple MOSfet with a few resistors. While it works great, someone like Siemens has patented it - so some are not willing to discuss it.

    5V to Propeller, use a 3.3K resistior ( I previously mentioned a 1K and was told No, No, No!).
    Going out of a Propeller is often easier as 3.3 volts often works fine with 5 volt logic.

    What is driving me crazy is that nobody seems to be aware of the fact that transistors have at least 0.6-0.7 volts of drop when placed in a circuit. And often this increases to 1.0 or more volts if the transistor is driving at saturation with a high load for it. That means that one cannot power all and everything from 3.3v and 5.0v - at times one need a higher voltage in order to get the right voltage with adequate current. But people tend to want to avoid multiple voltage power supplies and just run everything off of one voltage.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-10-23 09:47
    Loopy Byteloose,

    "The bidirectional solution is a simple MOSfet with a few resistors. While it works great, someone like Siemens has patented it - so some are not willing to discuss it. " - I protest the patent on this... it's nothing more than a common gate amplifier, that has been renamed 'bidirectional level shifter'

    Compare the two circuits if you wish ... low voltage on one side higher voltage on the other... an amplifier.

    Reference Common Gate amplifier:
    http://en.wikipedia.org/wiki/Common_gate

    Reference Bi-Directional level shifter:
    http://ics.nxp.com/support/documents/interface/pdf/an97055.pdf
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-23 10:52
    I think we all might protest the patent, but Siemens or whomever has the deep pockets to make many suffer significant hardship over their claim.

    BTW, would you like to write an intelligent informative book of basic Propeller circuits? I'd actually do it if I was able to, but I can't work with a keyboard intensively for any period of time (nerve injury in the neck).

    Students and newcomers just don't get the importance of the math side of things or that Power, not not Volts has to be properly scaled. I suspect everyone is using their voltmeter, but no one dares to use the ampmeter in thier multimeter. After all, that has a fuse they might blow.
  • Invent-O-DocInvent-O-Doc Posts: 768
    edited 2012-10-23 10:53
    I strongly recommend Matt Gilliland's "Microcontroller Applications Cookbook" - it is microcontroller agnostic with simple code examples from basic stamp 2, but has the quick and dirty on how to do all the things you ask and more. These things are easy to code on the propeller, but there is a BS2 propeller library just in case.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2012-10-23 11:01
    "I think we all might protest the patent, but Siemens or whomever has the deep pockets to make many suffer significant hardship over their claim." - I have a 1965 print book that has essentially the same circuit using tubes... other than voltage and a bulk diode, tubes are not that much different than FETs. .... anyway your right, deeper pockets, but if they are looking for a citation that predates the current patent claim, I have one.

    "BTW, would you like to write an intelligent informative book of basic Propeller circuits?" - Time and resource are my enemies at the moment or else I would love to, I've been wanting to do something like this for years. It will happen some day, just not now. If I were to put something together it would follow something more along the lines of "101 projects you can build with a Propeller"
  • GeeksGoneBadGeeksGoneBad Posts: 100
    edited 2012-10-23 11:15
    Hey Beau I just bought two of your motors! :)

    Well I think I am going to start collecting some notes and basic circuits into one place - just really for my own benefit, but I will share with everybody - I really want something on the web - searchable... I've come across tons of circuits in books and then when it comes time to need them I can't find them again LOL

    Going to put them here http://www.backyardworkshop.com/reference-material.html if anyone cares :) LOL

    Jamie
  • AribaAriba Posts: 2,690
    edited 2012-10-23 11:30
    ....
    What is driving me crazy is that nobody seems to be aware of the fact that transistors have at least 0.6-0.7 volts of drop when placed in a circuit. And often this increases to 1.0 or more volts if the transistor is driving at saturation with a high load for it. That means that one cannot power all and everything from 3.3v and 5.0v - at times one need a higher voltage in order to get the right voltage with adequate current. But people tend to want to avoid multiple voltage power supplies and just run everything off of one voltage.

    I think you are driven crazy for no avail ;-)

    There are several ways you can use a transistor. What you describe is only true for an emitter follower configuration, which is normally not used to drive loads from an IO pin.
    The normal circuit is to connect the load at the Collector, and use the transistor as a switch. In this configuration the saturation voltage between Collector and Emitter is around 0.1 Volt (depnding on the transistor and the base current).

    attachment.php?attachmentid=96474&d=1351016989
    Andy
    371 x 147 - 1K
  • Martin_HMartin_H Posts: 4,051
    edited 2012-10-23 12:16
    Ariba, thanks for the explanation. I've seen both configurations and never knew the advantage of one over the other.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-10-23 17:32
    Hi Beau;
    "I think we all might protest the patent, but Siemens or whomever has the deep pockets to make many suffer significant hardship over their claim." - I have a 1965 print book that has essentially the same circuit using tubes... other than voltage and a bulk diode, tubes are not that much different than FETs. .... anyway your right, deeper pockets, but if they are looking for a citation that predates the current patent claim, I have one.
    The Phillips patent is US5689196 filed in December, 1995. So this patent will expire in December, 2015. Only 3 years away.
    BTW, discussion of patents can't be restricted since the patent publicly discloses the idea to all.

    In reading this patent it appears they are describing the circuit with only Enhancement Mode MOSFETs. Generally, the gate is connected to +3.3V.

    However, if Depletion Mode MOSFETs are used the gate can be connected to ground instead of 3.3V. I tried this and it works just fine.

    Since the patent doesn't describe this basic method I suspect I2C level shifters using Depletion Mode MOSFETs is free to use.

    Duane J
  • doggiedocdoggiedoc Posts: 2,243
    edited 2012-10-23 17:41
    Jamie,

    I have extra copies of both of Matt Gilliland's books and will gladly mail you the extras as a gift. Just PM me with your mailing address and I'll give them to you.

    Parallax and the members of this forum have been very generous to me so I'd like to pay it forward. These books are oriented to the BS2 but the concepts apply just fine.

    Paul
  • RforbesRforbes Posts: 281
    edited 2012-10-23 17:48
    I have to say, I'm really geeking out with "Practical Electronics for Inventors" by Paul Scherz. There is a sh@t load of good old fashioned techie speak, and almost as much written via basic analogies for conceptual purposes. At 40 bucks US, it's well worth it if you're not as knowledgeable as you'd like to be with regards to all things electronic.

    The only thing I don't like about this book is- when I read it, my wife looks at me and sighs, and shrugs her shoulders, and asks (someone unseen) "Why me?" ... then she calls me a dork and goes off to watch Housewives of wherever.

    BUT- she watches it in another room where I can't hear it, so I WIN! :)

    Robert
  • idbruceidbruce Posts: 6,197
    edited 2012-10-23 19:35
    @GeeksGoneBad

    I agree that it would be nice to have a categorized collection of circuits ready for Propeller use.

    @Duane C. Johnson
    BTW, discussion of patents can't be restricted since the patent publicly discloses the idea to all.

    Patents are more open then just discussion. Patents cannot be copyrighted, therefore you can print, reprint, distribute, and sell the written documentation. The patent just offers protection from infringement of someone making or using the patented item without a license.

    Check ebay, they sell all kinds of patent copies.
  • Mark_TMark_T Posts: 1,981
    edited 2012-10-24 04:00
    What is driving me crazy is that nobody seems to be aware of the fact that transistors have at least 0.6-0.7 volts of drop when placed in a circuit. And often this increases to 1.0 or more volts if the transistor is driving at saturation with a high load for it. That means that one cannot power all and everything from 3.3v and 5.0v - at times one need a higher voltage in order to get the right voltage with adequate current. But people tend to want to avoid multiple voltage power supplies and just run everything off of one voltage.

    I think the problem is more specific than that - people often quote part numbers that are literally 40 years out of date - modern superbeta transistors have Vsats in the 0.05 to 0.2V range for reasonable current levels, and far superior current gains at high current. If switching upto 2A there's no need for Darlingtons or MOSFETs for instance, a ZTX851 has Vsat of 0.15V at 2A - blows the 2N2222 out of the water (at a price of course). Of course a lot of superbetas are SMT only which makes it tricky. A superbeta replacement for the ULN 2803 would be nice to have ;)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-24 08:03
    Mark_T wrote: »
    I think the problem is more specific than that - people often quote part numbers that are literally 40 years out of date - modern superbeta transistors have Vsats in the 0.05 to 0.2V range for reasonable current levels, and far superior current gains at high current. If switching upto 2A there's no need for Darlingtons or MOSFETs for instance, a ZTX851 has Vsat of 0.15V at 2A - blows the 2N2222 out of the water (at a price of course). Of course a lot of superbetas are SMT only which makes it tricky. A superbeta replacement for the ULN 2803 would be nice to have ;)

    Yes it is an awkward juncture for electronics as a hobby. The 2n2222 is easy for me to purchase over-the-counter in Taiwan and likely around the world, while the ZTX851 might really be a pleasure to use. People in the USA and Europe and maybe Japan can find it easy to buy modern parts - but most of the world is retailing older stocks. Getting free samples can result in having to pay quite a bit in shipping.

    Of course, if beginners used super-betas, they might be even more ignorant of what is required for a good circuit as the devices would be even more forgiving of ignoring the details.

    Added is the problem that surface mounts require a very different approach to assembly.

    When all of these factors are combined, it is really difficult to write educational material that is up-to-date and allows the reader to build from scratch.

    So I suppose that the real solution is a series of 'educational shields' that can be adapted to any of a variety of micro-controllers. I already do something like this by building cables as adapters between boards rather than depend on stacking for extending.

    Regarding books.
    I guess I just miss the halcyon days of the annual ARRL Handbooks.
  • BrowserBrowser Posts: 84
    edited 2012-10-24 10:43
    i haz the bookz u need. latest fresh stok includz
    programming the intel 4004
    12au7 amplifier designs
    your sliderule and you
    rtl logic handbook
    experiments with the 2n107

    come on down. free shrimpz evry satterday.

    attachment.php?attachmentid=96497&d=1351100417

    -browz
    778 x 566 - 94K
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-10-24 15:51
    Just an fyi, before relying on "Practical Electronics for Inventors" you need to be aware of the errata.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-10-24 16:06
    Sorry Siemens, I should have mentioned Phillips. Are these both Dutch firms or is Siemens German. Old age must be setting in as I cannot seem to keep Norway, Sweden, and Finland straight.... and now Siemens versus Phillips.

    Only 3 more years until expiration! If we all wait about 36 years, just about everything now under patent will be in the public domain. Of course, I will be about 101 years old, but what the heck.

    I think I will rely on the 'urban myth' that anyone can copy a patent one time for personal use. Or better yet, I can do this because I am just one tiny fish in a very large ocean. Maybe we should start an NGO to defend patents. that should be in the public domain, but are being claimed by big companies anyway.

    I miss my slide rule and always wanted a circular one, but the world has gone to spreadsheets for number crunching.

    If you really want to look around for books, why not try your local public library. They used to be pretty good.
  • kwinnkwinn Posts: 8,697
    edited 2012-10-24 17:27
    Sorry Siemens, I should have mentioned Phillips. Are these both Dutch firms or is Siemens German. ......

    I miss my slide rule and always wanted a circular one, but the world has gone to spreadsheets for number crunching.

    If you really want to look around for books, why not try your local public library. They used to be pretty good.
    .

    Siemens is German.

    I saw a straight slide rule a few days ago. Interested? Shall I keep my eyes open for a round one?

    Don,t know what libraries are like where you are but here there are quite a few computers and nowhere near as many books on the shelf as there used to be.
  • frank freedmanfrank freedman Posts: 1,983
    edited 2012-10-24 17:57
    Actually, Siemens is German. Trivia aside, while a good few examples are a good start, nothing can substitute for basic knowledge. That goes for most fields more so for the technical things. If you rely on examples, you will find yourself very limited in what you can do. If you learn how to design it yourself, limits start falling away. Some things take longer than others. Find good text books used to learn from. Half-price books in Dallas excellent, Browsers books ??? But definately be wary of the free shrimpz........



    Edit: one of my latest finds in a goodwill store was "Introductory Electronic Devices and Circuits" by Robert Paynter. C 1989/91 Older, but the title understates the amount of material presented. Something I have not seen in other books, each section goes into troubleshooting the circuits presented.
  • 4x5n4x5n Posts: 745
    edited 2012-10-24 20:16
    Ah, Don Lancaster wrote the "CookBook"s.

    Duane J

    I have a couple of the Don Lancaster "cookbook" books. My favorite was the TTL cookbook. Don't remember how many times I read it cover to cover!!
Sign In or Register to comment.