Monday, August 8, 2016

coc_coc_browser

Learned form my web statistics:
In my web statistics i found visitors using " coc_coc_browser ".
Seems to be a freeware web browser focused on the Vietnamese market.
Cốc Cốc is among the five most popular browsers in Vietnam, according to data from StatCounter.

Links

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.

Wednesday, August 3, 2016

ESP8266Basic KY-001 18B20 temperature sensor


Testing the ESP8266 with 18B20 temperature sensor
 ( KY-001 from 37in1Sensor kit )

Hardware connection

  •   Pin S Signal  - GPIO2 ( onewire )
  •   Pin middel VCC +3V3
  •   Pin - Ground

ESP8266Basic (version 3)

TEMP({DEVICE ID}):
Will retrieve temperature sensor reading from certain 1 wire devices connected to pin 2.
Bla = temp({Device ID})

ESP8266 Forum info

In article on http://www.esp8266.com/viewtopic.php?f=40&t=10402&p=49157&hilit=temperature#p49157
i found :
temp( 0 )  First temperature device
temp( 1 )  Second temperature device

ESP8266Basic program 

for (first) 18B20

'  TestKY019.bas  - 2016 V0.1

timer 3000 , [NewVal]
wait

[NewVal]
cls
msg$ = "<head><meta http-equiv='refresh' content='3'></head><H1>Temperature sensor </H1>" &  time() & " Temperature = " &  temp( 0 )
wprint htmlvar( msg$ ) 
returngui
wait

end





Tuesday, August 2, 2016

IR codes remote control bubble bath


List of IR codes transmitted by

another Infra Red remote control
IRcodes received at ESP8266
with ESP8266 Basic program
from this Bubble Bath control


Light
f83:RC5:12
Cont
f81:RC5:12
Intensity
f82:RC5:12
Pulse
f84:RC5:12
On/Off
f80:RC5:12

Several times first (hex)digit received 7 ( not f ) 

IR_Light = "f83:RC5:12"
IR_Cont = "f81:RC5:12"
IR_Intensity = "f82:RC5:12"
IR_Pulse = "f84:RC5:12"
IR_OnOff = "f80:RC5:12"

Monday, August 1, 2016

ESP8266Basic Servo test

ESP8266Basic has built in function for servo control.
Pin ServoA is ESP8266 pin where signal servo is connected.

Servo    ESP8266
Brown   GND
Red       VCC
Yellow  Signal

- Sorry for color of the Dupont cables on photo between ESP8266 module and the servo, exact with servo matching colors are in other projects.
- At some values of  ServoA the servo is not sot stable and shaking a little bit.
- Values below 0 and higher than 180 ( with > or < buttons ) are not prevented.

' TestServoA version 0.1
' ESP8266Basic program for testing a servo's
' On some values my servo is not stable and keeps moving
' servo 0 - 100 not full angele

PinServoA = 5

html | <h1>Demo ServoA </h1>|
html | <table><tr><td><center> |

button "Servo0" , [Servo0]
html | </center></td><td><center> |

button "Servo90" , [Servo90]
html | </center></td><td><center> |

button "Servo180" , [Servo180]
html | </center></td></tr><tr><td><center> |

button " < " , [ServoBW]
html | </center></td><td><center> |

' ESP8266Basic Manual says needt to be between 0 and 180 (=degrees)
slider ServoA , 0 , 180
html | </center></td><td><center> |

button " > " , [ServoFW]
html | </center></td></tr><tr><td> |

html | <br> |
html | </td><td><center> |

button "SetServo" , [SetServo]
html | </center></td><td><center> |

button " Exit ", [Exit]
html | </center></td></tr></table> |
wait


[Servo0]
ServoA = 0
Goto [SetServo]

[Servo90]
ServoA = 90
Goto [SetServo]

[Servo180]
ServoA = 180
Goto [SetServo]

[ServoBW]
ServoA = ServoA - 1
Goto [SetServo]

[ServoFW]
ServoA = ServoA + 1
Goto [SetServo]

[SetServo]
io(servo,PinServoA,ServoA)
wait

[Exit]
end


Screendump :

Friday, July 29, 2016

Presenter / Laser pointer IOT DIY (5)

Added Infrared sensor and IR led to the IR presenter / laser pointer.
With the IR led this device can transmit IR codes and
with the IR sensor this small device with the ESP8266 can now also
- react to IR codes
- capture IR codes from remote controls


Current configuration of IOT Laser pointer / presenter:

' PinInit.bas
' JanJeronimus 2016
cls
' All pin variables
' (Orderd as print layout)

' Pin Button1 16 GPIO16
let PinButton1 = 16

' Pin IRin  14 GPIO14 / IR receive
let PinIRin = 14

' Pin IRsend 12 GPIO12 / RGB Green / IR send
let PinIRsend = 12

' Pin... 13 GPIO13 / RGB Blue

' PinLaser    5 GPIO4
let PinLaser = 5

' PinDHT11    4  GPIO5
PinDHT11 = 4

' Pin Reed / Button4 0 GPIO0
let PinReed = 0

' Pin Shake / Button5 2 GPIO2
let PinShake = 2

' PinBuzzer  15  GPIO15   /  RGB Red
PinBuzzer = 15

Device = "ESPD01"
' Other side of Button1-5 other signal connected to GND
' With DIP switches all can be connected to VCC or (and!!!) GND

' To save power consumption DHT11 power can be switched off with DIP switches

end 

On this blog you can find  a program for reading the IR sensor. published some time ago,
The updated (quick and dirty) version below has two buttons on the screen
CLR       - Start again (Clean up the screen)
                     ( yes it is 'dirty' and spoils the return stack, however it works )
MARK  - Print a star to the output as marker.
In the output is also a timestamp using the time() function  ( not the local time .. )

' IrRec2.bas
' JanJeronimus 2016
[AGAIN]
cls
html | <h1>IR</h1> |
html | This is the IR receive program <br> |
ir.recv.setup( 14 )
button "CLS" , [AGAIN]
button "MARK" , [MARK]
irbranch [DoIR]
html | <h2> Testing IR input</h2> |
wait

[MARK]
html | * |
wait

[DoIR]
html "<BR>IR received : " & ir.recv.full( ) & " : " & time()
returngui

return

end

Thursday, July 28, 2016

ESP8266 Input GPIO pins 4 and 5 not oke

One of my ESP8266 project did not work as expected. For the ESP8266 i used a module as below. In this project GPIO4 and GPIO5 where used as input. I made changes to the ESP8266Basic program, did measurements on the sensors....
Finally i removed the module from my project and replaced it with another module. The project worked as expected!
I tested the 'bad' module and it turned out that GPIO4 and GPIO4 on this module could not be used for input signal any more. Using GPIO4 and GPIO5 for output was no problem.
When connecting the pin (with a button) to ground the little red leds show if if the pin is connected to ground.
The input signal read by the ESP8266Basic program is always 0. On a similar 'good' module GPIO4 and GPIO5 are 1 if not connected and 0 if connected to ground.
Don't know is if the input circuit is destroyed during the life of this module or this is a software issue. Plan with this module is to use in in another project where GPIO4 and GPIO5 are used as output.