My question is quite simple:
I need to have a button which would do this:
when pressed ==> send to a server the “address” provided by a dip switch (8bits).
Battery powered (to last 5 years)
When button is pressed ==>
- Power the card
- read from SD card Wifi Information (SSID/pwd)
- read from SD card Server IP / Port
- read dip switch value
- send a tcp message with DIP_SWITCH|Battery state (OK or KO)
- wait 20 max to receive OK from server
- light a led to warn user receipt has been done.
IS there anybody who could do such a magic button ?
The cost is really important because if the “Proof of concept” is working well and is cheap,
I may have quite a lot of customer to use it…
The SD Card is because I want to be able to configure easily the button without the need
of anything more than just a text editor to change Wifi or server values…
The DIP switch is because of many button, each button will have its own ID to be recognize
by the server.
Leaving in Toulouse, if anybody is out there, it could be great to meet him.
I don’t have a huge budget, just 100€ for 2 buttons as a proof…
Anyone could “help” for this ?
or maybe just tell me where I could anyone to do this for me… (because I’m programmer,
not an electronic guy)…
I can help if you want (I am located in Lorient)
I think it can be easy if I correctly understand button role: mainboard is always on, you send a TCP packet only when button is pressed ?
If it’s correct. I think you need: fez sprider, button, wifi module, card reader and breakout module for dip switch connection and 8 pull up (or down) résistors.
This will be a bottle neck “Battery powered (to last 5 years)”
mainboard is always Off…
Pressing the button will power ON the board and the software inside the board could be
something like that
Read from SD card the Wifi information
Read from SD card the Server information (IP + Port)
dip = Read dip switch value
bool batteryState = read battery state (return ok or ko)
Tcp Connect ( IP, port)
Send ( dip.ToString() + “|” + batteryState;
wait for acknoledge max 20 secondes
if(acknoledge) ==> blink one led…
shutdown the board
I see, something like this
@ David@ Emrol - Priceless
@ The Monz - Whats your target BOM and battery size?
BOM ? (Bill of Material ? )
I gues 40/50€ ($) would be the max…
@ David@ Emrol - Fantastic, I want one!! ;D
@ David@ Emrol -
That is great! I think everyone needs one.
The main board doesn’t need to be powered down, it just needs a CPU and power supply with very low sleep power consumption that can wake up from a key press.
That way rather than the button turning on the CPU power the CPU can remain powered up removing the need for external logic to allow the power to remain on once the button is released.
mbuino board (this is the mbed forum after all) has a current draw in deep power down that is well under 1uA, that should give >5 years off any battery you care to pick. Battery life would be dominated by the batteries own shelf life and the power used when active. A single LED on for 20 seconds would take more power than the CPU would use in a couple of days of power down time.
That specific CPU would be a little tight on flash if you need a TCP stack but there are similar parts with more memory.
And be careful putting too many switches on a box or this can happen.
but the mbed is not on the market right now ? is it ?
The mbuino is $10 and has been out for a while now.
or there are a lot of other mbed platforms:
However I can’t see an off the shelf platform with exactly what you need, the best solution would be to spin a custom board with something like an LPC11U35, USB socket for programming, SD card slot and the required switches and buttons.
It would certainly give a smaller and cleaner solution than connecting off the shelf bits for a little more effort. Unfortunately if you only want a couple it would also work out more expensive.
You could certainly get what you want by bolting off the shelf bits together but it would be larger and getting the idle power consumption down would get trickier. But then you could always go with a good old fashioned on/off switch to solve that issue.
I thought the Mini Arduino could handle my needs, don’t you think ?
Micro framework could also work but I guess it may be more difficult and a little bit more expensive that arduino platform…
If I would make such a device, I would base it upon mbuino because it’s small, cheap, powerful yet low powered and it has usb. I would tie the mbuino to a battery pack, probably use four AA batteries and a dc-dc 3v3 converter. The mbuino would be put on standby (using @ AndyA’s excellent library), with a button for wake-up.
The mbuino would be connected to a cheap ESP8266 wifi module (probably Lua based) and control it’s power state. I would skip the SD-card since I’ve not been able to get that working on mbuino (yet). Instead I would use the usb device library on mbuino to have it appear as a usb drive containing the configuration file when connected to a host PC. Changing the file would save the new configuration to the ESP after which the device can be disconnected and run from battery.
In fact; I have all parts in house and already wanted to make a general purpose battery powered mbuino/esp combo. All I need now is plenty of time to make my first prototype. A first test with an esp on mbuino was promising, but I still need to spend more time on Lua. I also tested the succesful wake-up of mbuino using a button. I’ve not tested the usb disk-device library yet.
BTW. Arduino might be a good alternative, but I think mBuino gives more bang for the buck. mBuino is $10+shipment, an esp8266 plus button and battery-holder perhaps not more than $5 on aliexpress. (and indeed, you’re on the mbed forum here!..)
thanks Maxint for your answer.
If I sum up what you’ve said,
we could have :
mbuino = 10€
Esp8266 = 4€
4 AA battery => ? €
dv-dv 3v3 converter => € ?
Push button = > ? €
Box to put in it => ? €
If I follow you, you mean that it is possible to see the device as a USB Drive in order to just
copy the “configuration” file from the PC to the button and then, the code will handle this
file to properly configure the ESP and send data to the server.
Anyone can do this ? in Europe for few bucks ?
FYI: this low-budget button project is solely ESP8266-Lua-based. All you need more is a reason to include an mBuino…