Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 15 of 15

Thread: Total Novice wants to build atmospheric sensor

  1. #1
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7

    Total Novice wants to build atmospheric sensor

    Greetings,

    Am prowling through the PJRC site and see what looks like a great base for developing our own low cost atmospheric sensors. The Teensy LC seems like a good platform to start with. Plan to communicate with the board from Windows.

    Here is what we want to do:

    1) measure Temperature, Pressure, RH (Adafruit), PM2.5 (Plantower or Shinyei), Ozone (Alphasense), NO2 (Alphasense)
    2) realtime 9600 baud serial data output via a 3.3V serial port
    3) store data on SD card
    4) optional WiFi capability to remotely read saved data from SD card

    Can someone point me toward the parts that will get us started? Also, please offer advice on our ideas above.

    Thanks!

  2. #2
    Senior Member oddson's Avatar
    Join Date
    Feb 2013
    Location
    Isle in the Salish Sea
    Posts
    1,029
    Learn how to communicate with each sensor, typically via I2C, from its data sheet and the Wire library page. https://www.pjrc.com/teensy/td_libs_Wire.html.

    Data logging and wireless are separate issues... don't take on everything at once.

    If you are a total novice you might want to start with the basic tutorials before trying to read senor data. https://www.pjrc.com/teensy/tutorial.html

    'Novice' can mean 'no programing experience' or just 'new to Arduino' but either way you need to be able to handle the basics.

  3. #3
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7
    Thanks for the feedback. Personally I have done a lot of device communication coding in the past; just not with Arduino. But I'm working with a high school student who is new to most of this. So the tutorial sounds like a good place to start. Then we'll move onto the sensors of interest. Will send feedback as needed .... Thanks again!

  4. #4
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7

    Tutorial Problems

    Quote Originally Posted by dnwhiteman View Post
    Thanks for the feedback. Personally I have done a lot of device communication coding in the past; just not with Arduino. But I'm working with a high school student who is new to most of this. So the tutorial sounds like a good place to start. Then we'll move onto the sensors of interest. Will send feedback as needed .... Thanks again!
    So we have the tutorial kits and everything has worked fine up to the point in the tutorial where in tutorial one, the next step is to open examples/digital in the Arduino IDE looking for one called Blink. There is no Blink there but instead "Blink w/o delay". There *is* a blink in the basics list. No matter, both of them when verified produce the same error of:


    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy/core_pins.h:2181:15: error: operator '==' has no left operand

    can you help with this?

    Thanks!

  5. #5
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,004
    Quote Originally Posted by dnwhiteman View Post
    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy/core_pins.h:2181:15: error: operator '==' has no left operand
    You seem to have selected teensy2 and not TeensyLC in your Arduino IDE.
    The link should be '.\cores\teensy3/core_pins.h'. (note the 3)

  6. #6
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7
    Quote Originally Posted by WMXZ View Post
    You seem to have selected teensy2 and not TeensyLC in your Arduino IDE.
    The link should be '.\cores\teensy3/core_pins.h'. (note the 3)
    thanks very much for the quick feedback. I switched to Teensy LC but still get similar errors:

    ***************

    In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/core_pins.h:34:0,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/wiring.h:38,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/WProgram.h:45,

    from C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/Arduino.h:6,

    from C:\Users\Dave\AppData\Local\Temp\arduino_build_178 57\sketch\Blink.ino.cpp:1:

    C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3/kinetis.h:764:12: error: operator '==' has no left operand

    #if (F_CPU == 256000000)

    ***************

    I found the apparently offending code in kinetic.h and it reads:

    ************

    #endif // end of board-specific definitions

    #if (F_CPU == 256000000)
    #define F_PLL 256000000
    #ifndef F_BUS
    #define F_BUS 64000000
    //#define F_BUS 128000000 // all the usual overclocking caveats apply...
    #endif

    *************

    More ideas?

  7. #7
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,004
    Quote Originally Posted by dnwhiteman View Post
    thanks very much for the quick feedback. I switched to Teensy LC but still get similar errors:
    Is the Tools tab saying

    Code:
    Board: "Teensy LC"
    USB Type: "Serial"
    CPU Speed: "48 MHz"
    or what?

  8. #8
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,358
    What version of the Arduino IDE is installed - is this being built from the IDE ? What version of TeensyDuino? It seems like the IDE isn't in use or building right to not have F_CPU defined.

  9. #9
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7
    Quote Originally Posted by WMXZ View Post
    Is the Tools tab saying

    Code:
    Board: "Teensy LC"
    USB Type: "Serial"
    CPU Speed: "48 MHz"
    or what?

    Yes on Board, yes on USB type, I had to set the speed to 48 Mhz. But still the same result...

  10. #10
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7
    Quote Originally Posted by defragster View Post
    What version of the Arduino IDE is installed - is this being built from the IDE ? What version of TeensyDuino? It seems like the IDE isn't in use or building right to not have F_CPU defined.
    yes, being built from Arduino IDE 1.8.8. TeensyDuino is 1.45.

    I followed the directions in the tutorial for loading things up pretty closely, I think...

  11. #11
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,032
    I switched to Teensy LC, loaded the Blink example and it compiles, without error.
    Something is wrong with your installation.
    I'd delete all and begin again. - Identifiying the problem takes too much time and is needless. Installing it new it way faster.

    0. Delete all, Reboot !!! to make sure nothing is running
    1. Install arduino - for example to c:\Arduino
    2. Install Teensyduino, when it asks for Arduino, point to c:\Arduino

    3. Thats it.

    4. Select your Teensy LC / Teensy 3.x, load "Blink" from the Menu Examples / Teensy / Tutorial1

  12. #12
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    5,032
    If you see any errors during installation, please report here..

  13. #13
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    7,358
    Quote Originally Posted by Frank B View Post
    ...
    I'd delete all and begin again. - Identifiying the problem takes too much time and is needless. Installing it new it way faster.

    0. Delete all, Reboot !!! to make sure nothing is running
    1. Install arduino - for example to c:\Arduino
    My only note on #1 Install would be to clarify down load the ZIP install version. … OKAY One more note Step #3.5 below

    Unzip to folder of your choice [ note if unzip goes in that folder or a folder in that folder ] - then install TeensyDuino and run from there.

    The standard Windows installed version used to give me grief - so I stopped using that.

    Step #3.5: Check your Sketchbook Folder and the Libraries folder within that folder as it may have some unwanted or old items.
    > I keep my Sketchbook in its own folder outside of any Arduino folders so it isn't affected by anything, and 'libraries' in that folder is where manually installed libraries come from and override other files.

  14. #14
    Junior Member
    Join Date
    Dec 2018
    Location
    Maryland
    Posts
    7
    Here's what I did:

    1. Download arduino-1.8.8-windows.exe from Arduino website
    2. Install Arduino to c:\Arduino
    3. Download TeensyDuinoInstall.exe
    4. Disable Norton Firewall
    5. Install TeensyDuino to c:\Arduino
    6. Now I’m compiling and running without the errors.

    No idea what happened the first time. Except for choosing the c:\Arduino I think I did the same thing before. Oh well, now it works!

  15. #15
    Senior Member
    Join Date
    Dec 2016
    Location
    Montreal, Canada
    Posts
    2,878
    don’t forget Windows sets permissions in Program Files to read only from the user, where you have to authorize a write to modify files there. This can be adjusted in the control panel’s user options, set it to the lowest value and you won’t get those annoying Admin authorization popups whenever you copy files to a read-only protected folder

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •