Arduino vs raw chips

50 views
Skip to first unread message

Simon Quellen Field

unread,
Mar 24, 2015, 7:40:24 PM3/24/15
to diybio
I have changed the subject line because this discussion is no longer about an Arduino-based thermocycler.

I normally avoid the "my chip is better than yours" type of food fights, but here we have several people I admire and respect weighing in on different sides with strong opinions, but without clearly stating what their preferred alternatives are. This makes it difficult to understand the strongly held beliefs.

Having built hundreds of microprocessor based systems since the early 1970's, and making a living designing and building compilers for some 30 years, I am definitely in the EE camp when it comes to soldering up prototypes (despite being educated as a biochemist). But I still can't see why the vitriol against Arduino has surfaced, and that has not been explained well. Analogies with Legos don't actually explain anything.

When someone mentioned Java and Arduino in the same sentence, it was apparent they had not played with an Arduino in a while. It is programmed in C++. There is a hidden main() routine in the library, which does two things: it calls the setup() routine, then calls the loop() routine in a while loop. Other than that, it is plain C++, which happens to be my favorite programming language (stating my biases here).

The original poster was new to electronics. For that person, the Arduino is ideal. Telling them to roll their own design out of bare chips, design and etch their own printed circuit boards, and understand how the timers on the chip are programmed is really just telling them to give up. I don't think that is what anyone was suggesting, but no one actually gave an alternative to the Arduino in their arguments.

The Arduino has several things going for it:
  • The one I would recommend is cheap. I buy them 20 at a time to hand out to my Electronics For Artists and Solar Powered Art students, who (like the original poster) have no prior experience with electronics. They have USB, a reset button, four LEDs, 2 voltage regulators, and 22 available IO pins, all for $2.54 (shipping is free). And they are tiny -- the whole board is less than an inch and three quarters long, and less than three quarters of an inch wide. Embedding that in a design is cheaper than building a USB interface to your raw chip, and I can't see any advantage in building your own PC board instead of using this little guy.
  • You don't need a programming device.
  • You can re-program the chip in the finished product.
  • You can debug the device using USB.
  • You can have it send out clear error messages via USB.
  • You can power it using any cheap cell-phone charger, or use batteries (the voltage regulators are already there).
  • It is real-time. Devices based on Linux can't do real time measurements and control. Python has to disable the garbage collector to do real-time, and there aren't many Python programmers who know how to code without the garbage collector.
  • There are large libraries of debugged code for interfacing to all kinds of sensors and actuators.
Against that, there is the promise of an alternative that has "a more stable build", "a better kit", "a solid kit", "more professional building blocks" that require "a little bit of homework". But no examples, other than to rule out the PIC.

What is the recommended alternative? 

-----
Get a free science project every week! "http://scitoys.com/newsletter.html"


On Tue, Mar 24, 2015 at 10:29 AM, Jonathan Cline <jcl...@ieee.org> wrote:
Hmmmmmmmm

"wastes days of their time " ..  starting out with the equivalent of Legos might create a fast model prototype but then wastes more time when moving from prototype to a more stable build.  Requires rebuilding from scratch.  Think longer term.  Most likely any kit board is a tool which will be reused in a new project later which then runs into the typical obstacles and has to be replaced with a better kit, creating an upgrade cycle which wastes time.   Start out with a solid kit first.

"the community is smaller " .. in fact the Arduino community is a drop in the bucket, though a vocal and photo-polished one, compared to the larger design communities using more professional building blocks.  Note "professional design" does not mean complex it only means a little bit of homework is necessary and maybe less glossy photo's.

"less and more reasonable code" .. the code is in a high level language so it is likely the same.   "copy/paste some ubiquitous code" ..  If it is ubiquitous then there is nothing specific tying it to Arduino anyway.

It is not necessary to defend your use of Arduino in past projects.  Arduino is simply not a good recommendation in 2015 for new designs or redesigns.  If you're building an automobile today you don't need to use an engine with a hand crank.  When you designed the DremelFuge you considered the design options and settled on an industrialized component with suitable motor, a Dremel.  You might have evaluated shiny plastic objects from Toys R Us like a kiddie toy blender but you smartly passed on these as underpowered.  Just a little bit of homework up front gives the design significant legs.

I didn't suggest anything about PIC in this thread either so there is no need to compare.  If you would really like, you can review past opinion from the 90s on PIClist regarding why college students or more advanced younger dudes should not start or continue projects with the Basic Stamp (PIC based) - for same reasons as above:  more expensive, typically under-powered so rapidly outgrown, technology likely later to cause frustration, though great for high school students and younger, and also not recommended as the basis for solid designs (i.e.: things which aspire to be more than toys).


## Jonathan Cline
## jcl...@ieee.org
## Mobile: +1-805-617-0223
########################

On 3/24/15 3:30 AM, Cathal Garvey wrote:
That's all well and good, but putting together a thermal cycler with an Arduino requires no shields, less and more reasonable code, and no additional equipment (programmers, etcetera) over and above the Arduino and USB. It requires an AC solid state relay, LM35 sensor, a heat gun and a computer cooling fan.

Telling people to use PICs because they'll save €5 on the cost of the chip, even if it wastes days of their time because the community is smaller and more techie and purist, is a bit useless. People want to get stuff done, and people are rarely without the €5 needed to grab an arduino, copy/paste some ubiquitous code, and get stuff done.

On 24/03/15 10:05, Jonathan Cline wrote:
It is several x more expensive as a building block, similar to the Lego
analogy -- and always needs to add more pieces.  It is not for real
("college undergrad level") projects.   The household name comes from
the marketing push and the plethora of required 3rd party pieces --
which makes money for those other companies (including the kit
suppliers, like Ada), who also do more marketing, and so on. The
lameness of Arduino needing shields which boost business for kit
suppliers and make it a well-known product placement in catalogs is no
justification for using it in an engineering design.  "There's a reason
xx is a household name" could apply to many xx's which are similarly
worse choices.  Unfortunately the projects built with Arduino are also
falsely labelled "diy low cost" when in fact they are not at all low
cost in comparison and others are also led astray.  When a lot of script
kiddies talk volumes about a technology, it does not mean the technology
is beneficial.  A lot of the talk is simply confusion or from lack of
education.  Technology which works does not get as much verbiage in
comparison precisely because it "just works" once the initial learning
curve is overcome.

The software application which allows cutting & pasting the code you
mention into your projects likely works on any number of better hardware
kits since it is in a high level language.

So I repeat my recommendation and have improved it slightly --

Requirement #1:
   * Sell the Arduino on ebay.

## Jonathan Cline
## jcl...@ieee.org
## Mobile: +1-805-617-0223
########################

On 3/24/15 1:17 AM, Cathal Garvey wrote:
Arduino is fine and highly productive for beginners compared to PIC
whatevers. There's a reason Arduino is a household name and
PIC-number-number-number-number is not.

I've built functioning thermal cyclers on Arduinos without issue, and
with easily reasonable code (although I was using a pre-written
finite-state-machine library, the availability of which is just more
reason to use a widely used platform like Arduino).

On 24/03/15 02:38, Jonathan Cline wrote:
Requirement #1:
  * Throw away the Arduino.


I am going to add to the FAQ:
"Do not use Arduino for real projects.  It is like building an
automobile out of Legos and then expecting to actually drive it."


Also, fyi to Nathan.  LM339 is a comparator not an opamp so it is not a
good signal buffer.  Use an opamp.  See my article in Biocoder #6.


## Jonathan Cline
## jcl...@ieee.org
## Mobile: +1-805-617-0223
########################


On Wednesday, February 25, 2015 at 4:49:50 AM UTC-8, Andy Morgan wrote:



    So, I've slightly redesigned the Arduino PCR thermal cycler
(http://www.instructables.com/id/Arduino-PCR-thermal-cycler-for-under-85/?ALLSTEPS

<http://www.instructables.com/id/Arduino-PCR-thermal-cycler-for-under-85/?ALLSTEPS>)

    to make it a bit better, by replacing the two wiremound resistors
    (100watts) with a cartridge heater (300watts)
(http://www.ebay.com.au/itm/Cartridge-Heater-3-8-Diameter-3-2-Length-220VAC-300W-/380898256650?pt=AU_B_I_Electrical_Test_Equipment&hash=item58af4e270a

<http://www.ebay.com.au/itm/Cartridge-Heater-3-8-Diameter-3-2-Length-220VAC-300W-/380898256650?pt=AU_B_I_Electrical_Test_Equipment&hash=item58af4e270a>).



    But the thing is: I have ZERO experience with electronics, and I
    don't know whether the cartridge heater will require too much power
    from the Arduino board or power supply, and all the explanations
    I've found on the internet seem to go WAY over my head.

    Does anybody know whether the cartridge heater will work?

    Any help would be greatly appreciated.



--
-- You received this message because you are subscribed to the Google Groups DIYbio group. To post to this group, send email to diy...@googlegroups.com. To unsubscribe from this group, send email to diybio+unsubscribe@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/diybio?hl=en
Learn more at www.diybio.org
--- You received this message because you are subscribed to the Google Groups "DIYbio" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diybio+unsubscribe@googlegroups.com.
To post to this group, send email to diy...@googlegroups.com.
Visit this group at http://groups.google.com/group/diybio.
To view this discussion on the web visit https://groups.google.com/d/msgid/diybio/55119F04.6040807%40ieee.org.

For more options, visit https://groups.google.com/d/optout.

Cathal Garvey

unread,
Mar 24, 2015, 8:00:31 PM3/24/15
to diy...@googlegroups.com
I wasn't even aware you *could* code Python without the GC. :)

I also wasn't aware that Arduino was C++, I thought it was just C with
some fluffy framework stuff added, that's an interesting tidbit.

Pity there aren't any chips running Lua out there; nice middle-ground
between slower/bigger Python (as much as I love it, it's a Big Hammer)
and C, and you could actually imagine Lua on a sub-32-bit chip. Still
garbage-collected of course..
> * The one I would recommend is cheap
> <http://www.aliexpress.com/item/Freeshipping-1pcs-lot-Nano-3-0-controller-compatible-for-arduino-nano-CH340-USB-driver-NO-CABLE/32263477572.html>.
> I buy them 20 at a time to hand out to my /Electronics For Artists
> <http://www.amazon.com/Electronics-Artists-Adding-Motion-Artwork/dp/1613730144>/
> and /Solar Powered Art <http://artists.sci-toys.com>/ students, who
> (like the original poster) have no prior experience with
> electronics. They have USB, a reset button, four LEDs, 2 voltage
> regulators, and 22 available IO pins, all for *$2.54* (shipping is
> free). And they are tiny -- the whole board is less than an inch and
> three quarters long, and less than three quarters of an inch wide.
> Embedding that in a design is cheaper than building a USB interface
> to your raw chip, and I can't see any advantage in building your own
> PC board instead of using this little guy.
> * You don't need a programming device.
> * You can re-program the chip in the finished product.
> * You can debug the device using USB.
> * You can have it send out clear error messages via USB.
> * You can power it using any cheap cell-phone charger, or use
> batteries (the voltage regulators are already there).
> * It is real-time. Devices based on Linux can't do real time
> measurements and control. Python has to disable the garbage
> collector to do real-time, and there aren't many Python programmers
> who know how to code without the garbage collector.
> * There are large libraries of debugged code for interfacing to all
> ## jcl...@ieee.org <mailto:jcl...@ieee.org>
> ## Mobile: +1-805-617-0223 <tel:%2B1-805-617-0223>
> ## jcl...@ieee.org <mailto:jcl...@ieee.org>
> ## Mobile: +1-805-617-0223 <tel:%2B1-805-617-0223>
> ########################
>
> On 3/24/15 1:17 AM, Cathal Garvey wrote:
>
> Arduino is fine and highly productive for beginners
> compared to PIC
> whatevers. There's a reason Arduino is a household name and
> PIC-number-number-number-__number is not.
>
> I've built functioning thermal cyclers on Arduinos
> without issue, and
> with easily reasonable code (although I was using a
> pre-written
> finite-state-machine library, the availability of which
> is just more
> reason to use a widely used platform like Arduino).
>
> On 24/03/15 02:38, Jonathan Cline wrote:
>
> Requirement #1:
> * Throw away the Arduino.
>
>
> I am going to add to the FAQ:
> "Do not use Arduino for real projects. It is like
> building an
> automobile out of Legos and then expecting to
> actually drive it."
>
>
> Also, fyi to Nathan. LM339 is a comparator not an
> opamp so it is not a
> good signal buffer. Use an opamp. See my article
> in Biocoder #6.
>
>
> ## Jonathan Cline
> ## jcl...@ieee.org <mailto:jcl...@ieee.org>
> ## Mobile: +1-805-617-0223 <tel:%2B1-805-617-0223>
> ########################
>
>
> On Wednesday, February 25, 2015 at 4:49:50 AM UTC-8,
> Andy Morgan wrote:
>
>
>
> So, I've slightly redesigned the Arduino PCR
> thermal cycler
> (http://www.instructables.com/__id/Arduino-PCR-thermal-cycler-__for-under-85/?ALLSTEPS
> <http://www.instructables.com/id/Arduino-PCR-thermal-cycler-for-under-85/?ALLSTEPS>
>
>
> <http://www.instructables.com/__id/Arduino-PCR-thermal-cycler-__for-under-85/?ALLSTEPS
> <http://www.instructables.com/id/Arduino-PCR-thermal-cycler-for-under-85/?ALLSTEPS>>)
>
>
> to make it a bit better, by replacing the two
> wiremound resistors
> (100watts) with a cartridge heater (300watts)
> (http://www.ebay.com.au/itm/__Cartridge-Heater-3-8-Diameter-__3-2-Length-220VAC-300W-/__380898256650?pt=AU_B_I___Electrical_Test_Equipment&__hash=item58af4e270a
> <http://www.ebay.com.au/itm/Cartridge-Heater-3-8-Diameter-3-2-Length-220VAC-300W-/380898256650?pt=AU_B_I_Electrical_Test_Equipment&hash=item58af4e270a>
>
>
> <http://www.ebay.com.au/itm/__Cartridge-Heater-3-8-Diameter-__3-2-Length-220VAC-300W-/__380898256650?pt=AU_B_I___Electrical_Test_Equipment&__hash=item58af4e270a
> <http://www.ebay.com.au/itm/Cartridge-Heater-3-8-Diameter-3-2-Length-220VAC-300W-/380898256650?pt=AU_B_I_Electrical_Test_Equipment&hash=item58af4e270a>>).
>
>
>
>
> But the thing is: I have ZERO experience with
> electronics, and I
> don't know whether the cartridge heater will
> require too much power
> from the Arduino board or power supply, and all
> the explanations
> I've found on the internet seem to go WAY over
> my head.
>
> Does anybody know whether the cartridge heater
> will work?
>
> Any help would be greatly appreciated.
>
>
>
>
> --
> -- You received this message because you are subscribed to the
> Google Groups DIYbio group. To post to this group, send email to
> diy...@googlegroups.com <mailto:diy...@googlegroups.com>. To
> unsubscribe from this group, send email to
> diybio+unsubscribe@__googlegroups.com
> <mailto:diybio%2Bunsu...@googlegroups.com>. For more options,
> visit this group at https://groups.google.com/d/__forum/diybio?hl=en
> <https://groups.google.com/d/forum/diybio?hl=en>
> Learn more at www.diybio.org <http://www.diybio.org>
> --- You received this message because you are subscribed to the
> Google Groups "DIYbio" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to diybio+unsubscribe@__googlegroups.com
> <mailto:diybio%2Bunsu...@googlegroups.com>.
> To post to this group, send email to diy...@googlegroups.com
> <mailto:diy...@googlegroups.com>.
> Visit this group at http://groups.google.com/__group/diybio
> <http://groups.google.com/group/diybio>.
> To view this discussion on the web visit
> https://groups.google.com/d/__msgid/diybio/55119F04.6040807%__40ieee.org
> <https://groups.google.com/d/msgid/diybio/55119F04.6040807%40ieee.org>.
>
> For more options, visit https://groups.google.com/d/__optout
> <https://groups.google.com/d/optout>.
>
>
> --
> -- You received this message because you are subscribed to the Google
> Groups DIYbio group. To post to this group, send email to
> diy...@googlegroups.com. To unsubscribe from this group, send email to
> diybio+un...@googlegroups.com. For more options, visit this group
> at https://groups.google.com/d/forum/diybio?hl=en
> Learn more at www.diybio.org
> ---
> You received this message because you are subscribed to the Google
> Groups "DIYbio" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to diybio+un...@googlegroups.com
> <mailto:diybio+un...@googlegroups.com>.
> To post to this group, send email to diy...@googlegroups.com
> <mailto:diy...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/diybio.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/diybio/CAA0yOM7HwpYMsF3YrUg4b4Gyeuo6jLf223UfrBEwzqgF2qjDwQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/diybio/CAA0yOM7HwpYMsF3YrUg4b4Gyeuo6jLf223UfrBEwzqgF2qjDwQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
Scientific Director, IndieBio Irish Programme
Got a biology-inspired business idea that $50,000 -
& 3 months in a well equipped lab could accelerate?
Apply for the Summer programme in Ireland:
http://indie.bio/apply-to-ireland
Twitter: @onetruecathal
Phone: +353876363185
miniLock: JjmYYngs7akLZUjkvFkuYdsZ3PyPHSZRBKNm6qTYKZfAM
peerio.com: cathalgarvey

Nathan McCorkle

unread,
Mar 25, 2015, 12:44:30 AM3/25/15
to diybio
On Tue, Mar 24, 2015 at 12:40 PM, Jonathan Cline <jcl...@ieee.org> wrote:
> I think the snip below is the clarification which leads to agreement. When
> I say Arduino, I mean AVR hardware based kits.

Oh come on, stop trolling all the bio-folk. 8 or 16MHz is overkill for
most of the applications anyone talks about. Are AVRs too power-hungry
for you? What's your point? Seriously.

> I'm not talking about the
> software, which, since it is compatible with better hardware, then the
> obvious choice is to pick the better hardware. Why use Lego when you can
> easily switch to using real nuts & bolts.

Why use any of that when toothpicks will do? Come one man, what lacks
with AVR from any practical standpoint for most of the average stuff
that is talked about on this list? If you're talking vision processing
or video capture, OK there are other things for that... but that's my
example, what is/are yours?

> Regarding cost, the points mentioned pro/con have been simultaneously on

I doubt you can get much cheaper buying chips and copper-clad by
themselves than this USB-programmable module, $2.86 each... I just got
5 in the mail this week:
http://www.ebay.com/itm/391000702325

> both sides of the fence so watch out. Typically pro-Arduino peeps will
> argue for the kits because they don't require purchase of a programmer then

Foregoing the $0.25 programmer chip??? Yeah right.


--
-Nathan

Nathan McCorkle

unread,
Mar 25, 2015, 12:50:21 AM3/25/15
to diybio
On Tue, Mar 24, 2015 at 4:39 PM, Simon Quellen Field <sfi...@scitoys.com> wrote:

> The one I would recommend is cheap. I buy them 20 at a time

Your link was old, but the seller has another listing that is the same price:
http://www.aliexpress.com/store/product/Freeshipping-1PCS-Nano-3-0-controller-compatible-with-arduino-nano-CH340-USB-driver-NO-CABLE-NANO/1657031_32266534817.html

Looking at the seller and their rating, and their quoted shipping
time... I definitely recommend going with the aliexpress seller than
the ebay seller I mentioned before. Yes I got the 5 of these for
$2.86/each, but they took about 2 months to arrive, while the
aliexpress seller looks like it would be about 1.5 to 3 weeks.

John Griessen

unread,
Mar 25, 2015, 10:36:42 AM3/25/15
to diy...@googlegroups.com
On 03/24/2015 Simon wrote:
> * It is real-time. Devices based on Linux can't do real time
> measurements and control. Python has to disable the garbage
> collector to do real-time, and there aren't many Python programmers
> who know how to code without the garbage collector.
> * There are large libraries of debugged code for interfacing to all
> kinds of sensors and actuators.

Your previous mention of those mini arduino boards was the first thing I thought of
when the argument over arduinos broke out. And I also had thought it was straight C
under the sketches layer of arduino... thanks for educating us non-experts on arduinos.

Ooohh... this sounds shiny and cool -- arduino coding method running on MSP430 ultra low power
MCUs: http://energia.nu/ "The framework is powered by TI-RTOS letting you run your Sketches in parallel."

I need to browse those libraries of debugged code!

Any pointers on which collections are "best"?

John Griessen

Jonathan Cline

unread,
Mar 25, 2015, 6:02:29 PM3/25/15
to diy...@googlegroups.com, jcline
Arduino runs on Processing derived from work at the MIT Media Lab which runs on Java:

""ARDUINO 1.6.1 The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing and other open-source software.  This software can be used with any Arduino board.""
 

"But wait that's not what I meant, I meant the code in the chip", you're saying.  Well in fact, Arduino runs on 'Arduino language':


""The whole purpose of the Arduino language is that it is C with abstractions to make it nice and easy to program. You don't need to learn C++ at all."""


Now you are relieved because you don't really know C++ anyway, you only need to know libraries.   Arduino runs on Libraries and Arduino runs on Boards like the Arduino 0004:


""Libraries are files written in C or C++ (.c, .cpp) which provide your sketches with extra functionality (e.g. the ability to control an LED matrix, or read an encoder, etc.). They were introduced in Arduino 0004. "" 


Which is great because Arduino runs on GNU command line tools and on GCC or it could be said Arduino runs on AVR-tools:


""Sun Java SDK, avr-gcc, avr-g++, avr-libc, make, ant, and git.""



"But I don't want to learn C or C++ it's too hard!   I thought Arduino didn't require learning to write code! It's sposed to be easy!", you complain.   That's OK because Arduino runs on Wiring:

""The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment.   Wiring allows writing cross-platform software to control devices attached to a wide range of microcontroller boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.    ""
 

Now you may be confused if you thought Arduino only runs on Windows, Mac, and Linux.  It does, and it runs on 'AVR language' too:


""The Arduino environment is based on Atmel Atmega microcontrollers. The AVR language is a "C" environment for programming Atmel chips. Much of the Arduino language is written with AVR constants and functions and there are many things that are still not easy to accomplish with the Arduino language without using some AVR code. """

 


Does this reveal some of the nomenclature problems with discussing Arduino?


The name is simultaneously,
 a development/debug application running on your computer,
 a board footprint with specific header placement for add-on boards,
 a set of kit boards,
 a set of chips for the compatible software,
 a set of libraries for running firmware,
 a language on top of Java,
 a language on top of C++,
 a language mixed in with C,
 a GNU compiler toolchain,
 a completed device running firmware,
 a binary file.

And to clear another misnomer, Arduino does not have USB [typically; exceptions exist].  Arduino has serial, and a bundled external serial converter chip in order to talk to a computer and use power via a USB plug.

 

Re: to correct Nathan's point :
""Again, no one needs an 8MHz computer to blink christmas lights or even
control thermocycling. If anyone used something faster, it might be
just as open to scrutiny.""

Invert the CPU clock speed to get instructions per second.  That is the underlying limitation on any timing (with some fiddling).    Note PIC is the champ at this because each instruction is 1 clock cycle so timing is easy [branches take 2].   AVR is variable timing so is more difficult to calculate [stack layers plus several multiple cycle instructions.  C++ timing also depends on libraries used.]   This is very important for example if you are controlling a stepper motor or a servo motor and want precise 2.5 microsecond timing per pulse for example [other reasons may prohibit PWM peripheral].  "Oh but the 3D printer guys do just fine on Arduino!" ..really?  Or are they using external motor control chips.. or taking special precautions.. or ..

Don't fall into the typical trap of saying: "Yeah x Mhz is fast enough for anyone because the programs are small anyway."   Wrong conclusion.  Microcontrollers often use timing loops which need fine precision.  Interrupts may add funky overheads into this.  How many variables is GCC allocating in there to push for the subroutine later which takes different timing each time the software is compiled?   "But I'm using 16 Mhz so that's in the nanoseconds anyway!"  Well, is that really OK?  Or is it not..

If you are measuring temperature even slowly, you want to do it precisely.  If you set up a delay loop to measure it every 1 second over the course of 4 weeks, you might think you'll get a total number of measurements like 4 * 7 * 24 hrs * 3600 sec [assuming my math is right].  But you won't.  Because the Arduino is likely slipping time due to poor precision, a measurement is triggered every 1 sec + delta sec.   Only if your measurement timing is 1.0000000 seconds [sub-microsecond resolution] might you get the total number of measurements you would expect.  This is a very basic example but you can imagine how it would extrapolate into a much larger error in a different case.    [OK I realize a hardware timer would remedy this simple example but I am making the larger point, suppose the hardware timer is not available for use.  And I realize the crystal will drift but that will have a bell curve due to temp or tolerance, vs constant slippage due to poor software design.   And other things..]

This is not a trivial detail to brush off even though x microsecond may seem like a trival error.  I dont want this to be taken too far out of context either  Timing must be consistent to some number of sig figs to get what you want.  Libraries are always suspect until proven golden, who knows what is happening inside there.   "Oh, I'll just use this open source PID library that I got off the internet, it will work fine."   Yea...  maybe, or maybe not.   Just blinking xmas lights?  Maybe no one cares about precision.  Thermocycler?  It's important to calculate the error - I would.  And this might be in a published biotech experiment?  Scary.    "8 Mhz is fast enough!" ...  Well is it....


Re: Nathan's "What's your point? Seriously."


Do a proper requirements analysis and design phase, aka, "do some critical thinking homework [means more than a 10 second google search to pick the first answer shown]".   Even new comers to electronics can surpass Arduino within 4 months after building a few "hello world"'s.  There is no one size fits all with embedded chips because embedded typically means integrated peripherals, which is application specific, which is why there are many vendors, but there are likely a top two or three possible choices that come out quickly from all others, and Arduino is perhaps not one of them in terms of the hacker ideal.  Look to convergence with next year's technology not the past decade ("murder your darlings").  Attempt to learn from professional examples rather than script kiddies on the Internet or from projects aimed at new students.  All of these sentences contain some element of "Cost".  Do project estimates and don't jump to arbitrary conclusions regarding what takes "too much effort to learn" and what doesn't because it is not readily apparent especially when doing something new, which parts are most ripe to beautify.    Read professional datasheets and application notes to avoid reinventing the wheel - Again.

Mateusz Zalega

unread,
Mar 26, 2015, 12:47:17 PM3/26/15
to diy...@googlegroups.com
On 03/25/2015 01:00 AM, Cathal Garvey wrote:
> I wasn't even aware you *could* code Python without the GC. :)
>
> I also wasn't aware that Arduino was C++, I thought it was just C with
> some fluffy framework stuff added, that's an interesting tidbit.
>
> Pity there aren't any chips running Lua out there; nice middle-ground
> between slower/bigger Python (as much as I love it, it's a Big Hammer)
> and C, and you could actually imagine Lua on a sub-32-bit chip. Still
> garbage-collected of course..

You just put a Lua interpreter on any chip you like ;-) The
microcontroller found in Tiva C Launchpad could handle it, for example.

msgctl

Gavin Scott

unread,
Mar 26, 2015, 1:43:55 PM3/26/15
to diy...@googlegroups.com
On Tue, Mar 24, 2015 at 7:00 PM, Cathal Garvey
<cathal...@cathalgarvey.me> wrote:
> Pity there aren't any chips running Lua out there; nice middle-ground
> between slower/bigger Python (as much as I love it, it's a Big Hammer) and
> C, and you could actually imagine Lua on a sub-32-bit chip. Still
> garbage-collected of course.

BTW on the Python front there's also Micro Python which was a
successful Kickstarter to produce a microcontroller compatible python
and associated hardware that might be interesting to some:

http://micropython.org/
https://www.kickstarter.com/projects/214379695/micro-python-python-for-microcontrollers

G.
Reply all
Reply to author
Forward
0 new messages