element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Just Encase
  • Challenges & Projects
  • Design Challenges
  • Just Encase
  • More
  • Cancel
Just Encase
Blog Just Encase Solar Super Capacitor Weather - Bluetooth - Blog 5
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Just Encase to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: dougw
  • Date Created: 7 Feb 2022 5:46 AM Date Created
  • Views 818 views
  • Likes 10 likes
  • Comments 0 comments
  • bluetooth
  • doug wong
  • Hammond Manufacturing Enclosures
  • super capacitor
  • solar cell
  • weather station
  • TC1046
  • just_encase
Related
Recommended

Just Encase Solar Super Capacitor Weather - Bluetooth - Blog 5

dougw
dougw
7 Feb 2022

Some weeks it seems every project just gets hit with every problem in the book, which tests one's mettle and plays havoc with all the schedules. This has been one of those weeks -- lots of work on lots of projects, but not as much progress as expected. It was touch and go whether there would be any progress on this project at all, but things started to look up after midnight on Sunday.

I did manage to fix the temperature sensor issue by digging though my parts stock and also finally got Bluetooth working, so now I can get on with the rest of the tasks.

Here is a short video demonstrating Bluetooth in action:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

Here is an image showing the kludged smt temperature sensor - TC1046 (Buy Now ), which will end up flush with the bottom of the chassis:

It is in the little rectangular pocket at the bottom of the yellow chassis.

image

I will include the demo code here even though it is not elegant:

//  Super Capacitor Weather Station
//
//
//  Author :  Doug Wong
//  Date   :  2022
//  Version:  1.00
//  File   :  SuperCapWeather.ino
//
//

// Include application, user and local libraries
#include "SPI.h"
#include "OneMsTaskTimer.h"
#include "LCD_SharpBoosterPack_SPI.h"

// Variables
LCD_SharpBoosterPack_SPI myScreen;
uint8_t myOrientation = 0;
uint16_t myCount = 0;
int TMP = 23;         // scaled temperature
uint16_t MV = 5400;   // scaled capacitor voltage in mV
int TMP36Pin = 12;    // analog temperature sensor pin
int VcapPin = 13;     // analog capacitor voltage sensor pin
float TMPa;           // raw temperature reading
long TMPb;            // raw temperature reading
long Vcapa;           // raw capacitor voltage
int Vcap;             // scaled capacitor voltage
int AenPin = 8;       // analog enable pin
int BenPin = 11;      // Bluetooth enable pin
int BTTxPin = 4;      // Bluetooth Tx pin
int BTRxPin = 3;      // Bluetooth Rx pin
int CMD;             // Bluetooth command

#define LCD_VERTICAL_MAX    myScreen.getSize()
#define LCD_HORIZONTAL_MAX  myScreen.getSize()


// Add setup code 
void setup()
{
    pinMode(BTTxPin, OUTPUT);
    pinMode(BTRxPin, INPUT);
    Serial1.begin(9600);
    
    myScreen.begin();
    myScreen.clearBuffer();

    myScreen.setFont(0);
    myScreen.text(4, 4, "Super Capacitor");
    myScreen.text(4, 20, "Weather Station");
    myScreen.text(26, 40, "T: 22");
    myScreen.text(20, 60, "mV: 5300");
    myScreen.text(64, 84, "DougW");
    myScreen.flush();

    pinMode(AenPin, OUTPUT);    // setup analog power enable pin
    pinMode(BenPin, OUTPUT);    // setup Bluetooth power enable pin

    digitalWrite(BenPin, HIGH);  // disable Bluetooth
    digitalWrite(AenPin, LOW);  // enable analog circuitry
    delay(100);                 // wait for sensor to seltle down
     
    TMPa = analogRead(TMP36Pin);
    TMPa = TMPa * 10 /33;
    TMP =  TMPa - 190;
    myScreen.text(44, 40, String(TMP));

    for (uint8_t i = 0; i < 20; i++)
    {
        delay(100);
    }

}
void loop()
{
     delay(100);
    TMPa = 0;
    Vcapa = 0;
    for (int i = 0; i < 10; i++)          // add 10 readings to obtain an average
    {
      TMPa = TMPa + analogRead(TMP36Pin);
      Vcapa = Vcapa + analogRead(VcapPin);
    }
    // TMPa = TMPa / 33;
    TMP =  TMPa / 33 - 190;    
    myScreen.text(44, 40, "      ");
     myScreen.text(44, 40, String(TMP));
     Vcap = Vcapa * 2118 / 10000;
     myScreen.text(44, 60, "       ");
     myScreen.text(44, 60, String(Vcap));
     myScreen.flush();

//     digitalWrite(AenPin, HIGH);

    digitalWrite(BenPin, LOW);  // enable Bluetooth
      while(Serial1.available()>0){
      CMD = 0;
      CMD = Serial1.read();
      if (CMD == 'T' || CMD == 't'){         // "T" or "t"
        Serial1.println(TMP);
      }
      else if (CMD == 'V' || CMD == 'v'){    // "V" or "v"
        Serial1.println(Vcap);
      } 
      else if (CMD == '?'){
        Serial1.println("SuperCap Weather");
      }
     }

    for (uint8_t i = 0; i < 20; i++)
    {
        delay(100);
    }
    // digitalWrite(BenPin, HIGH);  // disable Bluetooth
}

So now that the hardware is pretty functional and the firmware is under control I can start doing some interesting tests.

Project Status

  • The temperature sensor is working, actually all the electronics are working
  • Bluetooth communications are working
  • The firmware has all the functions working, although the final timing hasn't been determined yet. (it isn't known how thrifty I need to be with power yet)

Issues Dealt With

  • Defective temperature sensor - replaced with an SMT substitute
  • Low Bluetooth voltage - replaced FET
  • Wrong serial port - DUH

Next Steps

  • Test the super capacitors and their protection circuit
  • Write an android app to get data via Bluetooth
  • Test power consumption performance of the system
  • Test to ensure the case is waterproof

Relevant Links

Just Encase Solar Super Capacitor Experiment - Blog 1
Just Encase Solar Super Capacitor - Project Outline - Blog 2
Just Encase Super Capacitor Solar Weather Station - Design - Blog 3
Just Encase Super Capacitor Solar Weather Station - Assembly - Blog 4
Just Encase Super Capacitor Solar Weather Station - Bluetooth - Blog 5
Just Encase Super Capacitor Solar Weather Station - Indoor Operation - Blog 6
Just Encase Solar Super Capacitor Weather Station - Outdoor Tests - Blog 7


Just Encase Design Challenge
Tube Amp using Hammond transformers
GPS location and distance tracking using LoRa on a MKR WAN 1300

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube