ESP32 Internal Sensors

They are on to you :male_detective:

Over the last few hours the hack became phishing attack and then API attack.
All unconfirmed at the moment but at API attack I was looking hard at my phone that uses to Blynk to pull data from the exact Exchange that is under attack (and where my stash is). Seriously.

There’s a lot of “Bitcoin Server” thefts in the news just lately, here in the UK and Iceland to name a few …

That’s a new world… Not sure if I ever gonna like it…

but it’s coming …

And finally the Touch sensor … :grinning:

!

#define BLYNK_PRINT Serial

#include <WiFi.h>
#include <WiFiClient.h>
#include <BlynkSimpleEsp32.h>

char auth[] = "";
char ssid[] = "";
char pass[] = "";

int threshold = 40;
bool touch1detected = false;
bool touch2detected = false;

BlynkTimer timer;

void gotTouch1() {
  touch1detected = true;
}

void gotTouch2() {
  touch2detected = true;
}

void setup() {
  Serial.begin(115200);
  Blynk.begin(auth, ssid, pass);
  Serial.println("ESP32 Touch Interrupt Test");
  touchAttachInterrupt(T2, gotTouch1, threshold);
  touchAttachInterrupt(T3, gotTouch2, threshold);
  timer.setInterval(1000L, myTimerEvent);
}

void myTimerEvent() {
  if (touch1detected) {
    touch1detected = false;
    Serial.println("Touch 1 detected");
    Blynk.virtualWrite(V5, "Touch 1 detected");
  }
  if (touch2detected) {
    touch2detected = false;
    Serial.println("Touch 2 detected");
    Blynk.virtualWrite(V5, "Touch 2 detected");
  }
}

void loop()
{
  Blynk.run();
  timer.run();
}
2 Likes

I told you nothing worked on that MCU.

2 Likes

Touchy subject :stuck_out_tongue_winking_eye: … now use an ESP32 to connect an UNO to Blynk and watch the tears (or pitchforks) flow from Cyprus.

2 Likes

Clearly marks you as Northern English… :slight_smile: Rare to hear such words. Keep it coming, @Costas.

@mohan_sundaram Derbyshire / South Yorkshire border with elocution lessons as a youngster as school had me down as a future newsreader :slight_smile:

Ignoramus Mohan wants to know how you tested the touch sensor. What additional hardware did you use? How many pins are touch sensor enabled?

No extra hardware required :slight_smile: or just a jumper wire off a pin perhaps…

I believe there are 10 pins capable for the touch sensor routine.

You can see that and more in this video

1 Like

After watching this

No additional hardware, I just soldered wires to the edges of two beer bottle tops and used them as touch pads. :beers:

1 Like

I’m sure it’s nothing new to all you, Blynkers, but an old Arduino (Atmega) has it too :wink:

True… but required more pins and a voltage divider for a single touch sensor.

@Shadeyman here you can find some sketches to play with.

Isn’t 61.7 ºC a bit high when running idle?

1 Like

Room temp is 22ºC so its about 40ºC above ambient.
60ºC is hot to touch, even though it says 61.7ºC it doesn’t feel hot, so the temp sensor must be deep inside the cores.
Plus its not exactly at idle, its running a simple code and sending the resulting data over WiFi.

At least his is probably closer to reality… mine runs around 45-51°C but the value I get is about 91-97. So after confirming with an external temp probe, I ‘calibrate’ it by subtracting 46 from the sensor reading. Now every time I use the external probe to double check… it is spot on.

So it seems accurate in variance, just not in the value of the reading… albeit consistently inaccurate, so fixable :slight_smile:

Now the little voltage regulator beside it… that can get very hot… too hot to touch even with a little heatsink… mind you I am using it to power an ESP-01 on the same breadboard as well :stuck_out_tongue: Going to switch that duty to a seperate regulator soon.

1 Like

Ok, I asked because I’m getting the same temp w/o using WiFi…

//https://github.com/pcbreflux/espressif/tree/master/esp32/arduino/sketchbook

#include <time.h>
#include <sys/time.h>

#ifdef __cplusplus
extern "C" {
#endif

uint8_t temprature_sens_read();
//uint8_t g_phyFuns;

#ifdef __cplusplus
}
#endif

uint8_t temp_farenheit;
float temp_celsius;
char strftime_buf[64];
time_t now = 0;
struct tm timeinfo;
char buf[256];

void setup()
{
  // Debug console
  Serial.begin(115200);
  tzset();
}

void loop()
{
  localtime_r(&now, &timeinfo);
  strftime(strftime_buf, sizeof(strftime_buf), "%c", &timeinfo);
  sprintf(buf, "scan start %02d:%02d:%02d ", timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec);
  Serial.print (buf);

  temp_farenheit = temprature_sens_read();
  temp_celsius = ( temp_farenheit - 32 ) / 1.8;
  Serial.print("Temp onBoard ");
  Serial.print(temp_farenheit);
  Serial.print("°F ");
  Serial.print(temp_celsius);
  Serial.println("°C");
  delay(1000);
  now++;
}

You sure are taking that 5$ board to its extreme :grin: