• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 06:26
CET 12:26
KST 20:26
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners11Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation10Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
RSL Season 3 - RO16 Groups A & B Preview Mech is the composition that needs teleportation t [TLMC] Fall/Winter 2025 Ladder Map Rotation Weekly Cups (Nov 3-9): Clem Conquers in Canada Craziest Micro Moments Of All Time?
Tourneys
RSL Revival: Season 3 Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2) Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
What happened to TvZ on Retro? FlaSh on: Biggest Problem With SnOw's Playstyle BW General Discussion Brood War web app to calculate unit interactions [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
Current Meta Simple Questions, Simple Answers PvZ map balance How to stay on top of macro?
Other Games
General Games
Clair Obscur - Expedition 33 Beyond All Reason Nintendo Switch Thread Should offensive tower rushing be viable in RTS games? Stormgate/Frost Giant Megathread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Artificial Intelligence Thread Russo-Ukrainian War Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1697 users

electronics are cool

Blogs > Xeofreestyler
Post a Reply
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
Last Edited: 2011-01-06 23:46:36
January 06 2011 23:45 GMT
#1
...but sometimes I'm terrible at understanding what actual electronics-people are talking about, lol.

I'm trying to use an MG811 sensor (datasheet) in a pretty simple arduino-based circuit.

But the problem is, even though there's the datasheet and some rare example-circuits on the internet, it makes me sadly realize how my self-schooling of electronics is terribly lacking. So I was hoping someone can simply explain how to hook a thing like this up so it reads the value. What parts I should get, etc. Once I have that I could handle the communication with pc part myself (I use processing, its so ez <3) and build it!

Its for an information design project where I read CO2 values in different locations by having my CO2 sensor made mobile by a laptop. So I'll get a cool co2-sniffing backpack out of this.

Keeping track of locations will be done with a watch, a notebook and routine, I guess

*****
Graphics
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
Last Edited: 2011-01-07 00:04:30
January 07 2011 00:02 GMT
#2
Here's some information I already know:

- The sensor uses a heating element that uses 6V. This is kinda gay. My arduino mega (fuck yea mega xtreeeeme!) has an operating voltage of 5V. Boo. Does the 1V really matter? lol
-I need some sort of amplifying component because arduino doesn't have enough accuracy or something? Some sort of op-amp or whatnot, I'm not too sure on what this is and how I should hook it up.
-There's a graphic on the datasheet that explains the relation between ppm and mV. levels of 10k ppm are deadly if I'm not mistaken so there'd have to be a lot of us stinking up the place to get to that level. Maybe the subway. Anyway I'm assuming the only ppm that matter to me are about 0 to 2k ppm. I really wish they'd hire a graphic designer to make these datasheets. *fistwave*
-The graph is exponential making it all the more difficult to derive results from mV readings. Again, *fistwave*
-Even though there's 6 pins, I think I only need to hook up 4! It's like these guys try not to get newbs into electronics by confusing us with such tomfoolery.
Graphics
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2011-01-07 00:18:27
January 07 2011 00:15 GMT
#3
what about this here? http://algasverdes.blogspot.com/2010/08/blog-post.html

/edit:
and http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272008003
Gold isn't everything in life... you need wood, too!
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
Last Edited: 2011-01-07 00:45:42
January 07 2011 00:41 GMT
#4
Ok that looks pretty sweet, thanks!

A few questions on this diagram:
[image loading]

-Whats the black 6v reg thing with in/gn/out in relation to the arduino board? I mean is it an actual component or what?
-Is a TLC271 easy to find in general electronic component stores?
-What kind of arduino pin do I hook it up to, analog input?
Graphics
motbob
Profile Blog Joined July 2008
United States12546 Posts
January 07 2011 00:44 GMT
#5
Be careful - you'll want to gradually decrease the duty cycle of your pulse-width modulated signal until you hit the critical point. Also make sure there's no D-separation active paths or else your dual vectors may collapse.
ModeratorGood content always wins.
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
January 07 2011 00:46 GMT
#6
hahah
Graphics
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2011-01-07 01:06:25
January 07 2011 00:57 GMT
#7
The "6V reg" is just supposed to be some element that generates a 6V current. The arduino itself can't do that because it runs on 5V. Also i don't know if the arduino's powersupply itself can handle serving a heater. So this might even be some external power feed. But basically: Top is either arduino 5V current or any other amount of current in, ground is just ground, and bottom is 6V current out, which is needed to supply the sensor. On the data sheet it says something about 6+-.1V, so you need to be pretty accurate with these 6V i suppose.

Regarding your question for hookup: The TLG271 amplifies the sensor output as far as i understood, the sensor obviously outputs a continuous value, so its an analog signal and needs to be read through one of the arduinos analog inputs. In the second link i posted, you can see a photo of the sensor hooked up to the arduino. I didn't check it but i'm fairly shure they connected the "pin" pin of ARD to the analog input. I guess ARD might be analog readable device or something? too lazy to look up now ^^ But i think you should get the idea now.
Gold isn't everything in life... you need wood, too!
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
January 07 2011 01:12 GMT
#8
Isn't that second link's circuit based on another sensor though? One that operates at 5V as the datasheet seems to indicate. I'm quite convinced of the fact that I'll need one of those amplifiers for the mg811
Graphics
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
January 07 2011 01:18 GMT
#9
yeah its based on another sensor which runs on 5V. Apparently the guy tried it the same way with the sensor you had and ran into some trouble. I guess you do need these additional components.

You still could try it without, but the values would probably be screwed up, at least enough to be of no use.
Gold isn't everything in life... you need wood, too!
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
January 07 2011 02:04 GMT
#10
How much ohm is that R1 resistor?
Graphics
NevilleS
Profile Blog Joined July 2009
Canada266 Posts
January 07 2011 02:42 GMT
#11
How are you powering the Arduino? Over USB or batteries...? You will probably have a 12V or 9V rail to step down to a 6V source. The "6V reg" on that diagram is a simple 6V linear regulator which you will need to supply with something 6V or higher.

Secondly, the output of the sensor is really weak so the TLG271 is probably an op-amp to amplify that signal. I'd imagine that R1 is probably a variable resistor or something to tune the gain (multiplication factor) of the signal. If I had the TLG271 datasheet I could help you here, but really you don't necessarily need to follow this guys diagrams to the law or anything. The chinese datasheet (lol so bad, don't worry, most companies datasheets are hard to follow but not this bad) just shows a regular voltage source to drive the sensor and an amplifier hooked up to the output. This is a very simple circuit, there should be a billion "build a standard non-inverting operational amplifier circuit" things on the internet by now...
NevilleS
Profile Blog Joined July 2009
Canada266 Posts
January 07 2011 02:47 GMT
#12
Also you will want it to go to an analog input of course. I hope you have a voltmeter that can detect mV, so you can debug your circuit working...
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
January 07 2011 03:04 GMT
#13
On January 07 2011 11:04 Xeofreestyler wrote:
How much ohm is that R1 resistor?


one one photo in the first link you can see they used two identical resistors, so a 10k for both might do i guess? I have absolutely no clue though, how this amplifier thingy works, all i know about electronics is from constructing a home made device like the playstation move controller before it was on the market. Also used an arduino for that, but my data sheets were written in english instead of machine translated japanese hehe, so that went somewhat easier.
Gold isn't everything in life... you need wood, too!
NevilleS
Profile Blog Joined July 2009
Canada266 Posts
January 07 2011 03:49 GMT
#14
no, that circuit looks like a non-inverting amplifier. The amplification is roughly R1/10K, so you probably want R1 = 100K or higher to get your mV signal up into the range you want to detect.
Aquafresh
Profile Joined May 2007
United States824 Posts
January 07 2011 06:57 GMT
#15
Yep NevilleS is right. Any op-amp should do provided its designed for the levels you're working with. A non-inverting amplifier circuit is pretty simple to build. http://en.wikipedia.org/wiki/Operational_amplifier#Non-inverting_amplifier

You can find lm741 op amps at radio shack for pennies. Not sure if they're suitable for this, but they should be if precision and power are not concerns.

So presumably you're going to hook this thing up to a pin and do A/D conversion on it? I'm not familiar with Arduino at all but it looks like its A/D converter is capable of resolving voltages as low as 4.9 mV. Your sensor output is in the range of 30-50mV. How much you choose to amplify that by depends on how much resolution you want, as you are limited to 4.9mV intervals. Keep in mind that your A/D pins can't handle anything over 5V so you do not want to use a resistor big than 1MΩ.

Voltage converters are pretty cheap too. I think Radio Shack should at least have some in a DIP package so you can get at the pins easily. You'll be needing to connect an external source of power to it, so make sure you don't go and order one thats meant to be put on a PCB unless you like soldering under a microscope.
ZBiR
Profile Blog Joined August 2003
Poland1092 Posts
January 07 2011 06:58 GMT
#16
- TLG271 is just a low power op amp, if you don't have that one in your local electronics shop you can buy any generic one and it will work
- 6 pins are there so you could more easily fit it to your board, if it's complex it really helps (and I don't see how's that confusing )
- choose R1 based on your voltmeter's range, so that minumum output value of the circuit is barely above the meter's minumum, and circuit's max is close to the meter's max - R1 is only there for that, it doesn't affect the sensor in any way (it would be the best to put a regulated resistor there, for example 1M, and then fit the range)
- 6V is 6V, that 1V may have a crucial meaning, don't use 5V instead
- if you have access to some known CO2 concentration areas, then it would be the best to manually calibrate your circuit. (get a few U=f(CO2) values, then fit it to an exponent)
- don't use arduino, real men print
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
Last Edited: 2011-01-07 16:46:25
January 07 2011 16:44 GMT
#17
Hahah well yeah making PCBs would be badass, I agree. But arduino makes it sooo much easier :p
(arduino is powered by usb)

Okay I think a lot of this information will surely help me on the way Gonna order some parts in the next few days and see what comes of it. Thanks guys!
Graphics
Xeofreestyler
Profile Blog Joined June 2005
Belgium6773 Posts
January 07 2011 17:01 GMT
#18
I'm getting a TLC271 asap, found a very cheap deal on ebay. Does anyone know of a webshop that ships MG811 to belgium and takes paypal? I've only seen it for sale on this site so far: http://www.futurlec.com/Gas_Sensors.shtml , but I dont have a creditcard.
Graphics
ZeaL.
Profile Blog Joined April 2009
United States5955 Posts
January 07 2011 18:40 GMT
#19
Reading this thread is like walking into an S&M convention. I have no idea whats going on but find everything incredibly interesting.
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
January 07 2011 18:53 GMT
#20
can't you just walk over to a electronics store in the next larger town? We have a shop that sells electronics components over here, i guess they could get that thing or, if not, tell me where i can get it myself.
Gold isn't everything in life... you need wood, too!
Please log in or register to reply.
Live Events Refresh
RSL Revival
10:00
Group B
Classic vs CureLIVE!
Creator vs TriGGeR
Crank 998
Tasteless551
ComeBackTV 471
IndyStarCraft 101
Rex97
3DClanTV 49
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Crank 981
Tasteless 542
IndyStarCraft 113
Rex 79
Harstem 48
StarCraft: Brood War
Sea 17941
Britney 13224
Calm 5015
Rain 4180
Jaedong 2254
Bisu 1864
Horang2 1142
Flash 830
Pusan 407
firebathero 402
[ Show more ]
Zeus 187
Hyun 179
EffOrt 154
JYJ80
hero 67
sSak 60
Rush 59
Soulkey 57
ZerO 55
ToSsGirL 53
Backho 50
Killer 46
JulyZerg 45
Barracks 32
Free 30
Mind 29
Movie 24
Bale 13
Hm[arnc] 9
Noble 9
Icarus 7
Dota 2
XcaliburYe110
Counter-Strike
fl0m2184
shoxiejesuss317
Super Smash Bros
Mew2King64
Other Games
summit1g19041
FrodaN3025
B2W.Neo689
ceh9394
crisheroes368
Pyrionflax261
KnowMe155
Fuzer 130
NeuroSwarm33
ZerO(Twitch)8
Organizations
Other Games
gamesdonequick534
StarCraft: Brood War
lovetv 9
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• LUISG 29
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota218
League of Legends
• Stunt1540
Other Games
• WagamamaTV195
Upcoming Events
Kung Fu Cup
34m
GuMiho vs MaNa
herO vs ShoWTimE
Classic vs TBD
WardiTV Korean Royale
34m
CranKy Ducklings
22h 34m
RSL Revival
22h 34m
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
1d
Cure vs Reynor
IPSL
1d 5h
ZZZero vs rasowy
Napoleon vs KameZerg
BSL 21
1d 8h
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
1d 22h
RSL Revival
1d 22h
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
2 days
[ Show More ]
WardiTV Korean Royale
2 days
BSL 21
2 days
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
2 days
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
2 days
Wardi Open
3 days
Monday Night Weeklies
3 days
WardiTV Korean Royale
4 days
BSL: GosuLeague
4 days
The PondCast
4 days
Replay Cast
5 days
RSL Revival
5 days
BSL: GosuLeague
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Proleague 2025-11-07
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
RSL Revival: Season 3
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
META Madness #9
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.