Showing posts with label Presenter. Show all posts
Showing posts with label Presenter. Show all posts

Friday, June 9, 2017

Presenter / Laser pointer IOT DIY (6)

A i needed to repair my ESP8266 Wifi IOT laser presenter .
The battery's did not fit inside the case i used in my first version. I glued the battery pack for 3 AA batteries on the back of this box. Now, after a few months the glue became to old and dry (or i had used the laser presenter to much) and the battery pack separated from the box. I do not remember exactly the glue i used in this first version. (Some plastic glue?)
I glued it again with hot glue. Hope this time it will last longer !!


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

Friday, July 22, 2016

Presenter / Laser pointer IOT DIY (4)

This is a picture of the laser pointer / presenter.

I only added one button at the outside of the box. With more buttons the presenter perhaps could be more easy controlled. With only one button you can send different triggers to a program by pressing the button for a long or a short time.
The box is transparent. With this transparent box you can still use the RGB led and the LDR on ESP8266 module.

ESP8266Basic demo program for testing and using the laser pointer:

'   *** UseLaser.bas ***  
'   demo laser pointer
'  2016 -  JanJeronimus

cls
' Pin Button1 16 GPIO16
let PinButton1 = 16

' PinLaser    5 GPIO4
let PinLaser = 5

' Pin Reed / Button4 0 GPIO0
let PinReed = 0

' Pin Shake / Button5 2 GPIO2
let PinShake = 2

u = 0 
' u = use status 

html | <h1>Select item to control the laser</h1> |

html | <br> |
button "Button1", [Button1]
html | <br> |
button "On / Off with Button1", [ButtonT]
html | <br> |
button "Reed", [Reed]
html | <br> |
button "Shake", [Shake]
html | <br><br> |
button "On", [On]
html | <br> |
button "Off", [Off]
html | <br><br> |
button " Exit ", [Exit] 

timer 1000 ,[SetLaser]

wait 

[Button1]
u = PinButton1
wait

[ButtonT]
u = 980
wait

[Reed]
u = PinReed
wait

[Shake]
u = PinShake
wait

[Off]
u = 990
wait

[On]
u = 991
wait

[SetLaser]

' **  GPIO controlling the laser
'  * <30  u is GPIO number

if u < 30 then
io(po,PinLaser, io(pi,u) )
endif

'  ** Status Toggle with Button1
'  * u = 980  On if Button1
'  * u = 981   wait for release button
'  * u = 982  Off if Button1
'  * u = 983   wait for release button
if u = 980 then
 if io(pi,PinButton1) = 0 then
   io(po,PinLaser, io(pi,1) )
   u = 981        ' set status wait for release 
 endif
endif

' if wait for release
if u = 981 then
 if io(pi,PinButton1) = 1 then
   u = 982 
 endif
endif

if u = 982 then
 if io(pi,PinButton1) = 0 then
   io(po,PinLaser, io(pi,0) )
   u = 983        ' set status wait for release3 
 endif
endif

' if wait for release3
if u = 983 then
 if io(pi,PinButton1) = 1 then
   u = 980 
 endif
endif

'  ** Status Toggle
'  * u = 990 - 991 On / Off
if u = 990 then
io(po,PinLaser, io(pi,0) )
endif

if u = 991 then
io(po,PinLaser, io(pi,1) )
endif
wait

end

Besides the laser pointer some things you can do with this hardware:

- Presentation inside the presenter as webpages
- Wifi scan
- A simple alarm that starts if the switch vibration / tilt switch / shaking ball switch to detects if the module is moved with the next program:
- The Alarm can be switched off by pressing the Button1
- Alarm can be switched off with a magnet (using reed contact)
- The Light Detecting Resistor is currently inside the box. I have plans to move the LDR to the outside (on front of the box) for better sensibility.



Plans for modifications and adding other hardware
- Infra red led
- Infra red sensor / detector
- Move LDR outside the box
- Move RGB led outside the box (?)
- A second reed contact ???
- Connector for a headphone or other external devices
- .....

Thursday, July 21, 2016

Presenter / Laser pointer IOT DIY (3)

In this third article about my DIY IOT laser pointer / presenter programming examples/programming ideas to use this presenter / laser pointer.
You can also use the programs from earlier posts that i used to test the hardware with ESP8266Basic

Laser
Buzzer
DHT11
Input signals

1) Button1Laser.bas

A simple program to switch the laser on with Button1.
You need to keep the button pressed to leave the button on:

' Button1Laser.bas
cls
' Pin Laser    5 GPIO4
let PinLaser = 5

' Pin Button1 16 GPIO16
let PinButton1 = 16

html | <h1>Test Laser</h1> |
html | <br> |
html | <br>Use Button1 to control the laser<br> |
button " Exit ", [Exit]
html | <br> |
timer 1000 ,[Button1Chk]
html | <br> |

wait

[Button1Chk]
io(po,PinLaser, io(pi,PinButton1) )

wait

end

2) UseLaser.bas

This program gives a simple webpage to control the laser.
With the buttons [On] and [Off] you can switch the laser On or Off with the web interface.
The three buttons [Button1], [Reed] or [Shake] are to select other input to control the laser.

' UseLaser.bas
cls
' Pin Button1 16 GPIO16
let PinButton1 = 16

' PinLaser    5 GPIO4
let PinLaser = 5

' Pin Reed / Button4 0 GPIO0
let PinReed = 0

' Pin Shake / Button5 2 GPIO2
let PinShake = 2

u = 0

html | <h1>Select item to control the laser</h1> |

html | <br> |
button "Button1", [Button1]
html | <br> |
button "Reed", [Reed]
html | <br> |
button "Shake", [Shake]
html | <br><br> |
button "On", [On]
html | <br> |
button "Off", [Off]
html | <br><br> |
button " Exit ", [Exit]

timer 1000 ,[SetLaser]

wait

[Button1]
u = PinButton1
wait

[Reed]
u = PinReed
wait

[Shake]
u = PinShake
wait

[Off]
u = 990
wait

[On]
u = 991
wait

[SetLaser]

if u < 30 then
io(po,PinLaser, io(pi,u) )
endif

if u = 990 then
io(po,PinLaser, io(pi,0) )
endif

if u = 991 then
io(po,PinLaser, io(pi,1) )
endif
wait

end









Wednesday, July 20, 2016

Presenter / Laser pointer IOT DIY (2)

This blog article describes how i hardware configured my laser pointer / presenter.

PCB board connections (top down component side) are
-  DHT11
-  Buzzer
Button1  (down)      
Button1  (up)  [not connected]
Button2         [not connected yet]
Button3         [not connected yet]
Reed    ( Button4 )
Shake   (Button5)

' The "other side" of the Button1-5 connected to GND with DIP Switches (A) (1).
'  DIP switches all can be connected to GND (1) or (and!!!) VCC (2)

' To save power consumption DHT11 power can be switched off with DIP switches (B)
'  switch (1) VCC and (2) GND

There is one black (GND) female dupont cable that needs to be connected to GND of the ESP module
There are two red VCC female dupont cables one needs to be connected to VCC on the ESP8266 board.

The laser module needs to be connected to the other red VCC female dupont cable.

The other side of the  laser module is directly connected to the ESP8266 module. I used KY-nnn laser modules (  37in1 arduino module kit ) . As some of these modules are wired reverse you need to check yourself if you need to connect S to VCC or to a GPIO  line of the ESP8266.
The ESP8266 module has the following connections.

'  (left)
' -

' Pin ADC is (currently) connected to Light Detecting Resistor

' -

' Pin Button1 16 GPIO16
let PinButton1 = 16

' Pin... 14 GPIO14

' Pin... 12 GPIO12 / RGB

' Pin... 13 GPIO13 / RGB

' VCC (Red)

' (right)
' 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
let PinBuzzer = 15

' GND (Black)

I the programming examples i will try to use the same name for the devices and pins. ( PinButton1 , PinDHT11 ... )


Tuesday, July 19, 2016

Presenter / Laser pointer IOT DIY (1)

This week i will dedicate some blog posts to a presenter / laser pointer that i made.
With a laser led module and a battery you can easy make a simple own laser pointer.
 To make it a real IOT laser pointer / presenter i added a ESP8266 module, a button and as a bonus some other spare parts.
The hardware is partly configurable with dupont wires and DIL switches (More hardware details see part 2.)
ESP8266Basic is used to program the module and configure it over Wifi (See part 3 and 4)
The plastic box was a small box containing some nuts and bolts
 bought in an hardware store that i wanted to give a second life.
With superglue i glued the battery pack ( 3x AA ) included with
 my ESP8266 module on the back of the box.
 I made a hole for the laser led, a push button and
 a opening to for the wires of the battery.

I added a little PCB for some other components. For the power i added two dupont wires with female connectors to connect to the ESP8266 unit.

One additional dupont wire with female connectors is added for the Laser led. The other side of the Laser led is connected directly to the ESP8266 module.

For this version i wanted only one pushbutton on the outside of the box. ( Button1 ). As the button that i had in stock had 3 connections ( push and notPushed  and common). I connected pushed and notPushed to a jumper, so perhaps i can use his later on.
On the inside there are 4 more push buttons from top to down
Button2
Button3
Button4  ( Reed )
Button5 ( Shake )
from this button i also connected one side to the jumper.
The other (common) side of the buttons i all connected to a DIL switch with two switches.
Using this switch i can connect this common side of all switched to VCC ( 3.3.V) or all to ground.
(You must keep one of these switches in the Off position, otherwise you will short the power!!)
For a simple version you can also skip this dip switch and connect the common to ground. (If using a similar ESP8266 module).

Parallel to Button5 i added a switch vibration / tilt switch / shaking ball switch to detect if the module is moved.

Parallel to Button4 i added a reed contact switch. With this switch you can detect a magnet. A reed switch is not needed for a presenter / laser pointer but i had one in stock it is a cheap add-on feature.

I added a passive buzzer connected to GND and a jumper.

In stock i also have some DHT11 temperature humidity sensors. They are not expensive so i decided to add one also with a DIL switch to disconnect the DHT11 from the power lines for a "hardware low power mode". (In that case you can not read temperature and humidity!) The signal line of the DHT11 sensor is also connected to a jumper.

The power On / Off switch is deliberate missing. To turn the power off remove the batteries. This prevents accidentally turning of the device and keeping the batteries in a not used device for long time.

.