Showing posts with label ESP8266. Show all posts
Showing posts with label ESP8266. Show all posts

Sunday, December 15, 2019

Business Card PLUS (#003)

In this post a detail views of my this first version of my PCB business card. One side is more the business card side with contact information.
Also two rulers are in included. One on the bottom with cm divided in mm.
The division on the right can be used for counting PCB pins.
Text on the PCB is aligned with the holes in the PCB. (E.g. the o in Jeronimus. However in linkedin i needed to put the hole over the e.



The other side of the PCB is for the electronic circuits that can be build. It is more a development type board than one circuit and can also be used as a breakout board. So not all items need to be placed on the board. For several components the SMD or thru hole version can be used by placing the SMD pads between the holes for the thru hole version. The PCB can be used as an Arduino Uno shield / Arduino breakout board. In the white rectangulars long dupont pin holders can be placed. The two Arduino pin holders are not at "Dupont" distances. The good thing about this is that this prevents some mistakes when connection a shield. The disadvantage is that it is not easy to connect cheap prototype pcbs like the {} 5cm*7cm pcb.
By adding female pin holders vertical on the two columns where the small white line at the top this PCB can connect an Arduino pins to the 5cm*7cm PCB. Also on the top two blocks for 2*4 connectors are marked ESP01.
The right one is for "normal use" and the left one can be used to program an ESP01. The ESP01 can be used without an Arduino. An connector for an CR2035 can be used as power source, LA0 and LA2 are locations for 2 leds (SMD or thrue hole) with corresponing resistors ( PL0 and PL2),

On the bottom are three metal pads. 5V , 3V3 and GND for crocodile clips. Above the GND pad is a an SMD IC 8 SOP can be soldered. ( e.g. 555 or memory chip.)the pins of this SOP8 are only connected to the nearby holes. On the right side are holes for two push buttons.C1 and C2 are locations the corresponding capacitors. Between the two buttons is a location for a jumper (or wore bridge) to program ESP01 1  (top right). In up coming blog posts more details will follow.





Friday, December 13, 2019

Business Card PLUS (#002)

PCB Business Cards
Yesterday I posted a short quick message on my blog to show my Business Card PLUS have arrived.
I decided that my (classic) Business Card needed an update. I still have several of this paper business cards. As the information on them is still up to date i don't like to throw them away as waste. So will still use them but, if i become more happy with the Printed Circuit Board  - Business Cards i expect not to order new paper cards. I wanted a business card that can be used.
The price of manufacturing this PCBs in China is low. To get PCBs in low quantities relative cheap best stay under the size of 100 mm * 100 mm and the minimum order is 5 pieces. By "panelizing" the PCB you can even get more PCBs. I don't like to throw away unused PCB's. Perhaps if i need a PCB for future project perhaps i will design them so the PCB can also be used as a business card.
However a few weeks ago i started designing a (test) PCB especially to be used as a business card.
'classic' Business Card
Panelizeing the PCBs gave multiple PCBs with a break line for easy separation. As the manufacturer needs to add some text to your PCB to identify the order between all other orders i a added borders and asked the manufactured to place there ID on the boarder. I even changed the size of the PCBs a little from the standard size. This way two PCB/Business cards can be placed on one 100*100 mm PCB. As the minimum order is 5 (< 100*100 mm) PCB you will get after separating them 10 cards. ( In fact 10 panelized PCBs where ordered ,so i now have have 20 new business cards / PCBs that can be used different ways.
The disadvantage of my new card is that it is not possible to write something on the back.As i also have plans to add RFID with a sticker (also usable with classic paper business card) this can change).
To quick start, this first PCBs contain no QR. code. However i did add a ruler to the design.
The PCB can be used for electronic circuits in different ways. On my blog i will post some examples with test results and hope it will work in this first batch of PCBs. If not i can still use this batch as 'regular' business cards. If you get one of my PCB business cards and want to dispose it, consider giving it to someone else who perhaps can use it.
Also i would be happy to know how my PCB business cards are used (or only the [complex] PCB). Comments on this blog, mail, about this topic is welcome. I will share the Gerber files so you can (adapt and) order your own PCB if you don't get one from me. New blog post about this PCB will be published soon.


Thursday, March 29, 2018

RFID and Wemos D1 mini (1)

I wanted to connect an RFID reader to my home network.
Therefore i used a ESP8266, more specific the Wemos D1 mini Wifi module.

Test 1 (fail)

I found a project on http://www.instructables.com/id/WiFi-RFID-Reader/ using a Wemos D1 mini. The exact info about the pins was missing.
As a test i created the circuit as a test on a breadboard using the Wemos D1 mini pin info on https://escapequotes.net/esp8266-wemos-d1-mini-pins-and-diagram/. (See also this picture with Wemos D1 mini connections)




RFIDESP8266Wemos D1 mini
RSTGPIO05 (free GPIO)D1
SSGPIO4 (free GPIO)D2
MOSIGPIO13 (HW SPI)D7
MISOGPIO12 (HW SPI)D6
SCKGPIO14 (HW SPI)D5
GNDGNDG
3.3V3.3V3V3
The instructional also contains software to read basic RFID info and send it over the serial (usb) line.

define RFID module

#include "MFRC522.h"
#define RST_PIN 15 // RST-PIN for RC522 - RFID - SPI - Modul GPIO15 
#define SS_PIN  2  // SDA-PIN for RC522 - RFID - SPI - Modul GPIO2
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance

Initialize RFID module

void setup() {
  Serial.begin(9600);    // Initialize serial communications
  SPI.begin();           // Init SPI bus
  mfrc522.PCD_Init();    // Init MFRC522 
}

Read RFID tag

void loop() { 
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
    delay(50);
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    delay(50);
    return;
  }
  // Show some details of the PICC (that is: the tag/card)
  Serial.print(F("Card UID:"));
  dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
  Serial.println();
}

// Helper routine to dump a byte array as hex values to Serial
void dump_byte_array(byte *buffer, byte bufferSize) {
  for (byte i = 0; i < bufferSize; i++) {
    Serial.print(buffer[i] < 0x10 ? " 0" : " ");
    Serial.print(buffer[i], HEX);
  }
}
Unfortunate the example above did not working for me. I got output on the terminal, however there was a message about perhaps bad connections.

Test 2 (succes)

More succesfull was the next example that  i found this on github:
https://github.com/Jorgen-VikingGod/ESP8266-MFRC522

Wiring RFID RC522 module

The following table shows the typical pin layout used:
SignalMFRC522WeMos D1 miniNodeMcuGeneric
RST/ResetRSTD3 [1]D3 [1]GPIO-0 [1]
SPI SSSDA [3]D8 [2]D8 [2]GPIO-15 [2]
SPI MOSIMOSID7D7GPIO-13
SPI MISOMISOD6D6GPIO-12
SPI SCKSCKD5D5GPIO-14
  • [1] (1, 2) Configurable, typically defined as RST_PIN in sketch/program.
  • [2] (1, 2) Configurable, typically defined as SS_PIN in sketch/program.
  • [3] The SDA pin might be labeled SS on some/older MFRC522 boards (including the one i used)

Define RFID module

#include "MFRC522.h"
#define RST_PIN 5 // RST-PIN for RC522 - RFID - SPI - Modul GPIO5 
#define SS_PIN 4 // SDA-PIN for RC522 - RFID - SPI - Modul GPIO4 
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance

Initialize RFID module

void setup() {
  Serial.begin(115200);    // Initialize serial communications
  SPI.begin();          // Init SPI bus
  mfrc522.PCD_Init();    // Init MFRC522
}

Read RFID tags

void loop() { 
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
    delay(50);
    return;
  }
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) {
    delay(50);
    return;
  }
  // Show some details of the PICC (that is: the tag/card)
  Serial.print(F("Card UID:"));
  dump_byte_array(mfrc522.uid.uidByte, mfrc522.uid.size);
  Serial.println();
}

// Helper routine to dump a byte array as hex values to Serial
void dump_byte_array(byte *buffer, byte bufferSize) {
  for (byte i = 0; i < bufferSize; i++) {
    Serial.print(buffer[i] < 0x10 ? " 0" : " ");
    Serial.print(buffer[i], HEX);
  }
}
THis did work and i expected that was a good starting point for the rest of my project.

Monday, July 17, 2017

Microwave Radar Sensor RCWL-0516 with Arduino Uno

The Microwave Radar Sensor RCWL-0516 is an interesting cheap motion sensor.
At Aliexpress i found 5 pieces for  € 2,19 => € 0,44 / piece.

Info how to wire the device and a test program was found on https://www.14core.com/wiring-the-rcwl0516-auto-induction-doppler-microwave-radar-with-esp826632arduino/

I soldered some wires with Dupont connectors to one of my RCWL-0516 modules and tested the program with an Arduino Uno (clone). Not yet with ESP8266, perhaps that will come in another RCWL-0516 post. It found some little errors that i needed to corrected. When changing the program i also did put the serial output on one line for each change with a millis() timestamp.


The program after my changes:


/* 14CORE | DOPPLER RADAR TEST CODE 
*************************************
From https://www.14core.com/wiring-the-rcwl0516-auto-induction-doppler-microwave-radar-with-esp826632arduino/
Modified
2017 July 17 by @JanJeronimus  / Correction 'bool sens;'& 115200 /  Output one line , added additional and spacesMillis() 
*/
static bool value = -1;
bool sense;

const int8_t Output = 13;
#ifdef ESP8266
const int8_t sensor = D2;
#else
const int8_t sensor = 2;
#endif

void setup(){
Serial.begin(115200);
#ifdef ESP8266
Serial.println(" 14CORE | DOPPLER RADAR TEST CODE");
Serial.println("==================================");
Serial.println("ESP8266 Started......");
digitalWrite(Output,1);
#else
Serial.println("Arduino MCU Started......");
digitalWrite(Output,0);
#endif
pinMode(Output, OUTPUT);
pinMode(sensor, INPUT);
}

void loop(){  
sense = digitalRead(sensor);
if (sense != value){
  Serial.print( millis()); 
  Serial.print(" Raw Value : ");
  Serial.print(sensor);
  Serial.println(sense ? " +HIGH" : " -LOW");   
#ifdef ESP8266
  digitalWrite(Output, ! sense);
#else
  digitalWrite(Output, sense);
#endif
  value = sense;
  }
  delay(20);
}

To use the program you need to connect 3 pins
GND
OUT - connect this to an input pin (Arduino D2)
VIN 4 to 28 volt
It seems the CDS pin can be used to disable detection. You need not to connect it.
The 3V3 pin is for output not input!  (Interesting to try if it can be used to power an ESP8266!)

The sensor works fine and can detect motion even behind obstacles. It can detect motion at about 3 to 4 meter distance.

Some other references

Two videos about the RCWL-0516 by nenioc187 :



Specs & Pin info :
  https://www.elecrow.com/rcwl-0516-microwave-radar-sensor-switch-module-body-induction-module-4-28v-100ma.html

 https://github.com/jdesbonnet/RCWL-0516/

Wednesday, June 21, 2017

My First Lora Gateway

FRM95
RFM95 back LoRa breakout

As i like doing some projects with IoT i also wanted to experiment with LoRa.
Some time ago i ordered a cheap LoRa shield for my Arduino. Unfortunate i did not get it working. I could not find out if it was something with the code, the jumper settings, a hardware error or perhaps my shield could not reach a LoRa gateway in Almere.
Perhaps in another LoRa post in my blog you will read more about this shield.
RFM95 front LoRa breakout

When asking advice someone was so friendly to send me documentation to make a simple one channel test LoRa gateway with an RFM95 and a Wemos D1 mini.

On Aliexpress i found two RFM95 breakout boards for 13 Euro so i decided to order them. I have done several experiments and projects with different ESP8266 boards but until now i never used the Wemos version.
Between the  RFM95 and the  Wemos D1 mini (ESP8266) you need to make the some connections.
Wemos D1 mini
Wemos D1 mini
According to a descriptions i connected this:
RFM95 pinESP8266 pin
3.3V3.3V
GNDGND
MISOD6 GPIO12/MISO
MOSID7 GPIO13/MOSI
SCKD5 GPIO14/CLK
NSSD8 GPIO15/CS
RESET*nc
DIO0D1, GPIO5

The Wemos D1 mini came with 2 sets of male pins, 2 sets of female pins and 2 sets of female with long male pins. I decided to build the circuit on a small prototype PCB board. (It is also possible to order a Wemos PCB for the RFM95 or connect them direct.)
I decided to solder the female with long male pins on the Wemos D1 mini. On the PCB i soldered the two sets of female pins so i could separate the ESP8266 from the circuit if needed. As the Wemos can be put in two ways in the connector of the PCB i marked the side of the Antenna.
The Lora RFM95 is not breadboard friendly. I soldered it direct on the prototype PCB next to female pins for the Wifi ESP8266 Wemos module. Each RFM95 pin (except the Antenna pin) is connected to a Dupont male pin. To the Antenna pin i soldered a 8,2 cm wire to use this as a first test antenna. (Perhaps after some testing i change this to an SMA connector as in the documentation.)
After this is soldered the wires between the RFM95 and the Wemos connector on the PCB as in the table above. (Most of these connections are made on the copper side of the PCB so you can not see them on the pictures in this blog article!) 
I added a button between D4 and ground to have a simple input button to test the ESP8266
The Wemos D1 mini already has a Reset button.
Next to the GND and 5V of the Wemos i added male pins to have easy access to GND and 5V and there is also a third pin connected to the 3V3. I only have tested my module by powering via USB
I tried to connect the Wemos to my computer using USB. At first it did not work as i used an USB power cable instead of an USB data cable. (I think i need to label my USB cables!).
After finding the right cable i tried to upload the Blinck sketch first to test the connection and the Wemos module.
I got the system message "Error board is unknown / (Package ESP8266 )" and solved this problem (
http://arduino-esp8266.readthedocs.io/en/latest/faq/a04-board-generic-is-unknown.html )
In the directory ' Users\<MyName>\Arduino15\packages\esp8266\hardware\esp8266 '  i needed to manual clean up old software. So i removed there everything and Blinck worked.

Now the 1ch Wemos gateway software. When installing this on my computer "Time" was already installed on my computer. As i did not know if this was the right version i decided to rename the old version.
Stupid as this did not work. When starting the Arduino software to upload it to my Wemos i got an error message that there where two versions of "Time" with a link to my renamed version.
So i moved my old "Time" version to another directory and this problem was solved.
Now i got the error message "Documents\Arduino\ESP-sc-gway30\ESP-sc-gway30.ino:67:92: fatal error: gBase64.h: No such file or directory"
Googled and installed another "base64" but this did not solve my problem.
Finally i found the latest 1ch gateway software ( Version 4. ) . This package included gbase64 and after adapting the configuration parameters it worked.
The error message "The management functions only work over _THINGPORT and not over _TTNPORT" also went away by adapting the parameters.
In the end i got a working 1 channel test LoRa gateway. The IP address of the Wemos ESP8266 gives a simple webpage to check and configure some parameters,
Some things i want to do with this device:
- testing this gateway with another LoRa device (my Arduino LoRa shield?),
- putting this device in an enclosure
- adding connector for another antenna
- adding one or more sensors (temperature) to this LoRa gateway
- adding a better power supply

Monday, April 10, 2017

ESP01 Break-in board

I created several projects with EPS8266 wifi modules.
The small cheap ESP01 module has only a few IO pins so i did not used it until now.
In one of my recent Aliexpress China orders i also added a small cheap ESP01S module to my shopping list. I also ordered some boards to easy test and use of this module: ESP01 has 2x4 pins close to each other.
 Not easy to use on a breadboard therefore i also added to my shopping list.
(Right to left. [First is the ESP01 module itself] ) 
  • ESP01 - Breadboard interface. 
  • ESP01 - TTL interface
  •  ESP01 - USB interface
My plan was to use the ESP01 - USB interface board to program an test the ESP8266 module.
Then the disappointment : to program the small ESP01 module you need to pull GPIO0 to ground. My cheap interface USB module has no jumper or switch to do that!
A reset button would also be nice.
And perhaps easy access to all the pins to experiment.
If i would use the TTL interface wired this to a USB TTL / RS232 (FTDI) interface cable i would have the same problem.
An option would be start from zero, using a breadboard interface, and make my own interface.
 (Later i found there are some ESP01 USB modules with programming switch. I did not find one with programming switch and reset button!)
ESP01 with USB Module 

But what is the use of these cheap "ready to use" interfaces. For programming, testing and debugging I decided to make my "ESP01 Break-in board". A board to put between the ESP01 and the boards with the 2*4 connector.
(I decided to call it "Break in board". It is not a "Break out board" to use and get access to chip pins but a "Break in" to put between the existing connections to add features.)
It needed (minimal) a programming switch, a reset button and access to the pins.
Later on i decided to add also some additional features. (See photo, final specs/feature list below.) This are additional features but not really needed.
I used a small double Side Prototype PCB Bread board Tinned Universal 20x80 mm FR4 28*6 holes.
ESP01 "Break in board"
 with EPS and USB
connected.
 (All holes are plated through). I added pins to fit in a 2*4 pin connector (on bottom) and additional 2 times 4 pins to get easy access to all pins and a female 2*4 connector for the ESP01 module (on the top). On my (current) laptop free USB connectors are at the left side. I wired my "Break-in board" with this in mind. (USB connector pointing to the right when using this board).
Mark on the PCB with an arrow the direction of the ESP01 module.
A push button is used for the reset, (Bottom of the PCB) wired to ground and reset.
While uploading a program i do not want to continuously press a button. I decided to use a small slide switch (Top).
In stock i had a three position switch. If you have a small two position slide switch you use that. The three position switch i used has 6 pins: (and two shield pins)
Left no pins are connected
Middle pin 1 and 4 are connected ' / pin 3 and 5 connected "
Right pin 1 and 4 are connected '
Pin 2 and 6 have no use (n.c.), i did bend them away and soldered the switch on the PCB. I decided to use the middle position as programming position and wired pin 2 and 5 ' to ground and GPIO0.
3 position switch
At this point my basic minimal "ESP01 Break-in board" was ready.
ESP01 "Break in" board. (top view)
 On my board i also added some other things i had in stock:

  • 6 female pins connected to to ground (and next to it a) 
  • 25 Points Mini Solderless Prototype Tie-point Breadboard 
  • A micro switch (three pins Common, Normal open, Normal closed ) with connections to pins to easy wire them for experiments. (on bottom next to reset pushbutton).
  • Passive electromagnetic impedance 16 ohm AC buzzer/2KHz 3V 5V universal buzzer (- connected to ground, other side to a pin and 100 ohm resistor with a second pin. -
On my slide switch at pin 1 and pin 4 ' contacts available are (Left open, Middle and Right closed), i wired them to two pins on the PCB.
The condensator on the ESP01 - USB interface board comes very close to PCB. Some insulation tape was added. As a final touch i used cable ties to join some cable bundles.

ESP01 "Break in" board (bottom view)
RESULT: "ESP01 Break-in board":
Switch for programming the ESP01,
Reset button,
Easy access to all pins of the ESP01.
Some additional switches.
A mini buzzer (One side connected to ground. Connect the other side e.g. with a Dupont cable to GPIO2)
Mini solderless prototype board for additional components/experiments.
ESP01 "Break in" with ESP01 and USB (bottom view)

Wednesday, August 24, 2016

Slicing pictures (4) using it for IRremote

The slicing of pictures of a remote control and using it for InfraRed remotes with IRcodes measured with IRsensor on ESP8266 ( or Arduino ).
Currently i store the IR remote codes from each remote control in a spreadsheet with tabs/pages for each remote control.
There are columns in the spreadsheet with
  • The IR code
  • The location A01 B01 etc on the remote control
  • Text on the remote control button (As text, for numbers enter ‘1 to force 1 as text
  • Remote control function without special characters ( FF,  not >> etc.)
From this you can make in other columns the HTML code for a table:
Use something like this as a starting point.  
<table>
<tr><td> A01.jpg </td>
<td>       B01.jpg </td>
<td>       C01.jpg </td>
<td>       D01.jpg </td></tr>
<tr><td> A02.jpg </td>
<td>       B02.jpg </td>
<td>       C02.jpg </td>
<td>       D02.jpg </td></tr>
</table>


Change code to display the picture  <img src="A01.jpg" > with formulas in your spreadsheet.  
Add the IRcontrol code and the function description as output in your table. You can also use the spreadsheet to create ( ESP8266Basic ) programming code like


Let IRcode_Power = “012435”
Let IRcode_Mute = “013335”
Let IRcode_CannelPlus  = “022435”
Let IRcode_CannelPlus  = “025535”
Let IRcode_VolumePlus  = “062235”
Let IRcode_VolumeMinus  = “061135”
Let IRcode_1 = “014435”
Let IRcode_2 = “015535”
Let IRcode_3 = “016635”
Let IRcode_FF  = “051135”
Let IRcode_FB  = “052235”


To avoid programming code like  Let IRcode_>>  = “051135” i included in the spreadsheet not only >> >| but also a column with the function without special characters (  FF Play , Pause,  Stop.)
The data from the spreadsheet can also be pushed an ( MySQL ) database to use it with a home automation system.

Monday, August 22, 2016

ESP8266_KY015


I already had tested an DHT11 module with the ESP8266. Now i also tested the DHT11 temperature / humidity sensor on the 37in1 module KY015 with ESP8266Basic

Hardware connections

-         GND
middle VCC 3V3
S        Signal line - ESP8266 Pin 5

Program

' TestKY015.bas
PinDHT11 = 5

DHT.SETUP( 11 , PinDHT11 )
cls

print "<br>Pin : " & PinDHT11 & "<br>Time : " & time() & "<br>Temperature : " & DHT.TEMP() & "<br>Humidity :" & DHT.HUM()

end

Thursday, August 18, 2016

ESP8266_KY-006_Small_passive_buzzer_module

This is the test of the KY-006 passive buzzer in the 37in1 "Arduino" sensor kit
 with ESP8266Basic.
On my blog you can also find a test of KY-006 with Arduino.
Hardware

Pin S ESP8266 Pin 5
Pin (middle) not connected
Pin - GND ESP8266 Ground


' Test KY006
cls
PinBuz = 5
pwBuz = 0
pwBuzMax = 500

html | <h1>Test KY006 Buzzer</h1> |
html | <table> |
html | <tr><td> |
button "0", [SetPinBuz0]
html | </td><td> |
slider pwBuz , 0 , pwBuzMax
html | </td><td> |
button "Max", [SetPinBuzMax] 

html | </td></tr><tr><td> |
button "SetSliders" , [SetSliders]
html | </td><td><center> |
button "SlidersMid" , [SetPinBuzMid]
html | </center></td><td> |
button " Exit ", [Exit]
html | </td></tr></table> |

wait

[SetPinBuz0]
pwBuz = 0
Goto [SetSliders]

[SetPinBuzMid]
pwBuz = pwBuzMax / 2
Goto [SetSliders]

[SetPinBuzMax]
pwBuz = pwBuzMax
Goto [SetSliders]

[SetSliders]
io(pwo,PinBuz,pwBuz)
wait

[Exit]
end



Monday, August 15, 2016

ESP8266_KY-012_Active_buzzer_module

The active buzzer ( KY-012 ) continuously makes sound and only needs power to function.
I already had tested this buzzer module with my Arduino.

Testing buzzer direct connecting to power  ( 3.3 V )
  • module Pin  -    VCC
  • Pin (middel) not connected
  • module Pin S     GND
Module gives sound, volume low !!


With ESP8266Basic program :
  • Pin - ESP output pin
  • Pin (middel) not connected
  • Pin S ESP8266 Ground 
Using the ESP8266Basic program below
 [Pin Buzzer High] button switches my buzzer on.
 [Pin Buzzer Low] button switches my buzzer off.

' TestKY012_Buzzer.bas
' 2016 J.Jeronimus
cls
PinBuz = 5

html | <h1>Testing Active buzzer KY-012</h1> |
html | Connected to pin | &  PinBuz & | <br><br> |

button "Set Pin Buzzer High", [SetPinBuzHigh] 
html | <br><br> |
button "Set Pin Buzzer Low", [SetPinBuzLow] 
html | <br><br> |
button " Exit", [Exit] 
html | <br> |

wait 

[SetPinBuzLow] 
io(po,PinBuz,0) 
wait 

[SetPinBuzHigh] 
io(po,PinBuz,1) 
wait 
[Exit] 
end


Alternatively you can connect
  • Pin - ESP VCC ( 3V3 )
  • Pin (middel) not connected
  • Pin S ESP8266 output pin 5 
Using the same ESP8266Basic program
 [Pin Buzzer High] button switches buzzer off.
 [Pin Buzzer Low] button switches buzzer on.

Wednesday, August 10, 2016

ESP8266Basic KY-004 - Button module

Tested 37in1 SensorKit "arduino" module KY-004 now with ESP8266 / ESP8266Basic

KY-004 37-1 Key switch module

Hardware connection
  • Pin S              Signal - PinIn  = 2
  • Pin middel       VCC +3V3
  • Pin -               Ground

The ESP8266Basic program

' TestKY004
' This TestPinIn.bas
' Program to test the value of PinIn and display it

PinIn = 2

timer 1000 , [NewVal]

wait

[NewVal]
cls
msg$ = "<head><meta http-equiv='refresh' content='1'></head><H1>TestPinInn</H1>" &  time() & " Pin ( " &  PinIn & " ) = " & io( pi , PinIn  )
html htmlvar( msg$ )

returngui

wait

end







Monday, August 8, 2016

ESP8266 KY-036 touch sensor

Testing KY-036 37in1 "Arduino" Metal touch sensor module

Module has a power led and a led indicating touch of metal.
Seems this 'Arduino sensor' also works on 3V3 from ESP8266

Connect

  • D0 PinIn 3
  • + VCC ( 3V3 )
  • GND GND
  • A0 (not connected / Analog signal) 

ESP8266Basic program

' TestKY036 touch
' Program to test the value of PinIn and display it

PinIn = 14

timer 1000 , [NewVal]
wait

[NewVal]
cls
msg$ = "<head><meta http-equiv='refresh' content='1'></head><H1>TestPinIn</H1>" &  time() & " Pin ( " &  PinIn & " ) = " & io( pi , PinIn  )
html htmlvar( msg$ )

returngui
wait

end






Friday, August 5, 2016

ESP8266Basic KY-019 - Relay

Testing the 37in1 'Arduino' sensor kit item KY-019 with ESP8266Basic.
The relay is a 5V relay for Arduino. 3V3 also seems to work fine on the 3V3 ESP8266

Connections

S signal  ( Pin 5 [labeled on my development module GPIO04 } )
+   VCC   3V3
-   GND

Program

cls
PinRelay = 5

html | <h1>Testing relay KY-019</h1> |
html | Connected to pin | &  PinRelay & | <br><br> |

button "Set Pin Relay High", [SetPinRelayHigh] 
html | <br><br> |
button "Set Pin Relay Low", [SetPinRelayLow] 
html | <br><br> |
button " Exit", [Exit] 
html | <br> |

wait 

[SetPinRelayLow] 
io(po,5,0) 
wait 

[SetPinRelayHigh] 
io(po,5,1) 
wait 
[Exit] 
end

Thursday, August 4, 2016

Slicing pictures (1) SHIFT CTRL J

For the InfraRed codes of the remote control on this blog i have sliced several pictures of remote controls to separate the buttons.
I received some questions and comments. Some readers want to know how to slice the pictures. I do not want to put all answers here in one long boring story or stop publishing about the ESP8266. Therefore I will post the next weeks one day a part of as serie about the slicing (and Adobe Photoshop) with some answers.
On another day every next week I will post IRcodes of one remote control. There are some articles ‘missing ‘ about some of the ( 37in1 or other ) sensors with the Arduino and i like to post (each week one article?) about this also. Posting an article about the ESP8266 Wifi and/or ESP8266Basic (with a (37in1) sensor or a project) is also on my todo (and wish) list.


In this blog article the first part of the serie about Adobe Photoshop with tips how to slice a picture of a remote control using "Adobe Photoshop Elements 6". And yes, you also can use other versions or the GIMP.
With newer versions you can also automate some parts of this slicing process.
You can do the slicing first in layers and afterwards save each layer as a separate picture. As there are several articles about using layers for editing pictures (and perhaps better written than i can do) i am not going to explain the concept of using layers.
Some tips and trick of using the layers i am going to explain. I expect you already have picture (of a remote control) that you want to slice in different pictures opened in Photoshop and saved as Photoshop format.
Most times the picture will be in "the background" layer, and that is not what i want.
- Make in a new layer a copy of the picture and rename the layer to ORG (the original picture as backup)
- Make in a second new layer a copy of the picture and rename the layer to EDIT (the picture you are going to edit).
- Delete the background layer.
- Hide (with the "eye") the ORG layer
- Select the "EDIT" layer.
- Make a grid visible to get horizontal and vertical helplines (In the menu [View] [Grid] )
- We slice horizontal and vertical and most times we need to rotate the image to adjust the positions of the buttons from the remote control { menu [Image] [Rotate] [Custom...] enter the angle and select right or left }
- Do the rotation in one time; If the angle is not correct undo ( Control Z) and try a better value.
- Now you are at a nice point to save the Photoshop file so you can come back here if something goes wrong.
and I am on a point to explain the Photoshop command SHIFT CTRL J
- Make a selection of a part of the picture in the EDIT layer.
- Press SHIFT CTRL J
- With the command SHIFT CTRL J you cut the selected part and put it in a new layer !
Next week i am going to explain the naming convention of the files for my sliced pictures.