Username:

Password:

Altair AstroDIO DehumidifiersAtik CamerasModern AstronomyDavid HindsNe3 Filters

Author Topic: Generic Arduino / PIC Micro-Controller Projects  (Read 6118 times)

0 Members and 1 Guest are viewing this topic.

Offline Nomis Elfactem

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 12932
    • The View From A Room
Generic Arduino / PIC Micro-Controller Projects
« on: 11:05:20, 24 May, 2013 »
OK, in order to save Dave's SQM thread (http://ukastroimaging.co.uk/forums/index.php?topic=58094.msg483258;topicseen#msg483258) I thought I'd start a generic Arduino / PIC thread in which we can swap ideas / code / best practice / hints & tips etc etc.  I'll also make it a sticky so it can be added to over time !!

Right.. down to business...

Chris - many thanks for those Amazon links mate... [I've put them at the bottom of the thread for reference]... an order has just been placed (plus a couple more not on your list) and I've even done it for delivery tomorrow so I have something to read over the bank holiday weekend (in between all the DIY that needs doing !)  :urock: :thumbup:

Tom - I really love the idea of getting multiple Fluxgate magnetometers all pooling their results online... I've just found a Ethernet shield that has a SD card slot on it so another order is just about to be placed.

Hopefully the books will fill in some of my missing jigsaw pieces (specifically around the coding/software side of things) - I'm sure I'm just missing one vital bit of info that will make it all slot into place but expect a few more questions and sorry if I have to repeat myself but my memory isn't what it used to be...

S.

http://www.amazon.co.uk/Getting-Started-Arduino-Massimo-Banzi/dp/1449309879/ref=sr_1_1?s=books&ie=UTF8&qid=1369378881&sr=1-1&keywords=getting+started+with+arduino

http://www.amazon.co.uk/Programming-Arduino-Getting-Started-Sketches/dp/0071784225/ref=sr_1_2?s=books&ie=UTF8&qid=1369378946&sr=12&keywords=getting+started+with+arduino

http://www.amazon.co.uk/Arduino-Cookbook-Michael-Margolis/dp/1449313876/ref=sr_1_1?s=books&ie=UTF8&qid=1369379015&sr=1-1&keywords=Arduino+Cookbook
Simon

Scopes: Astro-Tech AT-111EDT Triplet, TS65ED Quad, Orion ST80, Modded PST-90 Solar Scope, PST Cak (on loan)
Cameras: SXVF H694, Atik 16ic, Canon EOS 600d, DMK41, DMK21, QHY 5L-II (mono & colour)
Accessories: SX USB Filter Wheel, SX OAG, Baader LRGB Ha SI OII Filters, SharpSky Focuser
Mount: EQ6 (EQMOD), SW Star Adventurer, plus a lot (and I mean a lot) of other bits and pieces

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #1 on: 11:38:00, 24 May, 2013 »
If you read that lot, you'll probably end up a better PIC programmer than any of us!

What particular bit of the concept is giving you brain block at the moment - i.e. what is it that you "don't get" ?

Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #2 on: 11:42:20, 24 May, 2013 »
I've just found a Ethernet shield that has a SD card slot on it so another order is just about to be placed.


I was hoping to get away without using any permanent local storage - at the least the on the thermometer jobby. Most of the time the internet is up, and it can submit data (every 2 mins at present) - if the internet is down then it can hold the data in RAM and submit it all when the internet comes back up - just relies on the Arduino not getting power cycled.


So am I placing an order for a fluxy whatsit then?
Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #3 on: 08:40:47, 29 May, 2013 »
Incidently, Visual Micro is now supported in Atmel Studio

http://www.atmel.com/microsite/atmel_studio6/

which is free.

Certainly an option if you don't have access to Visual Studio
Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline Nomis Elfactem

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 12932
    • The View From A Room
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #4 on: 11:05:09, 29 May, 2013 »
What particular bit of the concept is giving you brain block at the moment - i.e. what is it that you "don't get" ?

You'll be please to hear Tom that after getting the four books and a bit of reading over the weekend that it's starting to fall into place a lot more now.

My Ethernet shield is due to delivery today but then I just thought that my Fluxgate Magnetometer will be buried in the garden with a cable into my outside office which will only have WLAN and not a wired LAN... I may have to rethink that one and feed a LAN cable into the office with the electrics or just extend my "LAN over Mains" that I use for my NAS.... I feel I'm getting off topic again...

Quote
So am I placing an order for a fluxy whatsit then?

Yes - go for it Tom... it would be great to get a network of them up and running and all feeding their data into a central website via Arduino !!

S.

Simon

Scopes: Astro-Tech AT-111EDT Triplet, TS65ED Quad, Orion ST80, Modded PST-90 Solar Scope, PST Cak (on loan)
Cameras: SXVF H694, Atik 16ic, Canon EOS 600d, DMK41, DMK21, QHY 5L-II (mono & colour)
Accessories: SX USB Filter Wheel, SX OAG, Baader LRGB Ha SI OII Filters, SharpSky Focuser
Mount: EQ6 (EQMOD), SW Star Adventurer, plus a lot (and I mean a lot) of other bits and pieces

Offline Roger B

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 8889
    • Capricorn1 observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #5 on: 11:11:00, 29 May, 2013 »
Where's the icon for "way over my head"

good luck guys I'm sure you know what your doing but please don't ask me any question. lol

Roger
Scopes - TS65q, W/O 110 Triplet
Mount - EQ6 PRO via  Eqmod,  Rowan belt modded
Cameras - SX694, QSI583WSG,Lodestar Guidecam, GP-Cam, QHY5II.
TS 9mm OAG
Quantum 7x1.25 EFW, Baader LRGB,Ha,OIII,SII Filters 
Quark chromo

SGPro, Pixinsight.

************AND NO TIME TO USE IT************

Offline Nomis Elfactem

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 12932
    • The View From A Room
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #6 on: 13:03:10, 29 May, 2013 »
I was hoping to get away without using any permanent local storage

Sure - can't see that being a problem at all Tom... as I'm a analytical consultant by trade I just like .txt files which I can load into other software for analysis/display purposes... sad but that's me.


Rog - that was my thinking to begin with but like everything after a bit or reading and head scratching it's all starting to fall into place.  A man of your ability would have no problem with it really !

S.
Simon

Scopes: Astro-Tech AT-111EDT Triplet, TS65ED Quad, Orion ST80, Modded PST-90 Solar Scope, PST Cak (on loan)
Cameras: SXVF H694, Atik 16ic, Canon EOS 600d, DMK41, DMK21, QHY 5L-II (mono & colour)
Accessories: SX USB Filter Wheel, SX OAG, Baader LRGB Ha SI OII Filters, SharpSky Focuser
Mount: EQ6 (EQMOD), SW Star Adventurer, plus a lot (and I mean a lot) of other bits and pieces

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #7 on: 13:07:02, 29 May, 2013 »
I can get you a text output from the database, simon :)
Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline Nomis Elfactem

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 12932
    • The View From A Room
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #8 on: 09:22:44, 06 June, 2013 »
Thought I'd bring this over to this thread.... in the Flux Gate thread (http://ukastroimaging.co.uk/forums/index.php?topic=53557.msg483781;topicseen#msg483781) Kim talks about an Interupt Pin... do you mean one of the digital pins ?

Reading up on the Arduino it seems like most things there are quite a few names for the same thing... if there are any others you guys who know what your talking about know of it would be good to pull together a bit of a glossary of terms.

It's made even more interesting/complicated because there are so many types of MCU, with Arduino being just one !

Learning lots at the moment and loving it !!  Still need to understand the programming side (a lot) more but that will come with time.

S.
Simon

Scopes: Astro-Tech AT-111EDT Triplet, TS65ED Quad, Orion ST80, Modded PST-90 Solar Scope, PST Cak (on loan)
Cameras: SXVF H694, Atik 16ic, Canon EOS 600d, DMK41, DMK21, QHY 5L-II (mono & colour)
Accessories: SX USB Filter Wheel, SX OAG, Baader LRGB Ha SI OII Filters, SharpSky Focuser
Mount: EQ6 (EQMOD), SW Star Adventurer, plus a lot (and I mean a lot) of other bits and pieces

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #9 on: 10:01:35, 06 June, 2013 »
The Arduino uses the Atmel MCU. The connectors on the arduino hook up to pins on the atmel chip HOWEVER the friendly labelling system on the Arduino boards isn't the same as the names of the pins on the chip itself.

So on the Atmel we might talk of the 8 connectors for PORTC , but on the arduino board these emerge as digital IO pins 32-39 on a mega. To confuse things further, the pins can all have their purpose changed to some extent.

The whole point of Arduino is to change the sometimes arcane programming of MCUs into something more people can get comfortable with and abstract it from the hardware layer.

It is much easier to program

digitalWrite(32,HIGH);

than write:

PINC &= B00000001


but behind the scenes of the Arduino libraries, this is exactly what the digitalWrite command is doing - it is just a friendly wrapper that abstracts the hardware from the programming.

So Interrupts. On an Uno digital pins 2 & 3  can be configured as interrupts.

http://arduino.cc/en/Reference/attachInterrupt

basically this means when the MCU detects a pulse on an interrupt pin it will stop what it is doing and go and run the function you specify with the attachInterrupt command.

Very handy for things like reading an encoder or dealing with users pressing buttons.
Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline Nomis Elfactem

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 12932
    • The View From A Room
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #10 on: 10:07:08, 06 June, 2013 »
Great stuff - perfect Tom.... I think I could do with a day or two inside your head... do you rent it out at all ?

S.
Simon

Scopes: Astro-Tech AT-111EDT Triplet, TS65ED Quad, Orion ST80, Modded PST-90 Solar Scope, PST Cak (on loan)
Cameras: SXVF H694, Atik 16ic, Canon EOS 600d, DMK41, DMK21, QHY 5L-II (mono & colour)
Accessories: SX USB Filter Wheel, SX OAG, Baader LRGB Ha SI OII Filters, SharpSky Focuser
Mount: EQ6 (EQMOD), SW Star Adventurer, plus a lot (and I mean a lot) of other bits and pieces

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #11 on: 10:37:07, 06 June, 2013 »
yup - Laphroaig works well as payment :)
Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #12 on: 12:35:18, 06 June, 2013 »
I know you've got the books to work with , but you can do a lot worse than read the board specific pages on the arduino site.

http://arduino.cc/en/Main/arduinoBoardUno
http://arduino.cc/en/Main/arduinoBoardMega2560

Read carefully and go an ask/look up any concepts that you don't understand.

And keep http://arduino.cc/en/Reference/HomePage open for quick reference

Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline tomhow

  • Tom How
  • Galactic Poster
  • ******
  • Posts: 3112
  • Making equipment is far more fun than buying it.
    • The Curdridge Observatory
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #13 on: 12:50:21, 06 June, 2013 »
I know it has been said before, but I'm a big fan of the Arduino Mega 2560.

Considering you can get a perfectly good Mega 2560 clone (funduino) on Ebay for <£20 I don't see much point using an Uno for home projects.

The Uno is still a superb platform but compared to the mega, the Uno has limited pins and limited memory. Granted, I've never written anything that fills all 256k on a mega, but it is easy to fill the 32k on an Uno, especially if you start pulling in multiple libraries and stuff. The SRAM is also tiny on the Uno.

I've got an older genuine mega 1280 in the telescope mount and a funduino mega 2560 running the magnetometer - but I've got a couple more funduinos kicking about that I can just grab when I want to try something quickly. Nothing worse than not being about to try a quick experiment just because your only board is tied up on a live system. 

e.g.

http://www.ebay.co.uk/itm/Arduino-compatible-Mega-2560-ATMega-2011-Funduino-brand-with-Free-USB-Cable-/140904018318?pt=UK_BOI_Electrical_Components_Supplies_ET&hash=item20ce88b18e

I've also got a Nano because they are cute, and a Sparkfun Micro https://www.sparkfun.com/products/11098 which is supposed to go in my filter wheel but I haven't got around to it yet - these are very small... 33mm long and only a couple of mm high.
Tak Sky 90, Atik 490, Homemade Mount, OAG, Lodestar

The Curdridge Observatory

Offline Nomis Elfactem

  • Administrator
  • Galactic Poster
  • *****
  • Posts: 12932
    • The View From A Room
Re: Generic Arduino / PIC Micro-Controller Projects
« Reply #14 on: 14:29:59, 06 June, 2013 »
I hear you on the Mega Tom so I'll order one (or two).... in the meantime I've now got everything (my wire arrived this morning) so I'm going to try an get the Uno up and running which is currently sitting nicely on my proto-pic breadboard lab board :)

I've also got a Ethernet shield with a SDMicro card on it so not worried about the data storage constraints of the Uno and I doubt my programs will be that big for the Magnetometer (I hope) ?!

S.
Simon

Scopes: Astro-Tech AT-111EDT Triplet, TS65ED Quad, Orion ST80, Modded PST-90 Solar Scope, PST Cak (on loan)
Cameras: SXVF H694, Atik 16ic, Canon EOS 600d, DMK41, DMK21, QHY 5L-II (mono & colour)
Accessories: SX USB Filter Wheel, SX OAG, Baader LRGB Ha SI OII Filters, SharpSky Focuser
Mount: EQ6 (EQMOD), SW Star Adventurer, plus a lot (and I mean a lot) of other bits and pieces

 

ukbuysellRemote Imaging from AustraliaSharpSkyblank APTUKAI on Facebook
TinyPortal © 2005-2012