Friday, 25 March 2022

Photo resistor (2x) and transistors (10x TIL78) have arrived

 Got back from Mayo to two packages containing my photo resistors and transistors.


Aim to use theses to detect the LED pulses from OMNIpower smart electricity meter


Looks like a 47KR will do the trick according to this website:

https://forum.arduino.cc/t/phototransistor-usage/190418/10

https://learn.parallax.com/tutorials/robot/shield-bot/robotics-board-education-shield-arduino/chapter-6-light-sensitive-15

Long lead is collector C and shorted lead is emitter E

A 5v to C and a 2KR from E to GND with A/D sampling at E pin should do this trick :)





Once I've determined the voltages I can refine the Arduino sketch 






Tuesday, 1 March 2022

Setting up two ESPNow boards

I used the  two TTGO ESP32 LoRa boards to experiment with ESPNow communications. Which I haven't tried yet.

Master code serial output:

STA MAC: 4C:75:25:C2:7F:3C
ESPNow Init Success
 
Found 18 devices 
Slave Not Found, trying again.
 
Found 23 devices 
Slave Not Found, trying again.
 
Found 13 devices 
Slave Not Found, trying again. 
 

Slave code serial output:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1044
load:0x40078000,len:10124
load:0x40080400,len:5856
entry 0x400806a8
ESPNow/Basic/Slave Example
AP Config Success. Broadcasting with AP: Slave_1
AP MAC: 4C:75:25:C2:EF:CD
ESPNow Init Success  


Would like OLED display support in Arduino so I can do a field range test :) Llooking for a suitable library :)

https://github.com/LilyGO/TTGO-LORA32

 

I went for the library from:

https://github.com/ThingPulse/esp8266-oled-ssd1306

And the OLED sketch:

/home/kilnageer/Arduino/sketches/LILYGO TTGO ESP32 LoRa OLED/TTGO-LORA32/BaT_test_ssd1306/BaT_test_ssd1306.ino 


 

which worked great! So combining the two sketches I now get..